2005-10-22 11:49:39

by Lars Magne Ingebrigtsen

[permalink] [raw]
Subject: Rocketport driver fails if more than four cards are inserted

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


2005-10-22 12:18:05

by Jiri Slaby

[permalink] [raw]
Subject: Re: Rocketport driver fails if more than four cards are inserted

>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...
[snip]

They are in process of rewriting the driver (they wrote this to me on Sep 16):

<cite>
We have a driver in beta for 2.6 kernels. Eventually we do plan to update the
main kernel with our changes, but after the driver is more stable and we have
more time to work on it.

Here is a link to the beta if you are interested
ftp://ftp.comtrol.com/contribs/Drivers/RPort/Linux/3.02%20Beta%202.4-2.6/rocketport-linux-3.02.tgz
</cite>

The link is the same, so there is no new version, so I don't know the state of
the rewriting now, we'll see...

regards,
--
Jiri Slaby http://www.fi.muni.cz/~xslaby
~\-/~ [email protected] ~\-/~
B67499670407CE62ACC8 22A032CC55C339D47A7E