Rocketport driver fails if more than four cards are inserted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Inserting a fifth Rocketport card into a machines gives me the
backtrace included below.

Looking at the source, it looks like there's two problems: the
sController array only has four entries, even though CTL_SIZE is
eight, and some pc104 initialisation is run even though we're not
running on a pc104 platform.  (Apparently the maximum number of
controllers on pc104 is four.)

The patch (against 2.6.13.3) included below fixes both these problems.
The other way to fix the latter problem would be to extend the pc104
(i.e. ISA) case to allow eight cards, but that seems somewhat less
likely...

Signed-off-by: Lars Magne Ingebrigtsen <[email protected]>

Unable to handle kernel NULL pointer dereference at virtual address 00000201
 printing eip:
dc863796
*pde = 00000000
Oops: 0000 [#1]
SMP 
Modules linked in: rocket
CPU:    0
EIP:    0060:[<dc863796>]    Not tainted VLI
EFLAGS: 00010246   (2.6.13.3) 
EIP is at init_r_port+0x126/0x334 [rocket]
eax: 00000001   ebx: 00000000   ecx: 00000004   edx: 00000000
esi: 00000000   edi: 00000080   ebp: dc869c40   esp: db8abee8
ds: 007b   es: 007b   ss: 0068
Process modprobe (pid: 886, threadinfo=db8aa000 task=db813a40)
Stack: 00000000 00000000 00000001 dc869c7c dbbe0800 00000080 dc8029c2 00000004 
       00000000 00000000 dbe17800 dc866ae0 00000004 00000000 00000000 dbe17800 
       00000004 00000000 00000000 dbe178e8 00000010 00000008 00000000 00000000 
Call Trace:
 [<dc8029c2>] register_PCI+0x9c2/0xacc [rocket]
 [<dc802aea>] init_PCI+0x1e/0x44 [rocket]
 [<dc80316f>] init_module+0x293/0x2e4 [rocket]
 [<c01311bd>] sys_init_module+0xd1/0x1cc
 [<c0102ac9>] syscall_call+0x7/0xb
Code: 01 00 00 00 83 c0 0c 89 87 0c 01 00 00 89 87 10 01 00 00 8b 57 08 80 e6 cf 89 57 08 8b 4c 24 1c 8b 7c 24 14 8b 04 8d 60 99 86 dc <8b> 04 b8 3d a6 01 00 00 74 10 76 28 3d e5 01 00 00 74 17 eb 1f 

 
--- rocket.c.~1~	Tue Oct  4 01:27:35 2005
+++ rocket.c	Sat Oct 22 13:37:41 2005
@@ -206,6 +206,14 @@
 	{-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0},
 	 {0, 0, 0, 0}, {-1, -1, -1, -1}, {0, 0, 0, 0}},
 	{-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0},
+	 {0, 0, 0, 0}, {-1, -1, -1, -1}, {0, 0, 0, 0}},
+	{-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0},
+	 {0, 0, 0, 0}, {-1, -1, -1, -1}, {0, 0, 0, 0}},
+	{-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0},
+	 {0, 0, 0, 0}, {-1, -1, -1, -1}, {0, 0, 0, 0}},
+	{-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0},
+	 {0, 0, 0, 0}, {-1, -1, -1, -1}, {0, 0, 0, 0}},
+	{-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0},
 	 {0, 0, 0, 0}, {-1, -1, -1, -1}, {0, 0, 0, 0}}
 };
 
@@ -675,17 +683,19 @@
 	init_waitqueue_head(&info->open_wait);
 	init_waitqueue_head(&info->close_wait);
 	info->flags &= ~ROCKET_MODE_MASK;
-	switch (pc104[board][line]) {
-	case 422:
-		info->flags |= ROCKET_MODE_RS422;
-		break;
-	case 485:
-		info->flags |= ROCKET_MODE_RS485;
-		break;
-	case 232:
-	default:
-		info->flags |= ROCKET_MODE_RS232;
-		break;
+	if (ctlp->boardType == ROCKET_TYPE_PC104) {
+	        switch (pc104[board][line]) {
+		case 422:
+		  info->flags |= ROCKET_MODE_RS422;
+		  break;
+		case 485:
+		  info->flags |= ROCKET_MODE_RS485;
+		  break;
+		case 232:
+		default:
+		  info->flags |= ROCKET_MODE_RS232;
+		  break;
+		}
 	}
 
 	info->intmask = RXF_TRIG | TXFIFO_MT | SRC_INT | DELTA_CD | DELTA_CTS | DELTA_DSR;

 
-- 
(domestic pets only, the antidote for overdose, milk.)
  [email protected] * Lars Magne Ingebrigtsen
-
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/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux