lkml.org 
[lkml]   [1998]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: aic7xxx-5.0.7 for 2.1 SMP kernels, Problem and Solution?

Hi Bernhard, David,

If you recall, aic7xxx-5.0.7 for 2.1 SMP was not working on my quad PPro
Dell Poweredge 6100 with two onboard aic7xxx controllers for SMP 2.1.88.
When I boot up, I got the message "Unable to handle kernel NULL pointer
dereference at virtual address 00000021" and then a kernel Ooops.

I have since filled the aic7xxx.c with printk's and isolated the cause.
The question is, why did the following go wrong and what is the
appropriate solution?

The kernel oops occurs because of line 7527 of aic7xxx.c:

if ( PCI_SLOT(temp_p->pci_device_fn) ==
PCI_SLOT(current_p->pci_device_fn) )

On my system, current_p = NULL at this point, and thus
current_p->pci_device_fn doesn't make any sense.

Here's what happened from what I can tell. During the loop for the first
aic7xxx controller, pci was NULL at 7487. But the second time around for
the 2nd aic7xxx controller, pci != NULL. As a result, it went into the
aic7xxx_reverse_scan section around line 7497:

if (!aic7xxx_reverse_scan)
{
while ( (current_p != NULL) &&
( (PCI_SLOT(current_p->pci_device_fn) |
(current_p->pci_bus << 8)) <
(PCI_SLOT(temp_p->pci_device_fn) |
(temp_p->pci_bus << 8)) ) )

The exit condition out of this while loop was because current_p==NULL.
That then brought me to line 7527 where current_p->pci_device_fn is
referenced and I got the Ooops.

Since I don't understand what current_p, prev_p, temp_p are all doing, I
don't know how to fix this. Is the problem that current_p shouldn't have
been NULL to begin with? Or is it simply a matter of checking if it is
NULL before trying to use it?

So I changed line 7526 to the following:

if ( current_p != NULL && PCI_SLOT(temp_p->pci_device_fn) ==
PCI_SLOT(current_p->pci_device_fn) )

And now the kernel will boot and things look okay! I would appreciate it
if you could advise me on whether this change was the right thing to do,
or if some other part of the aic code should be changed instead.

Thanks,
Steve

(scsi0) <Adaptec AIC-7880 Ultra SCSI host adapter> found at PCI 11/0
(scsi0) Wide Channel, SCSI ID=7, 16/255 SCBs
(scsi0) BIOS disabled, IO Port 0xec00, IO Mem 0xfc4ff000, IRQ 11
(scsi0) Resetting channel
(scsi0) Downloading sequencer code... 413 instructions downloaded
kfree(current_p)
end of while(temp_p) loop, returning to top
line 7641: p = aic7xxx_alloc
line7645: p!= NULL is true
L7647 : aic7xxx_register()
(scsi1) <Adaptec AIC-7880 Ultra SCSI host adapter> found at PCI 12/0
(scsi1) Wide Channel, SCSI ID=7, 16/255 SCBs
(scsi1) BIOS disabled, IO Port 0xe800, IO Mem 0xfc4fe000, IRQ 10
(scsi1) Resetting channel
(scsi1) Downloading sequencer code... 413 instructions downloaded
kfree(current_p)
end of while(temp_p) loop, returning to top
Line 7662: while (temp_p!=NULL)
return found
scsi0 : Adaptec AHA274x/284x/294x (EISA/VLB/PCI-Fast SCSI) 5.0.7/3.2.2
<Adaptec AIC-7880 Ultra SCSI host adapter>
scsi1 : Adaptec AHA274x/284x/294x (EISA/VLB/PCI-Fast SCSI) 5.0.7/3.2.2
<Adaptec AIC-7880 Ultra SCSI host adapter>
scsi : 2 hosts.
(scsi0:0:-1:-1) Scanning channel for devices.
(scsi0:-1:-1:-1) Allocating initial 30 SCB structures.
(scsi0:0:0:0) Using wide (16 bit) transfers.
(scsi0:0:0:0) Synchronous at 20.0MHz, offset 8.
Vendor: SEAGATE Model: ST19171W Rev: 2224
Type: Direct-Access ANSI SCSI revision: 02
Detected scsi disk sda at scsi0, channel 0, id 0, lun 0
(scsi0:0:1:0) Using wide (16 bit) transfers.
(scsi0:0:1:0) Synchronous at 20.0MHz, offset 8.
Vendor: SEAGATE Model: ST19171W Rev: 2224
Type: Direct-Access ANSI SCSI revision: 02
Detected scsi disk sdb at scsi0, channel 0, id 1, lun 0
Vendor: DELL Model: 6UW BACKPLANE Rev: 7
Type: Processor ANSI SCSI revision: 02
(scsi1:0:-1:-1) Scanning channel for devices.
(scsi1:-1:-1:-1) Allocating initial 30 SCB structures.
(scsi1:0:5:0) Synchronous at 20.0MHz, offset 8.
Vendor: NEC Model: CD-ROM DRIVE:464 Rev: 1.05
Type: CD-ROM ANSI SCSI revision: 02
scsi : detected 2 SCSI disks total.
SCSI device sda: hdwr sector= 512 bytes. Sectors= 17783112 [8683 MB] [8.7GB]
SCSI device sdb: hdwr sector= 512 bytes. Sectors= 17783112 [8683 MB] [8.7GB]






-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:41    [W:3.260 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site