Re: BUG: stallion module cannot register it's ISR in a 2.6.10 kernel on a FC3 system

2005-02-23 Thread Darren Williams
Hi Burn

Could you try the attached patch

It solved the same problem for me, it is NOT SMP safe due
to cli() calls, though will run fine on your system. I have been
running a console box for about 1mth non-stop with these applied.

The patch does two things it allows the driver to be built-in and
updates the call to request_irq, which is what is causing the
problem.

On Fri, 18 Feb 2005, Burn Alting wrote:

> Here is the bug report. Stallion was purchased by Lantronix and they
> don't really care about this bug.
> 

> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
Darren Williams 
[EMAIL PROTECTED] 
--
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/12/08 13:37:06+11:00 [EMAIL PROTECTED] 
#   Allow stallion console driver to be built-in, and register irqs correctly 
with dev_id != NULL
# 
#   Signed-off Darren Williams 
# drivers/char/stallion.c
#   2004/12/08 13:36:57+11:00 [EMAIL PROTECTED] +12 -15
#   Pass non NULL dev_id to request_irq to allow correct irq registration. We 
use the board pointer as the dev_id
#   to allow unique identification across shared interupts.
#   
#   Remove remaining #ifdef MODULES to allow for built-in support.
#
# Signed-off Darren Williams 
#  
diff -Nru a/drivers/char/stallion.c b/drivers/char/stallion.c
--- a/drivers/char/stallion.c   2004-12-08 13:44:57 +11:00
+++ b/drivers/char/stallion.c   2004-12-08 13:44:57 +11:00
@@ -240,7 +240,6 @@
 
 /*/
 
-#ifdef MODULE
 /*
  * Define some string labels for arguments passed from the module
  * load line. These allow for easy board definitions, and easy
@@ -316,7 +315,6 @@
 MODULE_PARM(board3, "1-4s");
 MODULE_PARM_DESC(board3, "Board 3 config -> name[,ioaddr[,ioaddr2][,irq]]");
 
-#endif
 
 /*/
 
@@ -472,12 +470,10 @@
  * Declare all those functions in this driver!
  */
 
-#ifdef MODULE
 static voidstl_argbrds(void);
 static int stl_parsebrd(stlconf_t *confp, char **argp);
 
 static unsigned long stl_atol(char *str);
-#endif
 
 intstl_init(void);
 static int stl_open(struct tty_struct *tty, struct file *filp);
@@ -504,7 +500,7 @@
 
 static int stl_brdinit(stlbrd_t *brdp);
 static int stl_initports(stlbrd_t *brdp, stlpanel_t *panelp);
-static int stl_mapirq(int irq, char *name);
+static int stl_mapirq(stlbrd_t *brdp, char *name);
 static int stl_getserial(stlport_t *portp, struct serial_struct __user 
*sp);
 static int stl_setserial(stlport_t *portp, struct serial_struct __user 
*sp);
 static int stl_getbrdstats(combrd_t __user *bp);
@@ -735,7 +731,6 @@
 
 static struct class_simple *stallion_class;
 
-#ifdef MODULE
 
 /*
  * Loadable module initialization stuff.
@@ -959,7 +954,6 @@
return(1);
 }
 
-#endif
 
 /*/
 
@@ -2179,26 +2173,27 @@
  * interrupt across multiple boards.
  */
 
-static int __init stl_mapirq(int irq, char *name)
+static int __init stl_mapirq(stlbrd_t *brdp, char *name)
 {
int rc, i;
 
 #ifdef DEBUG
-   printk("stl_mapirq(irq=%d,name=%s)\n", irq, name);
+   printk("stl_mapirq(irq=%d,name=%s)\n", brdp->irq, name);
 #endif
 
rc = 0;
for (i = 0; (i < stl_numintrs); i++) {
-   if (stl_gotintrs[i] == irq)
+   if (stl_gotintrs[i] == brdp->irq)
break;
}
if (i >= stl_numintrs) {
-   if (request_irq(irq, stl_intr, SA_SHIRQ, name, NULL) != 0) {
+   /* pass the unique board pointer for shared interrupt dev_id */
+   if ( request_irq(brdp->irq, stl_intr, SA_SHIRQ, name, brdp) != 
0) {
printk("STALLION: failed to register interrupt "
-   "routine for %s irq=%d\n", name, irq);
+   "routine for %s irq=%d\n", name, brdp->irq);
rc = -ENODEV;
} else {
-   stl_gotintrs[stl_numintrs++] = irq;
+   stl_gotintrs[stl_numintrs++] = brdp->irq;
}
}
return(rc);
@@ -2389,7 +2384,7 @@
brdp->nrpanels = 1;
brdp->state |= BRD_FOUND;
brdp->hwid = status;
-   rc = stl_mapirq(brdp->irq, name);
+   rc = stl_mapirq(brdp, name);
return(rc);
 }
 
@@ -2594,7 +2589,7 @@
outb((brdp->ioctrlval | ECH_BRDDISABLE), brdp->ioctrl);
 
brdp->state |= BRD_FOUND;
-   i = stl_mapirq(brdp->irq, name);
+   i = stl_mapirq(brdp, name);

Re: BUG: stallion module cannot register it's ISR in a 2.6.10 kernel on a FC3 system

2005-02-23 Thread Darren Williams
Hi Burn

Could you try the attached patch

It solved the same problem for me, it is NOT SMP safe due
to cli() calls, though will run fine on your system. I have been
running a console box for about 1mth non-stop with these applied.

The patch does two things it allows the driver to be built-in and
updates the call to request_irq, which is what is causing the
problem.

On Fri, 18 Feb 2005, Burn Alting wrote:

 Here is the bug report. Stallion was purchased by Lantronix and they
 don't really care about this bug.
 

 
 
 -
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
--
Darren Williams dsw AT gelato.unsw.edu.au
[EMAIL PROTECTED] www.gelato.unsw.edu.au
--
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/12/08 13:37:06+11:00 [EMAIL PROTECTED] 
#   Allow stallion console driver to be built-in, and register irqs correctly 
with dev_id != NULL
# 
#   Signed-off Darren Williams dswATgelato.unsw.edu.au
# drivers/char/stallion.c
#   2004/12/08 13:36:57+11:00 [EMAIL PROTECTED] +12 -15
#   Pass non NULL dev_id to request_irq to allow correct irq registration. We 
use the board pointer as the dev_id
#   to allow unique identification across shared interupts.
#   
#   Remove remaining #ifdef MODULES to allow for built-in support.
#
# Signed-off Darren Williams dswATgelato.unsw.edu.au
#  
diff -Nru a/drivers/char/stallion.c b/drivers/char/stallion.c
--- a/drivers/char/stallion.c   2004-12-08 13:44:57 +11:00
+++ b/drivers/char/stallion.c   2004-12-08 13:44:57 +11:00
@@ -240,7 +240,6 @@
 
 /*/
 
-#ifdef MODULE
 /*
  * Define some string labels for arguments passed from the module
  * load line. These allow for easy board definitions, and easy
@@ -316,7 +315,6 @@
 MODULE_PARM(board3, 1-4s);
 MODULE_PARM_DESC(board3, Board 3 config - name[,ioaddr[,ioaddr2][,irq]]);
 
-#endif
 
 /*/
 
@@ -472,12 +470,10 @@
  * Declare all those functions in this driver!
  */
 
-#ifdef MODULE
 static voidstl_argbrds(void);
 static int stl_parsebrd(stlconf_t *confp, char **argp);
 
 static unsigned long stl_atol(char *str);
-#endif
 
 intstl_init(void);
 static int stl_open(struct tty_struct *tty, struct file *filp);
@@ -504,7 +500,7 @@
 
 static int stl_brdinit(stlbrd_t *brdp);
 static int stl_initports(stlbrd_t *brdp, stlpanel_t *panelp);
-static int stl_mapirq(int irq, char *name);
+static int stl_mapirq(stlbrd_t *brdp, char *name);
 static int stl_getserial(stlport_t *portp, struct serial_struct __user 
*sp);
 static int stl_setserial(stlport_t *portp, struct serial_struct __user 
*sp);
 static int stl_getbrdstats(combrd_t __user *bp);
@@ -735,7 +731,6 @@
 
 static struct class_simple *stallion_class;
 
-#ifdef MODULE
 
 /*
  * Loadable module initialization stuff.
@@ -959,7 +954,6 @@
return(1);
 }
 
-#endif
 
 /*/
 
@@ -2179,26 +2173,27 @@
  * interrupt across multiple boards.
  */
 
-static int __init stl_mapirq(int irq, char *name)
+static int __init stl_mapirq(stlbrd_t *brdp, char *name)
 {
int rc, i;
 
 #ifdef DEBUG
-   printk(stl_mapirq(irq=%d,name=%s)\n, irq, name);
+   printk(stl_mapirq(irq=%d,name=%s)\n, brdp-irq, name);
 #endif
 
rc = 0;
for (i = 0; (i  stl_numintrs); i++) {
-   if (stl_gotintrs[i] == irq)
+   if (stl_gotintrs[i] == brdp-irq)
break;
}
if (i = stl_numintrs) {
-   if (request_irq(irq, stl_intr, SA_SHIRQ, name, NULL) != 0) {
+   /* pass the unique board pointer for shared interrupt dev_id */
+   if ( request_irq(brdp-irq, stl_intr, SA_SHIRQ, name, brdp) != 
0) {
printk(STALLION: failed to register interrupt 
-   routine for %s irq=%d\n, name, irq);
+   routine for %s irq=%d\n, name, brdp-irq);
rc = -ENODEV;
} else {
-   stl_gotintrs[stl_numintrs++] = irq;
+   stl_gotintrs[stl_numintrs++] = brdp-irq;
}
}
return(rc);
@@ -2389,7 +2384,7 @@
brdp-nrpanels = 1;
brdp-state |= BRD_FOUND;
brdp-hwid = status;
-   rc = stl_mapirq(brdp-irq, name);
+   rc = stl_mapirq(brdp, name);
return(rc);
 }
 
@@ -2594,7 +2589,7 @@
outb((brdp-ioctrlval | ECH_BRDDISABLE), brdp-ioctrl);
 
brdp-state |= BRD_FOUND;
-   i = stl_mapirq(brdp-irq, 

BUG: stallion module cannot register it's ISR in a 2.6.10 kernel on a FC3 system

2005-02-18 Thread Burn Alting
Here is the bug report. Stallion was purchased by Lantronix and they
don't really care about this bug.

[1.] One line summary of the problem:
Stallion 4 port IO card fails when modprobe'd into kernel

[2.] Full description of the problem/report:
Under Fedora Core 3 using a ftp.kernel.org 2.6.10 kernel, when
the stallion driver module is loaded into the kernel error
messages appear in /var/log/messages. Then, if a port is accessed
further messages appear and IRQ 11 is disabled/turned off.

[3.] Keywords (i.e., modules, networking, kernel):
stallion, serial, kernel

[4.] Kernel version (from /proc/version):
Linux version 2.6.10 ([EMAIL PROTECTED]) (gcc version 3.4.2
20041017 (Red Hat 3.4.2-6.fc3)) #1 Fri Feb 18 17:44:05 EST 2005

[5.] Output of Oops.. message (if applicable) with symbolic information 
 resolved (see Documentation/oops-tracing.txt)

[6.] A small shell script or example program which triggers the
 problem (if possible)

modprobe stallion

[7.] Environment
[7.1.] Software (add the output of the ver_linux script here)
Linux swtf.comptex.com.au 2.6.10 #1 Fri Feb 18 17:44:05 EST 2005 i686
i686 i386 GNU/Linux
 
Gnu C  3.4.2
Gnu make   3.80
binutils   2.15.92.0.2
util-linux 2.12a
mount  2.12a
module-init-tools  3.1-pre5
e2fsprogs  1.35
jfsutils   1.1.7
reiserfsprogs  3.6.18
reiser4progs   line
xfsprogs   2.6.13
pcmcia-cs  3.2.7
quota-tools3.12.
PPP2.4.2
isdn4k-utils   3.3
nfs-utils  1.0.6
Linux C Library2.3.4
Dynamic linker (ldd)   2.3.4
Procps 3.2.3
Net-tools  1.60
Kbd1.12
Sh-utils   5.2.1
Modules Loaded nfsd exportfs lockd parport_pc lp parport autofs4
sunrpc dm_mod video button battery ac pl2303 ftdi_sio usbserial md5 ipv6
uhci_hcd ehci_hcd i2c_i801 i2c_core snd_usb_audio snd_usb_lib
snd_rawmidi snd_seq_device snd_intel8x0 snd_ac97_codec snd_pcm_oss
snd_mixer_oss snd_pcm snd_timer snd soundcore snd_page_alloc e1000
floppy ext3 jbd aic7xxx sd_mod scsi_mod


[7.2.] Processor information (from /proc/cpuinfo):

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 15
model   : 2
model name  : Intel(R) Pentium(R) 4 CPU 2.53GHz
stepping: 4
cpu MHz : 2546.579
cache size  : 512 KB
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 2
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips: 5046.27

[7.3.] Module information (from /proc/modules):

nfsd 210976 9 - Live 0xf8ccb000
exportfs 9344 1 nfsd, Live 0xf8c8a000
lockd 68264 2 nfsd, Live 0xf8c5a000
parport_pc 29636 1 - Live 0xf8c51000
lp 13292 0 - Live 0xf8c6d000
parport 41928 2 parport_pc,lp, Live 0xf8cbf000
autofs4 28292 0 - Live 0xf8a06000
sunrpc 182372 19 nfsd,lockd, Live 0xf8c23000
dm_mod 64276 0 - Live 0xf89ec000
video 16132 0 - Live 0xf89e7000
button 6928 0 - Live 0xf8a0
battery 9604 0 - Live 0xf89c9000
ac 5124 0 - Live 0xf883d000
pl2303 24964 0 - Live 0xf89c1000
ftdi_sio 33796 0 - Live 0xf89b7000
usbserial 30312 2 pl2303,ftdi_sio, Live 0xf8985000
md5 4608 1 - Live 0xf893d000
ipv6 273088 22 - Live 0xf8d85000
uhci_hcd 36112 0 - Live 0xf89ad000
ehci_hcd 41732 0 - Live 0xf89a1000
i2c_i801 8844 0 - Live 0xf897a000
i2c_core 23040 1 i2c_i801, Live 0xf8973000
snd_usb_audio 67904 2 - Live 0xf8961000
snd_usb_lib 13824 1 snd_usb_audio, Live 0xf898
snd_rawmidi 29984 1 snd_usb_lib, Live 0xf8998000
snd_seq_device 9484 1 snd_rawmidi, Live 0xf8939000
snd_intel8x0 36768 2 - Live 0xf898e000
snd_ac97_codec 76000 1 snd_intel8x0, Live 0xf89cd000
snd_pcm_oss 55588 0 - Live 0xf892a000
snd_mixer_oss 19968 3 snd_pcm_oss, Live 0xf8884000
snd_pcm 110856 4 snd_usb_audio,snd_intel8x0,snd_ac97_codec,snd_pcm_oss,
Live 0xf8a1
snd_timer 34692 1 snd_pcm, Live 0xf892
snd 60260 13
snd_usb_audio,snd_rawmidi,snd_seq_device,snd_intel8x0,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,
 Live 0xf88ed000
soundcore 11360 3 snd, Live 0xf888
snd_page_alloc 10372 2 snd_intel8x0,snd_pcm, Live 0xf8864000
e1000 88756 0 - Live 0xf88d6000
floppy 66736 0 - Live 0xf886e000
ext3 134280 3 - Live 0xf88fe000
jbd 86808 1 ext3, Live 0xf888a000
aic7xxx 184024 0 - Live 0xf88a8000
sd_mod 18944 0 - Live 0xf8868000
scsi_mod 136320 2 aic7xxx,sd_mod, Live 0xf881a000

[7.4.] Loaded driver and hardware information
(/proc/ioports, /proc/iomem)

-001f : dma1
0020-0021 : pic1
0040-0043 : timer0
0050-0053 : timer1
0060-006f : keyboard
0070-0077 : rtc
0080-008f : dma page reg
00a0-00a1 : pic2
00c0-00df : dma2
00f0-00ff : fpu
0170-0177 : ide1
01f0-01f7 : ide0
02f8-02ff : serial
0376-0376 : ide1

BUG: stallion module cannot register it's ISR in a 2.6.10 kernel on a FC3 system

2005-02-18 Thread Burn Alting
Here is the bug report. Stallion was purchased by Lantronix and they
don't really care about this bug.

[1.] One line summary of the problem:
Stallion 4 port IO card fails when modprobe'd into kernel

[2.] Full description of the problem/report:
Under Fedora Core 3 using a ftp.kernel.org 2.6.10 kernel, when
the stallion driver module is loaded into the kernel error
messages appear in /var/log/messages. Then, if a port is accessed
further messages appear and IRQ 11 is disabled/turned off.

[3.] Keywords (i.e., modules, networking, kernel):
stallion, serial, kernel

[4.] Kernel version (from /proc/version):
Linux version 2.6.10 ([EMAIL PROTECTED]) (gcc version 3.4.2
20041017 (Red Hat 3.4.2-6.fc3)) #1 Fri Feb 18 17:44:05 EST 2005

[5.] Output of Oops.. message (if applicable) with symbolic information 
 resolved (see Documentation/oops-tracing.txt)

[6.] A small shell script or example program which triggers the
 problem (if possible)

modprobe stallion

[7.] Environment
[7.1.] Software (add the output of the ver_linux script here)
Linux swtf.comptex.com.au 2.6.10 #1 Fri Feb 18 17:44:05 EST 2005 i686
i686 i386 GNU/Linux
 
Gnu C  3.4.2
Gnu make   3.80
binutils   2.15.92.0.2
util-linux 2.12a
mount  2.12a
module-init-tools  3.1-pre5
e2fsprogs  1.35
jfsutils   1.1.7
reiserfsprogs  3.6.18
reiser4progs   line
xfsprogs   2.6.13
pcmcia-cs  3.2.7
quota-tools3.12.
PPP2.4.2
isdn4k-utils   3.3
nfs-utils  1.0.6
Linux C Library2.3.4
Dynamic linker (ldd)   2.3.4
Procps 3.2.3
Net-tools  1.60
Kbd1.12
Sh-utils   5.2.1
Modules Loaded nfsd exportfs lockd parport_pc lp parport autofs4
sunrpc dm_mod video button battery ac pl2303 ftdi_sio usbserial md5 ipv6
uhci_hcd ehci_hcd i2c_i801 i2c_core snd_usb_audio snd_usb_lib
snd_rawmidi snd_seq_device snd_intel8x0 snd_ac97_codec snd_pcm_oss
snd_mixer_oss snd_pcm snd_timer snd soundcore snd_page_alloc e1000
floppy ext3 jbd aic7xxx sd_mod scsi_mod


[7.2.] Processor information (from /proc/cpuinfo):

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 15
model   : 2
model name  : Intel(R) Pentium(R) 4 CPU 2.53GHz
stepping: 4
cpu MHz : 2546.579
cache size  : 512 KB
fdiv_bug: no
hlt_bug : no
f00f_bug: no
coma_bug: no
fpu : yes
fpu_exception   : yes
cpuid level : 2
wp  : yes
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips: 5046.27

[7.3.] Module information (from /proc/modules):

nfsd 210976 9 - Live 0xf8ccb000
exportfs 9344 1 nfsd, Live 0xf8c8a000
lockd 68264 2 nfsd, Live 0xf8c5a000
parport_pc 29636 1 - Live 0xf8c51000
lp 13292 0 - Live 0xf8c6d000
parport 41928 2 parport_pc,lp, Live 0xf8cbf000
autofs4 28292 0 - Live 0xf8a06000
sunrpc 182372 19 nfsd,lockd, Live 0xf8c23000
dm_mod 64276 0 - Live 0xf89ec000
video 16132 0 - Live 0xf89e7000
button 6928 0 - Live 0xf8a0
battery 9604 0 - Live 0xf89c9000
ac 5124 0 - Live 0xf883d000
pl2303 24964 0 - Live 0xf89c1000
ftdi_sio 33796 0 - Live 0xf89b7000
usbserial 30312 2 pl2303,ftdi_sio, Live 0xf8985000
md5 4608 1 - Live 0xf893d000
ipv6 273088 22 - Live 0xf8d85000
uhci_hcd 36112 0 - Live 0xf89ad000
ehci_hcd 41732 0 - Live 0xf89a1000
i2c_i801 8844 0 - Live 0xf897a000
i2c_core 23040 1 i2c_i801, Live 0xf8973000
snd_usb_audio 67904 2 - Live 0xf8961000
snd_usb_lib 13824 1 snd_usb_audio, Live 0xf898
snd_rawmidi 29984 1 snd_usb_lib, Live 0xf8998000
snd_seq_device 9484 1 snd_rawmidi, Live 0xf8939000
snd_intel8x0 36768 2 - Live 0xf898e000
snd_ac97_codec 76000 1 snd_intel8x0, Live 0xf89cd000
snd_pcm_oss 55588 0 - Live 0xf892a000
snd_mixer_oss 19968 3 snd_pcm_oss, Live 0xf8884000
snd_pcm 110856 4 snd_usb_audio,snd_intel8x0,snd_ac97_codec,snd_pcm_oss,
Live 0xf8a1
snd_timer 34692 1 snd_pcm, Live 0xf892
snd 60260 13
snd_usb_audio,snd_rawmidi,snd_seq_device,snd_intel8x0,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,
 Live 0xf88ed000
soundcore 11360 3 snd, Live 0xf888
snd_page_alloc 10372 2 snd_intel8x0,snd_pcm, Live 0xf8864000
e1000 88756 0 - Live 0xf88d6000
floppy 66736 0 - Live 0xf886e000
ext3 134280 3 - Live 0xf88fe000
jbd 86808 1 ext3, Live 0xf888a000
aic7xxx 184024 0 - Live 0xf88a8000
sd_mod 18944 0 - Live 0xf8868000
scsi_mod 136320 2 aic7xxx,sd_mod, Live 0xf881a000

[7.4.] Loaded driver and hardware information
(/proc/ioports, /proc/iomem)

-001f : dma1
0020-0021 : pic1
0040-0043 : timer0
0050-0053 : timer1
0060-006f : keyboard
0070-0077 : rtc
0080-008f : dma page reg
00a0-00a1 : pic2
00c0-00df : dma2
00f0-00ff : fpu
0170-0177 : ide1
01f0-01f7 : ide0
02f8-02ff : serial
0376-0376 : ide1