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