libata-acpi: add ATA_FLAG_ACPI_SATA port flag

Whether a controller needs IDE or SATA ACPI hierarchy is determined by
the programming interface of the controller not by whether the
controller is SATA or PATA, or it supports slave device or not. This
patch adds ATA_FLAG_ACPI_SATA port flags which tells libata-acpi that
the port needs SATA ACPI nodes, and sets the flag for ahci and
sata_sil24.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by Tejun Heo and committed by Jeff Garzik 3cadbcc0 6ddcd3b0

+10 -7
+2 -1
drivers/ata/ahci.c
··· 173 174 AHCI_FLAG_COMMON = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 175 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | 176 - ATA_FLAG_SKIP_D2H_BSY, 177 }; 178 179 struct ahci_cmd_hdr {
··· 173 174 AHCI_FLAG_COMMON = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 175 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | 176 + ATA_FLAG_SKIP_D2H_BSY | 177 + ATA_FLAG_ACPI_SATA, 178 }; 179 180 struct ahci_cmd_hdr {
+5 -5
drivers/ata/libata-acpi.c
··· 321 322 /* Don't continue if device has no _ADR method. 323 * _GTF is intended for known motherboard devices. */ 324 - if (!(ap->cbl == ATA_CBL_SATA)) { 325 err = pata_get_dev_handle(gdev, &dev_handle, &pcidevfn); 326 if (err < 0) { 327 if (ata_msg_probe(ap)) ··· 343 344 /* Get this drive's _ADR info. if not already known. */ 345 if (!dev->obj_handle) { 346 - if (!(ap->cbl == ATA_CBL_SATA)) { 347 /* get child objects of dev_handle == channel objects, 348 * + _their_ children == drive objects */ 349 /* channel is ap->port_no */ ··· 528 ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n", 529 __FUNCTION__, ap->port_no); 530 531 - if (libata_noacpi || !(ap->cbl == ATA_CBL_SATA)) 532 return 0; 533 534 if (!ata_dev_enabled(dev) || (ap->flags & ATA_FLAG_DISABLED)) ··· 578 * we should not run GTF on PATA devices since some 579 * PATA require execution of GTM/STM before GTF. 580 */ 581 - if (!(ap->cbl == ATA_CBL_SATA)) 582 return 0; 583 584 for (ix = 0; ix < ATA_MAX_DEVICES; ix++) { ··· 641 __FUNCTION__, dev->devno, ap->port_no); 642 643 /* Don't continue if not a SATA device. */ 644 - if (!(ap->cbl == ATA_CBL_SATA)) { 645 if (ata_msg_probe(ap)) 646 ata_dev_printk(dev, KERN_DEBUG, 647 "%s: Not a SATA device\n", __FUNCTION__);
··· 321 322 /* Don't continue if device has no _ADR method. 323 * _GTF is intended for known motherboard devices. */ 324 + if (!(ap->flags & ATA_FLAG_ACPI_SATA)) { 325 err = pata_get_dev_handle(gdev, &dev_handle, &pcidevfn); 326 if (err < 0) { 327 if (ata_msg_probe(ap)) ··· 343 344 /* Get this drive's _ADR info. if not already known. */ 345 if (!dev->obj_handle) { 346 + if (!(ap->flags & ATA_FLAG_ACPI_SATA)) { 347 /* get child objects of dev_handle == channel objects, 348 * + _their_ children == drive objects */ 349 /* channel is ap->port_no */ ··· 528 ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER: port#: %d\n", 529 __FUNCTION__, ap->port_no); 530 531 + if (libata_noacpi || !(ap->flags & ATA_FLAG_ACPI_SATA)) 532 return 0; 533 534 if (!ata_dev_enabled(dev) || (ap->flags & ATA_FLAG_DISABLED)) ··· 578 * we should not run GTF on PATA devices since some 579 * PATA require execution of GTM/STM before GTF. 580 */ 581 + if (!(ap->flags & ATA_FLAG_ACPI_SATA)) 582 return 0; 583 584 for (ix = 0; ix < ATA_MAX_DEVICES; ix++) { ··· 641 __FUNCTION__, dev->devno, ap->port_no); 642 643 /* Don't continue if not a SATA device. */ 644 + if (!(ap->flags & ATA_FLAG_ACPI_SATA)) { 645 if (ata_msg_probe(ap)) 646 ata_dev_printk(dev, KERN_DEBUG, 647 "%s: Not a SATA device\n", __FUNCTION__);
+2 -1
drivers/ata/sata_sil24.c
··· 237 /* host flags */ 238 SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 239 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | 240 - ATA_FLAG_NCQ | ATA_FLAG_SKIP_D2H_BSY, 241 SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ 242 243 IRQ_STAT_4PORTS = 0xf,
··· 237 /* host flags */ 238 SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 239 ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | 240 + ATA_FLAG_NCQ | ATA_FLAG_SKIP_D2H_BSY | 241 + ATA_FLAG_ACPI_SATA, 242 SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ 243 244 IRQ_STAT_4PORTS = 0xf,
+1
include/linux/libata.h
··· 173 ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */ 174 ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ 175 ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ 176 177 /* The following flag belongs to ap->pflags but is kept in 178 * ap->flags because it's referenced in many LLDs and will be
··· 173 ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */ 174 ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ 175 ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ 176 + ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ 177 178 /* The following flag belongs to ap->pflags but is kept in 179 * ap->flags because it's referenced in many LLDs and will be