Recently, I updated a box with an ISA Advansys controller card + HP CD
Burner to -CURRENT.  On doing so, I discovered that my machine crashed at
boot due to a NULL pointer passed to free().  John Baldwin provided me
with a set of patches that appears to correct bugs in the Advansys (adv)
driver that resolve this problem, allowing the probe to continue through
(and then fail gracefully, as opposed to panicking).  I've attached the
references to the patches he provided to this e-mail.  It should be
pointed out, just for reference, that I've used this card successfully
under FreeBSD for a number of years, and the hardware is believed to be in
reasonable shape.

It's sort of an interesting story, however.  I updated in October, and
discovered the box crashed--I didn't have time to deal with it then, so
added a "disable adv0" to my /boot/kernel.conf.  Putting that in there
caused the device to probe as adv1, and work fine.  Taking out the
"disable adv0" causes the October kernel to panic in free() also.  I've
included three dmesg snippets from boot -v.

after.txt       Feb 3, 2001 + jhb patches with "di adv0" in kernel.conf
after-2.txt     Feb 3, 2001 + jhb patches without "di adv0" in kernel.conf
before.txt      Sep 29, 2000 with "di adv0" in kernel.conf
before-2.txt    Sep 29, 2000 without "di adv0" in kernel.conf

before-2 includes a panic, needless to say, due to breakage in the driver
resulting in free() dying.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Project
[EMAIL PROTECTED]      NAI Labs, Safeport Network Services

---------- Forwarded message ----------
Date: Sat, 3 Feb 2001 12:42:12 -0800 (PST)
From: John Baldwin <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: adv patch

Robert,

A patch can be found at http://www.FreeBSD.org/~jhb/patches/adv.patch
It compiles at least.

John
...
adv0: AdvanSys SCSI Host Adapter, SCSI ID 7, queue depth 16
adv0 failed to probe at port 0x110 irq 15 drq 7 on isa0
...
isa_probe_children: probing PnP devices
adv1: AdvanSys SCSI Host Adapter, SCSI ID 7, queue depth 16
adv1: Invalid baseport of 0x20 specified. Nearest valid baseport is 0x100.  Fail
ing probe.
adv1: Invalid baseport of 0x0 specified. Nearest valid baseport is 0x100.  Faili
ng probe.
adv1: Invalid baseport of 0x40 specified. Nearest valid baseport is 0x100.  Fail
ing probe.
adv1: Invalid baseport of 0x70 specified. Nearest valid baseport is 0x100.  Fail
ing probe.
unknown: <PNP0303> can't assign resources
unknown: <PNP0303> at port 0x60 on isa0
adv1: Invalid baseport of 0x61 specified. Nearest valid baseport is 0x100.  Fail
ing probe.
unknown: <PNP0800> failed to probe at port 0x61 on isa0
adv1: Invalid baseport of 0xf0 specified. Nearest valid baseport is 0x100.  Fail
ing probe.
adv1: Invalid baseport of 0x400 specified. Nearest valid baseport is 0x330.  Fai
ling probe.
unknown: <PNP0c02> can't assign resources
unknown: <PNP0c02> at port 0x10-0x1f,0x22-0x3f on isa0
unknown: <PNP0501> can't assign resources
unknown: <PNP0501> at port 0x3f8-0x3ff on isa0
unknown: <PNP0400> can't assign resources
unknown: <PNP0400> at port 0x378-0x37b on isa0
unknown: <PNP0700> can't assign resources
unknown: <PNP0700> at port 0x3f0-0x3f5 on isa0
adv1: Invalid baseport of 0x111 specified. Nearest valid baseport is 0x120.  Fai
ling probe.
unknown: <ABP5140> failed to probe at port 0x111-0x120 iomem 0xc8000-0xcffff irq
 11 drq 5 on isa0
...
adv0: AdvanSys SCSI Host Adapter, SCSI ID 7, queue depth 16
adv0 failed to probe at port 0x110 irq 15 drq 7 on isa0
...
adv1: AdvanSys SCSI Host Adapter, SCSI ID 7, queue depth 16
adv1: Invalid baseport of 0x20 specified. Nearest valid baseport is 0x100.  Fail
ing probe.
adv1: Invalid baseport of 0x0 specified. Nearest valid baseport is 0x100.  Faili
ng probe.
adv1: Invalid baseport of 0x40 specified. Nearest valid baseport is 0x100.  Fail
ing probe.
adv1: Invalid baseport of 0x70 specified. Nearest valid baseport is 0x100.  Fail
ing probe.
unknown: <PNP0303> can't assign resources
unknown: <PNP0303> at port 0x60 on isa0
adv1: Invalid baseport of 0x61 specified. Nearest valid baseport is 0x100.  Fail
ing probe.
unknown: <PNP0800> failed to probe at port 0x61 on isa0
adv1: Invalid baseport of 0xf0 specified. Nearest valid baseport is 0x100.  Fail
ing probe.
adv1: Invalid baseport of 0x400 specified. Nearest valid baseport is 0x330.  Fai
ling probe.
unknown: <PNP0c02> can't assign resources
unknown: <PNP0c02> at port 0x10-0x1f,0x22-0x3f on isa0
unknown: <PNP0501> can't assign resources
unknown: <PNP0501> at port 0x3f8-0x3ff on isa0
unknown: <PNP0400> can't assign resources
unknown: <PNP0400> at port 0x378-0x37b on isa0
unknown: <PNP0700> can't assign resources
unknown: <PNP0700> at port 0x3f0-0x3f5 on isa0
adv1: Invalid baseport of 0x111 specified. Nearest valid baseport is 0x120.  Fai
ling probe.
unknown: <ABP5140> failed to probe at port 0x111-0x120 iomem 0xc8000-0xcffff irq
 11 drq 5 on isa0
...

adv1: AdvanSys SCSI Host Adapter, SCSI ID 7, queue depth 16
adv1: <ABP5140> at port 0x110 iomem 0xc8000-0xcffff irq 11 drq 5 on isa0
adv2: Invalid baseport of 0x20 specified. Nearest valid baseport is 0x100.  Failing 
probe.
adv2: Invalid baseport of 0x0 specified. Nearest valid baseport is 0x100.  Failing 
probe.
adv2: Invalid baseport of 0x40 specified. Nearest valid baseport is 0x100.  Failing 
probe.
adv2: Invalid baseport of 0x70 specified. Nearest valid baseport is 0x100.  Failing 
probe.
unknown: <PNP0303> can't assign resources
unknown: <PNP0303> at port 0x60 on isa0
adv2: Invalid baseport of 0x61 specified. Nearest valid baseport is 0x100.  Failing 
probe.
unknown: <PNP0800> failed to probe at port 0x61 on isa0
adv2: Invalid baseport of 0xf0 specified. Nearest valid baseport is 0x100.  Failing 
probe.
adv2: Invalid baseport of 0x400 specified. Nearest valid baseport is 0x330.  Failing 
probe.
adv2: Invalid baseport of 0x10 specified. Nearest valid baseport is 0x100.  Failing 
probe.
unknown: <PNP0501> can't assign resources
unknown: <PNP0501> at port 0x3f8-0x3ff on isa0
unknown: <PNP0400> can't assign resources
unknown: <PNP0400> at port 0x378-0x37b on isa0
unknown: <PNP0700> can't assign resources
unknown: <PNP0700> at port 0x3f0-0x3f5 on isa0
BIOS Geometries:
 0:020cfe3f 0..524=525 cylinders, 0..254=255 heads, 1..63=63 sectors
 0 accounted for
Device configuration finished.

...

Waiting 15 seconds for SCSI devices to settle
(probe2:adv1:0:2:0): INQUIRY. CDB: 12 1 80 0 ff 0 
(probe2:adv1:0:2:0): ILLEGAL REQUEST asc:24,0
(probe2:adv1:0:2:0): Invalid field in CDB sks:c0,2
Creating DISK cd0
pass0 at adv1 bus 0 target 2 lun 0
pass0: <HP C4324/C4325 1.27> Removable CD-ROM SCSI-2 device 
pass0: 3.300MB/s transfers

...

(cd0:adv1:0:2:0): READ CD RECORDED CAPACITY. CDB: 25 0 0 0 0 0 0 0 0 0 
(cd0:adv1:0:2:0): NOT READY asc:4,0
(cd0:adv1:0:2:0): Logical unit not ready, cause not reportable
cd0 at adv1 bus 0 target 2 lun 0
cd0: <HP C4324/C4325 1.27> Removable CD-ROM SCSI-2 device 
cd0: 3.300MB/s transfers
cd0: Attempt to query device size failed: NOT READY, Logical unit not ready, cause not 
reportable

adv0: AdvanSys SCSI Host Adapter, SCSI ID 7, queue depth 16


Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0xc0a899b8
fault code              = supervisor read, page not present
instruction pointer     = 0x8:0xc01cfd58
stack pointer           = 0x10:0xc0479b48
frame pointer           = 0x10:0xc0479b60
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, def32 1, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 0 (swapper)
kernel: type 12 trap, code=0
Stopped at      free+0x24:      movswl  0(%eax),%ecx
db> trace
free(0,c03a8b80,c0d48b00,c0479ba8,c02eb38e) at free+0x24
adv_free(c0d48b00,c0d05078,c0cfdf80,c0d4dc00,ffffff) at adv_free+0x8e
adv_isa_probe(c0d4dc00,c0d4dc00,c0d44580,c0d4dc00,1) at adv_isa_probe+0x112
device_probe_child(c0d44580,c0d4dc00,c0d4dc00,c0479c18,0) at device_probe_child+0xca
device_probe_and_attach(c0d4dc00) at device_probe_and_attach+0x35
isa_probe_children(c0d44580) at isa_probe_children+0xde
configure(0,477c00,477000,0,c0127142) at configure+0x4a
mi_startup() at mi_startup+0x68
begin() at begin+0x29
db> 

Reply via email to