pata_acpi: take two
PATCH 1/1 pata_acpi: take two
This is a driver for motherboard SFF style PATA ports that have ACPI control methods. In theory it provides support for just about any motherboard PATA controller with ACPI methods. I've tested it on a few controllers and it seems to work fine after a couple of bug fixes from the original.
It also turns out the correct way to handle the Nvidia PATA (and the only vendor sane way to get cable detect bits) is to use ACPI for Nvidia PATA. The patch therefore also punts the Nvidia hardware to the ACPI driver but IFF the ACPI driver is compiled in, the Nvidia device has ACPI methods and ACPI is currently in use. If not it falls back to the AMD driver which handles it as a sort of bad AMD clone.
drivers/ata/Kconfig +9 -0
@@ -174,6 +174,15 @@ You can disable this at kernel boot time by using the option libata.noacpi=1 +config PATA_ACPI + tristate "ACPI firmware driver for PATA" + depends on ACPI && PCI && SATA_ACPI + help + This option enables an ACPI method driver which drives + motherboard PATA controller interfaces through the ACPI + firmware in the BIOS. This driver can sometimes handle + otherwise unsupported hardware. + config PATA_ALI tristate "ALi PATA support (Experimental)" depends on PCI && EXPERIMENTAL
drivers/ata/libata-acpi.c +89 -1
99 lines not on this page · raw message
drivers/ata/libata-acpi.h +47 -0
47 lines not on this page · raw message
drivers/ata/Makefile +2 -0
@@ -60,6 +60,8 @@ obj-$(CONFIG_PATA_TRIFLEX) += pata_triflex.o obj-$(CONFIG_PATA_IXP4XX_CF) += pata_ixp4xx_cf.o obj-$(CONFIG_PATA_PLATFORM) += pata_platform.o +# Should be last but two libata driver +obj-$(CONFIG_PATA_ACPI) += pata_acpi.o # Should be last but one libata driver obj-$(CONFIG_ATA_GENERIC) += ata_generic.o # Should be last libata driver
drivers/ata/pata_acpi.c +405 -0
405 lines not on this page · raw message
drivers/ata/pata_amd.c +5 -0
@@ -642,6 +642,11 @@if (type ==1 && rev >0x7 ) type =2 ; +#if defined(CONFIG_ATA_ACPI ) +/* Prefer the ACPI driver for Nvidia hardware */ +if (pdev->vendor ==PCI_VENDOR_ID_NVIDIA &&ata_pata_acpi_present (pdev)) +return -ENODEV ; +#endif /* Check for AMD7411 */ if (type ==3 )/* FIFO is broken */
Hello,
Just asking ... in:
Quoted 1 line
+static void *ata_pata_find_handle(struct device *dev, int port)
...
drivers/ata/libata-acpi.c line 764
Quoted 5 lines
drivers/ata/libata-acpi.c +5
-0+ chan_handle =acpi_get_child (handle, port); +if (chan_handle ==NULL ) +return NULL ; +return chan_handle; +}
why not simply:
return acpi_get_child(hadnle, port);
?
Regards,
Mariusz Kozlowski
Quoted 2 lines · On Wed, 7 Feb 2007 17:22:20 +0000 Alan <[email protected]> wrote:
This is a driver for motherboard SFF style PATA ports that have ACPI control methods.
It needs some work against the current libata tree.
drivers/ata/pata_acpi.c: In function 'pacpi_port_start':drivers/ata/pata_acpi.c:259: warning: implicit declaration of function 'ata_port_stop' drivers/ata/pata_acpi.c: At top level:drivers/ata/pata_acpi.c:327: error: 'ata_pio_data_xfer' undeclared here (not in a function) drivers/ata/pata_acpi.c:336: error: 'ata_host_stop' undeclared here (not in a function)
Quoted 6 lines · On Wed, 7 Feb 2007 16:30:26 -0800 Andrew Morton <[email protected]>…
Quoted 2 lines · On Wed, 7 Feb 2007 17:22:20 +0000 Alan <[email protected]> wrote:
This is a driver for motherboard SFF style PATA ports that have ACPI control methods.
Quoted 7 lines
It needs some work against the current libata tree.
drivers/ata/pata_acpi.c: In function 'pacpi_port_start':drivers/ata/pata_acpi.c:259: warning: implicit declaration of function 'ata_port_stop'drivers/ata/pata_acpi.c: At top level:drivers/ata/pata_acpi.c:327: error: 'ata_pio_data_xfer' undeclared here (not in a function)drivers/ata/pata_acpi.c:336: error: 'ata_host_stop' undeclared here (not in a function)
Ok added to my todo list to sort out once there's a tree to work from.