Linux-kernel mailing list archive 2000-01,: Re: PCI resource allocation (was Re: Ok, making ready for pre-2.4 and code-freeze..)

# Re: PCI resource allocation (was Re: Ok, making ready for pre-2.4 and code-freeze..)

Gerard Roudier (groudier@club-internet.fr)
Mon, 3 Jan 2000 23:30:23 +0100 (MET)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Doug Oleinik -- 1-414-527-0770 x 3305: "Re: gdth calls scsi_do_cmd() with an uninitialized Scsi_Device structure"
- Previous message: Jamie Lokier: "Re: IDE fs corruption with 2.3.33 to 2.3.35-pre6"

On Mon, 3 Jan 2000, Thomas Sailer wrote:

> Martin Mares wrote:
>
> > pci_assign_resource() is already present in pre-2.3.35.
>
> Thanks, but on the machine where I have the sonicvibes installed,
> 2.3.35 crashes very early during boot.
>
> It oopses in ncr53c8xx_pci_init, just after the call to
> ncr_get_Tekram_nvram, when it tries to execute nvram->type = 0;,
> the nvram pointer seems to be bogus...

It is so.

> Any idea what went wrong?

There is some code that should have been moved, but has been just copied
to its destination with previous code left in place. The driver should no
longer try to read the NVRAM from ncr53c8xx_pci_init, in fact.
The patch below should complete the code move. You may let me know if it
fixes.

Sorry for the inconvenience.

Gérard.

--- SAVE/ncr53c8xx.c Mon Jan 3 22:57:24 2000
+++ ./ncr53c8xx.c Mon Jan 3 23:12:12 2000
@@ -9660,9 +9660,6 @@
uint irq;
ulong base, base_2, io_port;
int i;
-#ifdef SCSI_NCR_NVRAM_SUPPORT
- ncr_nvram *nvram = device->nvram;
-#endif
ncr_chip *chip;
/*
@@ -10001,52 +9998,7 @@
device->slot.io_port = io_port;
device->slot.irq = irq;
device->attach_done = 0;
-#ifdef SCSI_NCR_NVRAM_SUPPORT
- if (!nvram)
- goto out;
-
- /*
- ** Get access to chip IO registers
- */
-#ifdef NCR_IOMAPPED
- request_region(io_port, 128, "ncr53c8xx");
- device->slot.port = io_port;
-#else
- device->slot.reg = (struct ncr_reg *) remap_pci_mem((ulong) base, 128);
- if (!device->slot.reg)
- goto out;
-#endif
-
- /*
- ** Try to read SYMBIOS nvram.
- ** Data can be used to order booting of boards.
- **
- ** Data is saved in ncr_device structure if NVRAM found. This
- ** is then used to find drive boot order for ncr_attach().
- **
- ** NVRAM data is passed to Scsi_Host_Template later during ncr_attach()
- ** for any device set up.
- **
- ** Try to read TEKRAM nvram if Symbios nvram not found.
- */
-
- if (!ncr_get_Symbios_nvram(&device->slot, &nvram->data.Symbios))
- nvram->type = SCSI_NCR_SYMBIOS_NVRAM;
- else if (!ncr_get_Tekram_nvram(&device->slot, &nvram->data.Tekram))
- nvram->type = SCSI_NCR_TEKRAM_NVRAM;
- else
- nvram->type = 0;
-out:
- /*
- ** Release access to chip IO registers
- */
-#ifdef NCR_IOMAPPED
- release_region(device->slot.port, 128);
-#else
- unmap_pci_mem((vm_offset_t) device->slot.reg, (u_long) 128);
-#endif
-#endif /* SCSI_NCR_NVRAM_SUPPORT */
return 0;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

- Next message: Doug Oleinik -- 1-414-527-0770 x 3305: "Re: gdth calls scsi_do_cmd() with an uninitialized Scsi_Device structure"
- Previous message: Jamie Lokier: "Re: IDE fs corruption with 2.3.33 to 2.3.35-pre6"