From 8e85f60575d30209779d1b5d41909ef2a41a9d57 Mon Sep 17 00:00:00 2001 From: Mika Westerberg Date: Fri, 2 Oct 2020 12:40:35 +0300 Subject: [PATCH 1/6] ahci: Add Intel Rocket Lake PCH-H RAID PCI IDs Add Intel Rocket Lake PCH-H RAID PCI IDs to the list of supported controllers. Signed-off-by: Mika Westerberg Signed-off-by: Jens Axboe --- drivers/ata/ahci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index fbd8eaa32d325..00ba8e5a1ccc0 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -360,6 +360,10 @@ static const struct pci_device_id ahci_pci_tbl[] = { { PCI_VDEVICE(INTEL, 0x1f3f), board_ahci_avn }, /* Avoton RAID */ { PCI_VDEVICE(INTEL, 0x2823), board_ahci }, /* Wellsburg RAID */ { PCI_VDEVICE(INTEL, 0x2827), board_ahci }, /* Wellsburg RAID */ + { PCI_VDEVICE(INTEL, 0x43d4), board_ahci }, /* Rocket Lake PCH-H RAID */ + { PCI_VDEVICE(INTEL, 0x43d5), board_ahci }, /* Rocket Lake PCH-H RAID */ + { PCI_VDEVICE(INTEL, 0x43d6), board_ahci }, /* Rocket Lake PCH-H RAID */ + { PCI_VDEVICE(INTEL, 0x43d7), board_ahci }, /* Rocket Lake PCH-H RAID */ { PCI_VDEVICE(INTEL, 0x8d02), board_ahci }, /* Wellsburg AHCI */ { PCI_VDEVICE(INTEL, 0x8d04), board_ahci }, /* Wellsburg RAID */ { PCI_VDEVICE(INTEL, 0x8d06), board_ahci }, /* Wellsburg RAID */ From 6cd32a44f080347e193dea56cd986282361b7007 Mon Sep 17 00:00:00 2001 From: Liu Shixin Date: Mon, 21 Sep 2020 16:24:51 +0800 Subject: [PATCH 2/6] sata, highbank: simplify the return expression of ahci_highbank_suspend Simplify the return expression. Signed-off-by: Liu Shixin Signed-off-by: Jens Axboe --- drivers/ata/sata_highbank.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c index ad3893c62572d..64b2ef15ec191 100644 --- a/drivers/ata/sata_highbank.c +++ b/drivers/ata/sata_highbank.c @@ -571,7 +571,6 @@ static int ahci_highbank_suspend(struct device *dev) struct ahci_host_priv *hpriv = host->private_data; void __iomem *mmio = hpriv->mmio; u32 ctl; - int rc; if (hpriv->flags & AHCI_HFLAG_NO_SUSPEND) { dev_err(dev, "firmware update required for suspend/resume\n"); @@ -588,11 +587,7 @@ static int ahci_highbank_suspend(struct device *dev) writel(ctl, mmio + HOST_CTL); readl(mmio + HOST_CTL); /* flush */ - rc = ata_host_suspend(host, PMSG_SUSPEND); - if (rc) - return rc; - - return 0; + return ata_host_suspend(host, PMSG_SUSPEND); } static int ahci_highbank_resume(struct device *dev) From 564a7eed3f349f3cff412759c8bf7f8e77edb3c9 Mon Sep 17 00:00:00 2001 From: Yuantian Tang Date: Mon, 17 Aug 2020 16:22:04 +0800 Subject: [PATCH 3/6] ahci: qoriq: enable acpi support in qoriq ahci driver This patch enables ACPI support in qoriq ahci driver. Signed-off-by: Udit Kumar Signed-off-by: Yuantian Tang Signed-off-by: Jens Axboe --- drivers/ata/ahci_qoriq.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c index a330307d32015..5b46fc9aeb4a0 100644 --- a/drivers/ata/ahci_qoriq.c +++ b/drivers/ata/ahci_qoriq.c @@ -6,6 +6,7 @@ * Tang Yuantian */ +#include #include #include #include @@ -80,6 +81,12 @@ static const struct of_device_id ahci_qoriq_of_match[] = { }; MODULE_DEVICE_TABLE(of, ahci_qoriq_of_match); +static const struct acpi_device_id ahci_qoriq_acpi_match[] = { + {"NXP0004", .driver_data = (kernel_ulong_t)AHCI_LX2160A}, + { } +}; +MODULE_DEVICE_TABLE(acpi, ahci_qoriq_acpi_match); + static int ahci_qoriq_hardreset(struct ata_link *link, unsigned int *class, unsigned long deadline) { @@ -255,6 +262,7 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv) static int ahci_qoriq_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; + const struct acpi_device_id *acpi_id; struct device *dev = &pdev->dev; struct ahci_host_priv *hpriv; struct ahci_qoriq_priv *qoriq_priv; @@ -267,14 +275,18 @@ static int ahci_qoriq_probe(struct platform_device *pdev) return PTR_ERR(hpriv); of_id = of_match_node(ahci_qoriq_of_match, np); - if (!of_id) + acpi_id = acpi_match_device(ahci_qoriq_acpi_match, &pdev->dev); + if (!(of_id || acpi_id)) return -ENODEV; qoriq_priv = devm_kzalloc(dev, sizeof(*qoriq_priv), GFP_KERNEL); if (!qoriq_priv) return -ENOMEM; - qoriq_priv->type = (enum ahci_qoriq_type)of_id->data; + if (of_id) + qoriq_priv->type = (enum ahci_qoriq_type)of_id->data; + else + qoriq_priv->type = (enum ahci_qoriq_type)acpi_id->driver_data; if (unlikely(!ecc_initialized)) { res = platform_get_resource_byname(pdev, @@ -288,7 +300,8 @@ static int ahci_qoriq_probe(struct platform_device *pdev) } } - qoriq_priv->is_dmacoherent = of_dma_is_coherent(np); + if (device_get_dma_attr(&pdev->dev) == DEV_DMA_COHERENT) + qoriq_priv->is_dmacoherent = true; rc = ahci_platform_enable_resources(hpriv); if (rc) @@ -354,6 +367,7 @@ static struct platform_driver ahci_qoriq_driver = { .driver = { .name = DRV_NAME, .of_match_table = ahci_qoriq_of_match, + .acpi_match_table = ahci_qoriq_acpi_match, .pm = &ahci_qoriq_pm_ops, }, }; From 5029a0486eb4a9521e4da0db2a3824d5b63834bc Mon Sep 17 00:00:00 2001 From: "Gustavo A. R. Silva" Date: Fri, 2 Oct 2020 17:48:52 -0500 Subject: [PATCH 4/6] pata_cmd64x: Use fallthrough pseudo-keyword Replace /* FALL THRU */ comment with the new pseudo-keyword macro fallthrough[1]. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jens Axboe --- drivers/ata/pata_cmd64x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c index 3134eaec9e3dc..1d74d89b5bed8 100644 --- a/drivers/ata/pata_cmd64x.c +++ b/drivers/ata/pata_cmd64x.c @@ -461,7 +461,7 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) case 1: ppi[0] = &cmd_info[4]; ppi[1] = &cmd_info[4]; - /* FALL THRU */ + fallthrough; /* Early revs have no CNTRL_CH0 */ case 2: case 0: From fd86194aca1f64df1c5fe2ed9e4c2a84f625ff48 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 24 Sep 2020 13:22:51 +0200 Subject: [PATCH 5/6] MAINTAINERS: remove LIBATA PATA DRIVERS entry Even though there is not much happening for libata PATA drivers I don't have time to look after them anymore. Since Jens is maintaining the whole libata anyway just remove "LIBATA PATA DRIVERS" entry. Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Jens Axboe --- MAINTAINERS | 9 --------- 1 file changed, 9 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 190c7fa2ea010..98331519a2833 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9867,15 +9867,6 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git F: drivers/ata/pata_arasan_cf.c F: include/linux/pata_arasan_cf_data.h -LIBATA PATA DRIVERS -M: Bartlomiej Zolnierkiewicz -M: Jens Axboe -L: linux-ide@vger.kernel.org -S: Maintained -T: git git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git -F: drivers/ata/ata_generic.c -F: drivers/ata/pata_*.c - LIBATA PATA FARADAY FTIDE010 AND GEMINI SATA BRIDGE DRIVERS M: Linus Walleij L: linux-ide@vger.kernel.org From 45aefe3d2251e4e229d7662052739f96ad1d08d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Fri, 9 Oct 2020 10:42:44 +0200 Subject: [PATCH 6/6] ata: ahci: mvebu: Make SATA PHY optional for Armada 3720 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Older ATF does not provide SMC call for SATA phy power on functionality and therefore initialization of ahci_mvebu is failing when older version of ATF is using. In this case phy_power_on() function returns -EOPNOTSUPP. This patch adds a new hflag AHCI_HFLAG_IGN_NOTSUPP_POWER_ON which cause that ahci_platform_enable_phys() would ignore -EOPNOTSUPP errors from phy_power_on() call. It fixes initialization of ahci_mvebu on Espressobin boards where is older Marvell's Arm Trusted Firmware without SMC call for SATA phy power. This is regression introduced in commit 8e18c8e58da64 ("arm64: dts: marvell: armada-3720-espressobin: declare SATA PHY property") where SATA phy was defined and therefore ahci_platform_enable_phys() on Espressobin started failing. Fixes: 8e18c8e58da64 ("arm64: dts: marvell: armada-3720-espressobin: declare SATA PHY property") Signed-off-by: Pali Rohár Tested-by: Tomasz Maciej Nowak Cc: # 5.1+: ea17a0f153af: phy: marvell: comphy: Convert internal SMCC firmware return codes to errno Signed-off-by: Jens Axboe --- drivers/ata/ahci.h | 2 ++ drivers/ata/ahci_mvebu.c | 2 +- drivers/ata/libahci_platform.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index d991dd46e89cc..98b8baa47dc5e 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h @@ -240,6 +240,8 @@ enum { as default lpm_policy */ AHCI_HFLAG_SUSPEND_PHYS = (1 << 26), /* handle PHYs during suspend/resume */ + AHCI_HFLAG_IGN_NOTSUPP_POWER_ON = (1 << 27), /* ignore -EOPNOTSUPP + from phy_power_on() */ /* ap->flags bits */ diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c index d4bba3ace45d7..3ad46d26d9d51 100644 --- a/drivers/ata/ahci_mvebu.c +++ b/drivers/ata/ahci_mvebu.c @@ -227,7 +227,7 @@ static const struct ahci_mvebu_plat_data ahci_mvebu_armada_380_plat_data = { static const struct ahci_mvebu_plat_data ahci_mvebu_armada_3700_plat_data = { .plat_config = ahci_mvebu_armada_3700_config, - .flags = AHCI_HFLAG_SUSPEND_PHYS, + .flags = AHCI_HFLAG_SUSPEND_PHYS | AHCI_HFLAG_IGN_NOTSUPP_POWER_ON, }; static const struct of_device_id ahci_mvebu_of_match[] = { diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c index 86261deeb4c58..de638dafce21e 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c @@ -59,7 +59,7 @@ int ahci_platform_enable_phys(struct ahci_host_priv *hpriv) } rc = phy_power_on(hpriv->phys[i]); - if (rc) { + if (rc && !(rc == -EOPNOTSUPP && (hpriv->flags & AHCI_HFLAG_IGN_NOTSUPP_POWER_ON))) { phy_exit(hpriv->phys[i]); goto disable_phys; }