PATCH: 2.6.10 - Incorrect return from PCI ide controller

From: Alan Cox
Date: Mon Dec 27 2004 - 10:44:28 EST


Several IDE drivers return positive values as errors in the PCI setup
code. Unfortunately the PCI layer considers positive values as success
so the driver skips the device but still claims it and things then go
downhill.

This fixes the IT8172 driver. There are other drivers with this bug (eg
generic) but the -ac IDE is sufficiently diverged from base that someone
else needs to generate/test the more divergent cases.

Alan

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.10/drivers/ide/pci/it8172.c linux-2.6.10/drivers/ide/pci/it8172.c
--- linux.vanilla-2.6.10/drivers/ide/pci/it8172.c 2004-12-25 21:15:34.000000000 +0000
+++ linux-2.6.10/drivers/ide/pci/it8172.c 2004-12-26 17:22:17.577730520 +0000
@@ -270,7 +270,7 @@
{
if ((!(PCI_FUNC(dev->devfn) & 1) ||
(!((dev->class >> 8) == PCI_CLASS_STORAGE_IDE))))
- return 1; /* IT8172 is more than only a IDE controller */
+ return -EAGAIN; /* IT8172 is more than an IDE controller */
ide_setup_pci_device(dev, &it8172_chipsets[id->driver_data]);
return 0;
}

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