Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'libata-5.7-2020-04-09' of git://git.kernel.dk/linux-block

Pull libata fixes from Jens Axboe:
"A few followup changes/fixes for libata:

- PMP removal fix (Kai-Heng)

- Add remapped NVMe device attribute to sysfs (Kai-Heng)

- Remove redundant assignment (Colin)

- Add yet another Comet Lake ID (Jian-Hong)"

* tag 'libata-5.7-2020-04-09' of git://git.kernel.dk/linux-block:
ahci: Add Intel Comet Lake PCH RAID PCI ID
ata: ahci: Add sysfs attribute to show remapped NVMe device count
ata: ahci-imx: remove redundant assignment to ret
libata: Return correct status in sata_pmp_eh_recover_pm() when ATA_DFLAG_DETACH is set

+28 -5
+25 -4
drivers/ata/ahci.c
··· 410 410 { PCI_VDEVICE(INTEL, 0x22a3), board_ahci_mobile }, /* Cherry Tr. AHCI */ 411 411 { PCI_VDEVICE(INTEL, 0x5ae3), board_ahci_mobile }, /* ApolloLake AHCI */ 412 412 { PCI_VDEVICE(INTEL, 0x34d3), board_ahci_mobile }, /* Ice Lake LP AHCI */ 413 + { PCI_VDEVICE(INTEL, 0x02d7), board_ahci_mobile }, /* Comet Lake PCH RAID */ 413 414 414 415 /* JMicron 360/1/3/5/6, match class to avoid IDE function */ 415 416 { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, ··· 1496 1495 static void ahci_remap_check(struct pci_dev *pdev, int bar, 1497 1496 struct ahci_host_priv *hpriv) 1498 1497 { 1499 - int i, count = 0; 1498 + int i; 1500 1499 u32 cap; 1501 1500 1502 1501 /* ··· 1517 1516 continue; 1518 1517 1519 1518 /* We've found a remapped device */ 1520 - count++; 1519 + hpriv->remapped_nvme++; 1521 1520 } 1522 1521 1523 - if (!count) 1522 + if (!hpriv->remapped_nvme) 1524 1523 return; 1525 1524 1526 - dev_warn(&pdev->dev, "Found %d remapped NVMe devices.\n", count); 1525 + dev_warn(&pdev->dev, "Found %u remapped NVMe devices.\n", 1526 + hpriv->remapped_nvme); 1527 1527 dev_warn(&pdev->dev, 1528 1528 "Switch your BIOS from RAID to AHCI mode to use them.\n"); 1529 1529 ··· 1644 1642 } 1645 1643 } 1646 1644 1645 + static ssize_t remapped_nvme_show(struct device *dev, 1646 + struct device_attribute *attr, 1647 + char *buf) 1648 + { 1649 + struct ata_host *host = dev_get_drvdata(dev); 1650 + struct ahci_host_priv *hpriv = host->private_data; 1651 + 1652 + return sprintf(buf, "%u\n", hpriv->remapped_nvme); 1653 + } 1654 + 1655 + static DEVICE_ATTR_RO(remapped_nvme); 1656 + 1647 1657 static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 1648 1658 { 1649 1659 unsigned int board_id = ent->driver_data; ··· 1758 1744 1759 1745 /* detect remapped nvme devices */ 1760 1746 ahci_remap_check(pdev, ahci_pci_bar, hpriv); 1747 + 1748 + sysfs_add_file_to_group(&pdev->dev.kobj, 1749 + &dev_attr_remapped_nvme.attr, 1750 + NULL); 1761 1751 1762 1752 /* must set flag prior to save config in order to take effect */ 1763 1753 if (ahci_broken_devslp(pdev)) ··· 1914 1896 1915 1897 static void ahci_remove_one(struct pci_dev *pdev) 1916 1898 { 1899 + sysfs_remove_file_from_group(&pdev->dev.kobj, 1900 + &dev_attr_remapped_nvme.attr, 1901 + NULL); 1917 1902 pm_runtime_get_noresume(&pdev->dev); 1918 1903 ata_pci_remove_one(pdev); 1919 1904 }
+1
drivers/ata/ahci.h
··· 336 336 u32 em_loc; /* enclosure management location */ 337 337 u32 em_buf_sz; /* EM buffer size in byte */ 338 338 u32 em_msg_type; /* EM message type */ 339 + u32 remapped_nvme; /* NVMe remapped device count */ 339 340 bool got_runtime_pm; /* Did we do pm_runtime_get? */ 340 341 struct clk *clks[AHCI_MAX_CLKS]; /* Optional */ 341 342 struct reset_control *rsts; /* Optional */
+1 -1
drivers/ata/ahci_imx.c
··· 782 782 struct ata_host *host = dev_get_drvdata(ap->dev); 783 783 struct ahci_host_priv *hpriv = host->private_data; 784 784 struct imx_ahci_priv *imxpriv = hpriv->plat_data; 785 - int ret = -EIO; 785 + int ret; 786 786 787 787 if (imxpriv->type == AHCI_IMX53) 788 788 ret = ahci_pmp_retry_srst_ops.softreset(link, class, deadline);
+1
drivers/ata/libata-pmp.c
··· 763 763 764 764 if (dev->flags & ATA_DFLAG_DETACH) { 765 765 detach = 1; 766 + rc = -ENODEV; 766 767 goto fail; 767 768 } 768 769