Subject: kern/4739: lc probe is seriously broken
To: None <gnats-bugs@gnats.netbsd.org>
From: None <Anders.Hjalmarsson@economics.gu.se>
List: netbsd-bugs
Date: 12/21/1997 23:46:26
>Number: 4739
>Category: kern
>Synopsis: lc probe is seriously broken
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: kern-bug-people (Kernel Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Dec 21 14:50:00 1997
>Last-Modified:
>Originator: Anders Hjalmarsson
>Organization:
>Release: NetBSD 1.3_BETA Dec 18, 1997
>Environment:
System: NetBSD econahja.econ.gu.se 1.3_BETA NetBSD 1.3_BETA (ECONAHJA) #74: Fri Dec 19 00:59:47 CET 1997 econahja@econahja.econ.gu.se:/usr/src/sys/arch/i386/compile/ECONAHJA i386
>Description:
The probe function lemac_isa_probe in if_lc.c does not set all
the fields in ia that are used by the attach function. (It only
sets iq_irq, it should also set ia_iosize, ia_maddr, and ia_msize.)
The computer panics or reboots after a short while, probably
from using a null handle.
>How-To-Repeat:
Boot a kernel on a machine with such an ethernet card.
Dmesg output with broken kernel:
lc0 at isa0 port 0x300-0x965 irq 10: DE205-AC
Correct:
lc0 at isa0 port 0x300-0x31f iomem 0xd0000-0xd07ff irq 10: DE205-AC
>Fix:
Diff from if_lc_isa.c 1.4.2.1
--- if_lc_isa.c.orig Mon Nov 17 20:23:40 1997
+++ if_lc_isa.c Sun Dec 21 16:29:28 1997
@@ -144,7 +144,12 @@
if (ia->ia_irq != irq && ia->ia_irq != IRQUNK)
printf("%s%d: overriding IRQ %d to %d\n", lc_cd.cd_name, cf->cf_unit,
ia->ia_irq, irq);
- ia->ia_irq = irq;
+
+ ia->ia_irq = irq;
+ ia->ia_iosize = LEMAC_IOSIZE;
+ ia->ia_maddr = maddr;
+ ia->ia_msize = msize;
+
/*
* I guess we've found one.
>Audit-Trail:
>Unformatted: