From: Remi (Needs sane changelog) Since after 2.6.18-mm3, I'm unable to boot mm trees getting the following message: ata_piix: probe of 0000:00:1f.2 failed with error -16 Kernel panic - not syncing: Attempted to kill init! I disabled most options in my .config file just keeping ata_piix enabled. 2.6.19-rc5 still boots fine but 2.6.19-rc-mm1 gives the same previous message. I bissected the 2.6.19-rc5-mm1 tree and found the patch preventing my DELL D610 laptop from booting. gregkh-pci-pci-quirks-fix-the-festering-mess-that-claims-to-handle-ide-quirks.patch Digging further into the source code, I added some code to display I/O ports allocations and stack traces at some useful points. (http://remi.colinet.free.fr/ktrace/002/rco.patch) So what happens with the previous patch applied? (http://remi.colinet.free.fr/ktrace/002/dmesg_2.6.19-rc5-mm1-rco1) => Step 1 : with the patch applied, the resource of the pci device dev->resource[x] are initialized to claim legacy I/O ports from 0x01f0 up to 0x01f7 with the flag IORESOURCE_IO (drivers/pci/probe.c). => Step 2 : then, these resources are allocated from the I/O port resources, by pcibios_allocate_resources (arch/i386/pci/i386.c). [] show_trace_log_lvl+0x1a/0x2f [] show_trace+0x12/0x14 [] dump_stack+0x19/0x1b [] catch_resource+0x36/0x38 [] request_resource+0x36/0x47 [] pcibios_allocate_resources+0x7d/0x130 [] pcibios_resource_survey+0x14/0x20 [] pcibios_init+0x5f/0x87 [] init+0x127/0x2cf [] kernel_thread_helper+0x7/0x10 ======================= I/O port resources give : 01f0-01f7 : 0000:00:1f.2 Hence, the I/O port resources are allocated, but with the flag IORESOURCE_IO. => Step 3 : then the following code is executed [] __request_region+0x9d/0xa6 [] quirk_intel_ide_combined+0x1a4/0x1f9 [] pci_fixup_device+0x6b/0x77 [] pci_init+0x14/0x2c [] init+0x127/0x2cf [] kernel_thread_helper+0x7/0x10 which requests the same resources but with the IORESOURCE_BUSY flag. I/O ports resources are then : 01f0-01f7 : 0000:00:1f.2 01f0-01f7 : libata => Step 4 : then the libata tries to allocate once more the same ressources and fails. [] ata_pci_init_one+0xad/0x423 [libata] [] piix_init_one+0x4b7/0x4d4 [ata_piix] [] pci_device_probe+0x39/0x5b [] really_probe+0x7a/0x101 [] driver_probe_device+0x95/0xa1 [] __driver_attach+0x4c/0x83 [] bus_for_each_dev+0x37/0x5c [] driver_attach+0x19/0x1b [] bus_add_driver+0x67/0x16a [] driver_register+0x76/0x7b [] __pci_register_driver+0x7e/0x99 [] piix_init+0x12/0x25 [ata_piix] [] sys_init_module+0x1749/0x1926 [] syscall_call+0x7/0xb Ending with the messages. PCI: Unable to reserve I/O region #1:8@1f0 for device 0000:00:1f.2 And then, ata_piix: probe of 0000:00:1f.2 failed with error -16 Kernel panic - not syncing: Attempted to kill init! I/O ports resources are : 0170-0177 : 0000:00:1f.2 0170-0177 : ide1 01f0-01f7 : 0000:00:1f.2 01f0-01f7 : libata 0376-0376 : 0000:00:1f.2 0376-0376 : ide1 What happens in 2.6.19-rc5 (which boots fine)? (http://remi.colinet.free.fr/ktrace/002/dmesg_2.6.19-rc5-mm1-rco2) Step 1 : dev-resource are not initialized. So, step 2 doesn't request resources. Step 3 allocates I/O ports. [] show_trace_log_lvl+0x1a/0x2f [] show_trace+0x12/0x14 [] dump_stack+0x19/0x1b [] catch_resource+0x36/0x38 [] __request_region+0x9d/0xa6 [] quirk_intel_ide_combined+0x1a4/0x1f9 [] pci_fixup_device+0x6b/0x77 [] pci_init+0x14/0x2c [] init+0x127/0x2cf [] kernel_thread_helper+0x7/0x10 Step 4, doesn't request the I/O ports in pci_request_regions() and falls back to legacy mode in the function ata_pci_init_one (drivers/ata/libata-sff.c) Alan sayeth: ata_pci_init_one should have followed the legacy_mode path at this point, and the legacy mode path should not be trying to request the legacy regions the quirk code already reserved. I suspect the code should only do the pci_request_regions() call if the device on if (!legacy_mode), and the legacy code should pci_request_region(pdev, 4, ...); And lo... Cc: Greg KH Cc: Alan Cox Signed-off-by: Andrew Morton --- drivers/ata/libata-sff.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff -puN drivers/ata/libata-sff.c~pci-quirks-fix-the-festering-mess-that-claims-to-handle-ide-quirks-ide-fix drivers/ata/libata-sff.c --- a/drivers/ata/libata-sff.c~pci-quirks-fix-the-festering-mess-that-claims-to-handle-ide-quirks-ide-fix +++ a/drivers/ata/libata-sff.c @@ -1027,13 +1027,13 @@ int ata_pci_init_one (struct pci_dev *pd #endif } - rc = pci_request_regions(pdev, DRV_NAME); - if (rc) { - disable_dev_on_err = 0; - goto err_out; - } - - if (legacy_mode) { + if (!legacy_mode) { + rc = pci_request_regions(pdev, DRV_NAME); + if (rc) { + disable_dev_on_err = 0; + goto err_out; + } + } else { if (!request_region(ATA_PRIMARY_CMD, 8, "libata")) { struct resource *conflict, res; res.start = ATA_PRIMARY_CMD; _