From: Alan Cox <alan@redhat.com> Date: Tue, 15 Jan 2008 09:41:28 -0500 Subject: [ide] hotplug docking support for some laptops Message-id: 20080115144128.GA13450@devserv.devel.redhat.com O-Subject: [RHEL 5.x PATCH]: Hotplug docking support for some laptops Bugzilla: 230541 Kernel part of fixes for #230541 This patch allows arbitary assignment of PIIX/ICH ports to the new libata layer so we can cope with laptops that expose old style interfaces with hotplugging. Boot option intel_via_libata=1 selects the new driver over the default and you may also need ide0=noprobe or ide1=noprobe if the port is in legacy mode. I've done it this way rather than by adding PCI identifiers because we will be adding them again and again it seems. I suspect this patch as is for example will also solve Stratus requirements. Making it a boot options means no regressions or suprises for customers with existing systems - they control and choose to transfer to libata on those ports. It also makes the fix pleasantly easy to verify. The second patch segment adds a missing PCI ID to the ata_piix driver that was added upstream post RHEL5. It may not be needed with current sata merges Tested, including verifying we can now dock ultrabay drives on a T61. Not upstream, not relevant to upstream. Alan Acked-by: Aristeu Rozanski <arozansk@redhat.com> Acked-by: Prarit Bhargava <prarit@redhat.com> Acked-by: Pete Zaitcev <zaitcev@redhat.com> diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index f7a243a..7433119 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c @@ -210,6 +210,7 @@ static const struct pci_device_id piix_pci_tbl[] = { /* ICH7/7-R (i945, i975) UDMA 100*/ { 0x8086, 0x27DF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, { 0x8086, 0x269E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, + { 0x8086, 0x2850, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, /* ICH8 Mobile PATA Controller */ { 0x8086, 0x2850, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c index 8a09313..0e63f68 100644 --- a/drivers/ide/pci/piix.c +++ b/drivers/ide/pci/piix.c @@ -103,6 +103,10 @@ #include <asm/io.h> static int no_piix_dma; +static int intel_via_libata; /* Use libata for Intel devices */ + +module_param(intel_via_libata, int, 0444); +MODULE_PARM_DESC(intel_via_libata, "Use libata SATA/PATA driver for Intel IDE"); /** * piix_ratemask - compute rate mask for PIIX IDE @@ -678,6 +682,10 @@ static struct pci_driver driver = { static int __init piix_ide_init(void) { + if (intel_via_libata) { + printk(KERN_INFO "Using libata for Intel IDE.\n"); + return 0; + } piix_check_450nx(); return ide_pci_register_driver(&driver); }