Lines Matching +full:hba +full:- +full:cap
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * ahci.c - AHCI SATA support
6 * Please ALWAYS copy linux-ide@vger.kernel.org
9 * Copyright 2004-2005 Red Hat, Inc.
12 * as Documentation/driver-api/libata.rst
25 #include <linux/dma-mapping.h>
32 #include <linux/ahci-remap.h>
33 #include <linux/io-64-nonatomic-lo-hi.h>
265 { PCI_VDEVICE(INTEL, 0x06d6), board_ahci }, /* Comet Lake PCH-H RAID */
275 { PCI_VDEVICE(INTEL, 0x27c6), board_ahci }, /* ICH7-M DH */
359 { PCI_VDEVICE(INTEL, 0x9dd3), board_ahci_low_power }, /* Cannon Lake PCH-LP AHCI */
380 { PCI_VDEVICE(INTEL, 0x43d4), board_ahci }, /* Rocket Lake PCH-H RAID */
381 { PCI_VDEVICE(INTEL, 0x43d5), board_ahci }, /* Rocket Lake PCH-H RAID */
382 { PCI_VDEVICE(INTEL, 0x43d6), board_ahci }, /* Rocket Lake PCH-H RAID */
383 { PCI_VDEVICE(INTEL, 0x43d7), board_ahci }, /* Rocket Lake PCH-H RAID */
408 { PCI_VDEVICE(INTEL, 0xa102), board_ahci }, /* Sunrise Point-H AHCI */
410 { PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */
411 { PCI_VDEVICE(INTEL, 0xa106), board_ahci }, /* Sunrise Point-H RAID */
413 { PCI_VDEVICE(INTEL, 0xa10f), board_ahci }, /* Sunrise Point-H RAID */
422 { PCI_VDEVICE(INTEL, 0xa356), board_ahci }, /* Cannon Lake PCH-H RAID */
423 { PCI_VDEVICE(INTEL, 0x06d7), board_ahci }, /* Comet Lake-H RAID */
424 { PCI_VDEVICE(INTEL, 0xa386), board_ahci }, /* Comet Lake PCH-V RAID */
430 { PCI_VDEVICE(INTEL, 0x02d3), board_ahci_low_power }, /* Comet Lake PCH-U AHCI */
432 /* Elkhart Lake IDs 0x4b60 & 0x4b62 https://sata-io.org/product/8803 not tested yet */
434 { PCI_VDEVICE(INTEL, 0x7ae2), board_ahci_low_power }, /* Alder Lake-P AHCI */
459 { PCI_VDEVICE(AMD, 0x7800), board_ahci }, /* AMD Hudson-2 */
460 { PCI_VDEVICE(AMD, 0x7801), board_ahci_no_debounce_delay }, /* AMD Hudson-2 (AHCI mode) */
606 { PCI_VDEVICE(PROMISE, 0x3781), board_ahci }, /* FastTrak TX8660 ahci-mode */
667 static int mobile_lpm_policy = -1;
674 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA) { in ahci_pci_save_initial_config()
675 switch (pdev->device) { in ahci_pci_save_initial_config()
677 dev_info(&pdev->dev, "ASM1166 has only six ports\n"); in ahci_pci_save_initial_config()
678 hpriv->saved_port_map = 0x3f; in ahci_pci_save_initial_config()
681 dev_info(&pdev->dev, "ASM1064 has only four ports\n"); in ahci_pci_save_initial_config()
682 hpriv->saved_port_map = 0xf; in ahci_pci_save_initial_config()
687 if (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361) { in ahci_pci_save_initial_config()
688 dev_info(&pdev->dev, "JMB361 has only one port\n"); in ahci_pci_save_initial_config()
689 hpriv->saved_port_map = 1; in ahci_pci_save_initial_config()
697 if (hpriv->flags & AHCI_HFLAG_MV_PATA) { in ahci_pci_save_initial_config()
698 if (pdev->device == 0x6121) in ahci_pci_save_initial_config()
699 hpriv->mask_port_map = 0x3; in ahci_pci_save_initial_config()
701 hpriv->mask_port_map = 0xf; in ahci_pci_save_initial_config()
702 dev_info(&pdev->dev, in ahci_pci_save_initial_config()
706 ahci_save_initial_config(&pdev->dev, hpriv); in ahci_pci_save_initial_config()
711 struct pci_dev *pdev = to_pci_dev(host->dev); in ahci_pci_reset_controller()
712 struct ahci_host_priv *hpriv = host->private_data; in ahci_pci_reset_controller()
730 struct ahci_host_priv *hpriv = host->private_data; in ahci_pci_init_controller()
731 struct pci_dev *pdev = to_pci_dev(host->dev); in ahci_pci_init_controller()
736 if (hpriv->flags & AHCI_HFLAG_MV_PATA) { in ahci_pci_init_controller()
737 if (pdev->device == 0x6121) in ahci_pci_init_controller()
747 dev_dbg(&pdev->dev, "PORT_IRQ_STAT 0x%x\n", tmp); in ahci_pci_init_controller()
758 struct ata_port *ap = link->ap; in ahci_vt8251_hardreset()
759 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_vt8251_hardreset()
763 hpriv->stop_engine(ap); in ahci_vt8251_hardreset()
765 rc = sata_link_hardreset(link, sata_ehc_deb_timing(&link->eh_context), in ahci_vt8251_hardreset()
768 hpriv->start_engine(ap); in ahci_vt8251_hardreset()
771 * request follow-up softreset. in ahci_vt8251_hardreset()
773 return online ? -EAGAIN : rc; in ahci_vt8251_hardreset()
779 struct ata_port *ap = link->ap; in ahci_p5wdh_hardreset()
780 struct ahci_port_priv *pp = ap->private_data; in ahci_p5wdh_hardreset()
781 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_p5wdh_hardreset()
782 u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG; in ahci_p5wdh_hardreset()
787 hpriv->stop_engine(ap); in ahci_p5wdh_hardreset()
790 ata_tf_init(link->device, &tf); in ahci_p5wdh_hardreset()
794 rc = sata_link_hardreset(link, sata_ehc_deb_timing(&link->eh_context), in ahci_p5wdh_hardreset()
797 hpriv->start_engine(ap); in ahci_p5wdh_hardreset()
800 * ASUS P5W-DH Deluxe doesn't send signature FIS after in ahci_p5wdh_hardreset()
822 * ahci_avn_hardreset - attempt more aggressive recovery of Avoton ports.
826 * be recovered by a SATA-hard-reset alone. The failing signature is
839 const unsigned int *timing = sata_ehc_deb_timing(&link->eh_context); in ahci_avn_hardreset()
840 struct ata_port *ap = link->ap; in ahci_avn_hardreset()
841 struct ahci_port_priv *pp = ap->private_data; in ahci_avn_hardreset()
842 struct ahci_host_priv *hpriv = ap->host->private_data; in ahci_avn_hardreset()
843 u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG; in ahci_avn_hardreset()
844 unsigned long tmo = deadline - jiffies; in ahci_avn_hardreset()
849 hpriv->stop_engine(ap); in ahci_avn_hardreset()
854 int port = ap->port_no; in ahci_avn_hardreset()
855 struct ata_host *host = ap->host; in ahci_avn_hardreset()
856 struct pci_dev *pdev = to_pci_dev(host->dev); in ahci_avn_hardreset()
859 ata_tf_init(link->device, &tf); in ahci_avn_hardreset()
881 hpriv->start_engine(ap); in ahci_avn_hardreset()
893 struct ahci_host_priv *hpriv = host->private_data; in ahci_pci_disable_interrupts()
894 void __iomem *mmio = hpriv->mmio; in ahci_pci_disable_interrupts()
899 * transition of the HBA to D3 state. in ahci_pci_disable_interrupts()
934 struct ahci_host_priv *hpriv = host->private_data; in ahci_pci_device_suspend()
936 if (hpriv->flags & AHCI_HFLAG_NO_SUSPEND) { in ahci_pci_device_suspend()
937 dev_err(&pdev->dev, in ahci_pci_device_suspend()
939 return -EIO; in ahci_pci_device_suspend()
957 if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) { in ahci_pci_device_resume()
979 if (hpriv->cap & HOST_CAP_64) { in ahci_configure_dma_masks()
981 if (hpriv->flags & AHCI_HFLAG_43BIT_ONLY) in ahci_configure_dma_masks()
988 * If the device fixup already set the dma_mask to some non-standard in ahci_configure_dma_masks()
992 * bogus, platform code should use dev->bus_dma_limit instead.. in ahci_configure_dma_masks()
994 if (pdev->dma_mask && pdev->dma_mask < DMA_BIT_MASK(32)) in ahci_configure_dma_masks()
997 rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(dma_bits)); in ahci_configure_dma_masks()
999 dev_err(&pdev->dev, "DMA enable failed\n"); in ahci_configure_dma_masks()
1005 struct pci_dev *pdev = to_pci_dev(host->dev); in ahci_pci_print_info()
1023 * hardwired to on-board SIMG 4726. The chipset is ICH8 and doesn't
1038 * assumed without follow-up softreset.
1053 struct pci_dev *pdev = to_pci_dev(host->dev); in ahci_p5wdh_workaround()
1055 if (pdev->bus->number == 0 && pdev->devfn == PCI_DEVFN(0x1f, 2) && in ahci_p5wdh_workaround()
1057 struct ata_port *ap = host->ports[1]; in ahci_p5wdh_workaround()
1059 dev_info(&pdev->dev, in ahci_p5wdh_workaround()
1060 "enabling ASUS P5W DH Deluxe on-board SIMG4726 workaround\n"); in ahci_p5wdh_workaround()
1062 ap->ops = &ahci_p5wdh_ops; in ahci_p5wdh_workaround()
1063 ap->link.flags |= ATA_LFLAG_NO_SRST | ATA_LFLAG_ASSUME_ATA; in ahci_p5wdh_workaround()
1103 return pdev->vendor == PCI_VENDOR_ID_NVIDIA && in is_mcp89_apple()
1104 pdev->device == PCI_DEVICE_ID_NVIDIA_NFORCE_MCP89_SATA && in is_mcp89_apple()
1105 pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE && in is_mcp89_apple()
1106 pdev->subsystem_device == 0xcb89; in is_mcp89_apple()
1115 * working is 1501 which was released on 2007-10-26. in ahci_sb600_enable_64bit()
1121 .ident = "ASUS M2A-VM", in ahci_sb600_enable_64bit()
1125 DMI_MATCH(DMI_BOARD_NAME, "M2A-VM"), in ahci_sb600_enable_64bit()
1130 * All BIOS versions for the MSI K9A2 Platinum (MS-7376) in ahci_sb600_enable_64bit()
1134 * fields as "MICRO-STAR INTERANTIONAL CO.,LTD". in ahci_sb600_enable_64bit()
1137 * "MICRO-STAR INTERNATIONAL CO.,LTD". in ahci_sb600_enable_64bit()
1138 * So try to match on DMI_BOARD_VENDOR of "MICRO-STAR INTER". in ahci_sb600_enable_64bit()
1141 * DMI field of "MS-7376". This was changed to be in ahci_sb600_enable_64bit()
1142 * "K9A2 Platinum (MS-7376)" in version 1.9, but we can still in ahci_sb600_enable_64bit()
1143 * match on DMI_BOARD_NAME of "MS-7376". in ahci_sb600_enable_64bit()
1149 "MICRO-STAR INTER"), in ahci_sb600_enable_64bit()
1150 DMI_MATCH(DMI_BOARD_NAME, "MS-7376"), in ahci_sb600_enable_64bit()
1154 * All BIOS versions for the MSI K9AGM2 (MS-7327) support in ahci_sb600_enable_64bit()
1159 * match on DMI_BOARD_VENDOR of "MICRO-STAR INTER" again. in ahci_sb600_enable_64bit()
1165 "MICRO-STAR INTER"), in ahci_sb600_enable_64bit()
1166 DMI_MATCH(DMI_BOARD_NAME, "MS-7327"), in ahci_sb600_enable_64bit()
1188 if (pdev->bus->number != 0 || pdev->devfn != PCI_DEVFN(0x12, 0) || in ahci_sb600_enable_64bit()
1192 if (!match->driver_data) in ahci_sb600_enable_64bit()
1198 if (strcmp(buf, match->driver_data) >= 0) in ahci_sb600_enable_64bit()
1201 dev_warn(&pdev->dev, in ahci_sb600_enable_64bit()
1203 match->ident); in ahci_sb600_enable_64bit()
1208 dev_warn(&pdev->dev, "%s: enabling 64bit DMA\n", match->ident); in ahci_sb600_enable_64bit()
1218 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), in ahci_broken_system_poweroff()
1227 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), in ahci_broken_system_poweroff()
1239 unsigned long slot = (unsigned long)dmi->driver_data; in ahci_broken_system_poweroff()
1240 /* apply the quirk only to on-board controllers */ in ahci_broken_system_poweroff()
1241 return slot == PCI_SLOT(pdev->devfn); in ahci_broken_system_poweroff()
1251 * On HP dv[4-6] and HDX18 with earlier BIOSen, link in ahci_broken_suspend()
1266 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), in ahci_broken_suspend()
1275 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), in ahci_broken_suspend()
1284 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), in ahci_broken_suspend()
1293 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), in ahci_broken_suspend()
1322 if (!dmi || pdev->bus->number || pdev->devfn != PCI_DEVFN(0x1f, 2)) in ahci_broken_suspend()
1328 return strcmp(buf, dmi->driver_data) < 0; in ahci_broken_suspend()
1381 return strcmp(buf, dmi->driver_data) < 0; in ahci_broken_lpm()
1403 .ident = "EP45-DQ6", in ahci_broken_online()
1407 DMI_MATCH(DMI_BOARD_NAME, "EP45-DQ6"), in ahci_broken_online()
1412 .ident = "EP45-DS5", in ahci_broken_online()
1416 DMI_MATCH(DMI_BOARD_NAME, "EP45-DS5"), in ahci_broken_online()
1429 val = (unsigned long)dmi->driver_data; in ahci_broken_online()
1431 return pdev->bus->number == (val >> 8) && pdev->devfn == (val & 0xff); in ahci_broken_online()
1453 * is FPDMA non-zero offset enable which when enabled in ahci_gtf_filter_workaround()
1474 filter = (unsigned long)dmi->driver_data; in ahci_gtf_filter_workaround()
1475 dev_info(host->dev, "applying extra ACPI _GTF filter 0x%x for %s\n", in ahci_gtf_filter_workaround()
1476 filter, dmi->ident); in ahci_gtf_filter_workaround()
1478 for (i = 0; i < host->n_ports; i++) { in ahci_gtf_filter_workaround()
1479 struct ata_port *ap = host->ports[i]; in ahci_gtf_filter_workaround()
1485 dev->gtf_filter |= filter; in ahci_gtf_filter_workaround()
1496 * again. When this happens, CAP.NP may hold a value of 0x00 or 0x01, and the
1499 * Overriding CAP.NP to 0x02 and the port_map to 0x7 will reveal all 3 ports
1512 DMI_MATCH(DMI_PRODUCT_NAME, "Switch SA5-271") in acer_sa5_271_workaround()
1519 dev_info(&pdev->dev, "enabling Acer Switch Alpha 12 workaround\n"); in acer_sa5_271_workaround()
1520 if ((hpriv->saved_cap & 0xC734FF00) == 0xC734FF00) { in acer_sa5_271_workaround()
1521 hpriv->port_map = 0x7; in acer_sa5_271_workaround()
1522 hpriv->cap = 0xC734FF02; in acer_sa5_271_workaround()
1542 hpriv = host->private_data; in ahci_thunderx_irq_handler()
1543 mmio = hpriv->mmio; in ahci_thunderx_irq_handler()
1549 irq_masked = irq_stat & hpriv->port_map; in ahci_thunderx_irq_handler()
1550 spin_lock(&host->lock); in ahci_thunderx_irq_handler()
1556 spin_unlock(&host->lock); in ahci_thunderx_irq_handler()
1567 u32 cap; in ahci_remap_check() local
1572 if (pdev->vendor != PCI_VENDOR_ID_INTEL || in ahci_remap_check()
1575 !(readl(hpriv->mmio + AHCI_VSCAP) & 1)) in ahci_remap_check()
1578 cap = readq(hpriv->mmio + AHCI_REMAP_CAP); in ahci_remap_check()
1580 if ((cap & (1 << i)) == 0) in ahci_remap_check()
1582 if (readl(hpriv->mmio + ahci_remap_dcc(i)) in ahci_remap_check()
1587 hpriv->remapped_nvme++; in ahci_remap_check()
1590 if (!hpriv->remapped_nvme) in ahci_remap_check()
1593 dev_warn(&pdev->dev, "Found %u remapped NVMe devices.\n", in ahci_remap_check()
1594 hpriv->remapped_nvme); in ahci_remap_check()
1595 dev_warn(&pdev->dev, in ahci_remap_check()
1599 * Don't rely on the msi-x capability in the remap case, in ahci_remap_check()
1602 hpriv->flags |= AHCI_HFLAG_NO_MSI; in ahci_remap_check()
1607 return pci_irq_vector(to_pci_dev(host->dev), port); in ahci_get_irq_vector()
1615 if (hpriv->flags & AHCI_HFLAG_NO_MSI) in ahci_init_msi()
1616 return -ENODEV; in ahci_init_msi()
1627 if (!(readl(hpriv->mmio + HOST_CTL) & HOST_MRSM)) { in ahci_init_msi()
1628 hpriv->get_irq_vector = ahci_get_irq_vector; in ahci_init_msi()
1629 hpriv->flags |= AHCI_HFLAG_MULTI_MSI; in ahci_init_msi()
1644 * If the host is not capable of supporting per-port vectors, fall in ahci_init_msi()
1645 * back to single MSI before finally attempting single MSI-X. in ahci_init_msi()
1660 if (!(hpriv->flags & AHCI_HFLAG_USE_LPM_POLICY)) in ahci_update_initial_lpm_policy()
1664 if (mobile_lpm_policy != -1) { in ahci_update_initial_lpm_policy()
1670 if (hpriv->cap & HOST_CAP_PART) in ahci_update_initial_lpm_policy()
1672 else if (hpriv->cap & HOST_CAP_SSC) in ahci_update_initial_lpm_policy()
1678 ap->target_lpm_policy = policy; in ahci_update_initial_lpm_policy()
1687 * Only apply the 6-port PCS quirk for known legacy platforms. in ahci_intel_pcs_quirk()
1689 if (!id || id->vendor != PCI_VENDOR_ID_INTEL) in ahci_intel_pcs_quirk()
1693 if (((enum board_ids) id->driver_data) >= board_ahci_pcs7) in ahci_intel_pcs_quirk()
1698 * implemented as write or write-once register. If the register in ahci_intel_pcs_quirk()
1705 if ((tmp16 & hpriv->port_map) != hpriv->port_map) { in ahci_intel_pcs_quirk()
1706 tmp16 |= hpriv->port_map; in ahci_intel_pcs_quirk()
1716 struct ahci_host_priv *hpriv = host->private_data; in remapped_nvme_show()
1718 return sysfs_emit(buf, "%u\n", hpriv->remapped_nvme); in remapped_nvme_show()
1725 unsigned int board_id = ent->driver_data; in ahci_init_one()
1728 struct device *dev = &pdev->dev; in ahci_init_one()
1736 ata_print_version_once(&pdev->dev, DRV_VERSION); in ahci_init_one()
1741 if (pdev->vendor == PCI_VENDOR_ID_MARVELL && !marvell_enable) in ahci_init_one()
1742 return -ENODEV; in ahci_init_one()
1752 if (pdev->vendor == PCI_VENDOR_ID_PROMISE) in ahci_init_one()
1753 dev_info(&pdev->dev, in ahci_init_one()
1756 /* Some devices use non-standard BARs */ in ahci_init_one()
1757 if (pdev->vendor == PCI_VENDOR_ID_STMICRO && pdev->device == 0xCC06) in ahci_init_one()
1759 else if (pdev->vendor == 0x1c44 && pdev->device == 0x8000) in ahci_init_one()
1761 else if (pdev->vendor == PCI_VENDOR_ID_CAVIUM) { in ahci_init_one()
1762 if (pdev->device == 0xa01c) in ahci_init_one()
1764 if (pdev->device == 0xa084) in ahci_init_one()
1766 } else if (pdev->vendor == PCI_VENDOR_ID_LOONGSON) { in ahci_init_one()
1767 if (pdev->device == 0x7a08) in ahci_init_one()
1776 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in ahci_init_one()
1777 (pdev->device == 0x2652 || pdev->device == 0x2653)) { in ahci_init_one()
1786 dev_info(&pdev->dev, in ahci_init_one()
1788 return -ENODEV; in ahci_init_one()
1796 if (rc == -EBUSY) in ahci_init_one()
1803 return -ENOMEM; in ahci_init_one()
1804 hpriv->flags |= (unsigned long)pi.private_data; in ahci_init_one()
1808 (pdev->revision == 0xa1 || pdev->revision == 0xa2)) in ahci_init_one()
1809 hpriv->flags |= AHCI_HFLAG_NO_MSI; in ahci_init_one()
1812 if (board_id == board_ahci_sb700 && pdev->revision >= 0x40) in ahci_init_one()
1813 hpriv->flags &= ~AHCI_HFLAG_IGN_SERR_INTERNAL; in ahci_init_one()
1817 hpriv->flags &= ~AHCI_HFLAG_32BIT_ONLY; in ahci_init_one()
1819 hpriv->mmio = pcim_iomap_table(pdev)[ahci_pci_bar]; in ahci_init_one()
1824 sysfs_add_file_to_group(&pdev->dev.kobj, in ahci_init_one()
1830 hpriv->flags |= AHCI_HFLAG_NO_DEVSLP; in ahci_init_one()
1833 if (pdev->vendor == PCI_VENDOR_ID_HUAWEI && in ahci_init_one()
1834 pdev->device == 0xa235 && in ahci_init_one()
1835 pdev->revision < 0x30) in ahci_init_one()
1836 hpriv->flags |= AHCI_HFLAG_NO_SXS; in ahci_init_one()
1838 if (pdev->vendor == 0x177d && pdev->device == 0xa01c) in ahci_init_one()
1839 hpriv->irq_handler = ahci_thunderx_irq_handler; in ahci_init_one()
1846 if (hpriv->cap & HOST_CAP_NCQ) { in ahci_init_one()
1849 * Auto-activate optimization is supposed to be in ahci_init_one()
1854 if (!(hpriv->flags & AHCI_HFLAG_NO_FPDMA_AA)) in ahci_init_one()
1858 * All AHCI controllers should be forward-compatible in ahci_init_one()
1866 if (hpriv->cap & HOST_CAP_PMP) in ahci_init_one()
1873 dev_info(&pdev->dev, in ahci_init_one()
1879 dev_warn(&pdev->dev, in ahci_init_one()
1884 hpriv->flags |= AHCI_HFLAG_NO_SUSPEND; in ahci_init_one()
1885 dev_warn(&pdev->dev, in ahci_init_one()
1890 hpriv->flags |= AHCI_HFLAG_SRST_TOUT_IS_OFFLINE; in ahci_init_one()
1891 dev_info(&pdev->dev, in ahci_init_one()
1896 /* Acer SA5-271 workaround modifies private_data */ in ahci_init_one()
1899 /* CAP.NP sometimes indicate the index of the last enabled in ahci_init_one()
1902 * both CAP.NP and port_map. in ahci_init_one()
1904 n_ports = max(ahci_nr_ports(hpriv->cap), fls(hpriv->port_map)); in ahci_init_one()
1906 host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports); in ahci_init_one()
1908 return -ENOMEM; in ahci_init_one()
1909 host->private_data = hpriv; in ahci_init_one()
1915 hpriv->irq = pci_irq_vector(pdev, 0); in ahci_init_one()
1917 if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss) in ahci_init_one()
1918 host->flags |= ATA_HOST_PARALLEL_SCAN; in ahci_init_one()
1920 dev_info(&pdev->dev, "SSS flag set, parallel bus scan disabled\n"); in ahci_init_one()
1922 if (!(hpriv->cap & HOST_CAP_PART)) in ahci_init_one()
1923 host->flags |= ATA_HOST_NO_PART; in ahci_init_one()
1925 if (!(hpriv->cap & HOST_CAP_SSC)) in ahci_init_one()
1926 host->flags |= ATA_HOST_NO_SSC; in ahci_init_one()
1928 if (!(hpriv->cap2 & HOST_CAP2_SDS)) in ahci_init_one()
1929 host->flags |= ATA_HOST_NO_DEVSLP; in ahci_init_one()
1934 for (i = 0; i < host->n_ports; i++) { in ahci_init_one()
1935 struct ata_port *ap = host->ports[i]; in ahci_init_one()
1937 ata_port_pbar_desc(ap, ahci_pci_bar, -1, "abar"); in ahci_init_one()
1939 0x100 + ap->port_no * 0x80, "port"); in ahci_init_one()
1942 if (ap->flags & ATA_FLAG_EM) in ahci_init_one()
1943 ap->em_message_type = hpriv->em_msg_type; in ahci_init_one()
1947 /* disabled/not-implemented port */ in ahci_init_one()
1948 if (!(hpriv->port_map & (1 << i))) in ahci_init_one()
1949 ap->ops = &ata_dummy_port_ops; in ahci_init_one()
1976 pm_runtime_put_noidle(&pdev->dev); in ahci_init_one()
1987 sysfs_remove_file_from_group(&pdev->dev.kobj, in ahci_remove_one()
1990 pm_runtime_get_noresume(&pdev->dev); in ahci_remove_one()
1997 MODULE_DESCRIPTION("AHCI SATA low-level driver");