Thread (3 messages) flat view 3 messages, 2 authors, 2018-08-27
STALE2950d

[PATCH] ata: Disable AHCI ALPM feature for Ampere Computing eMAG SATA

From: Suman Tripathi <hidden>
Date: 2018-08-27 18:48:14
Also in: linux-arm-kernel, lkml
Subsystem: libata sata ahci platform devices support, libata subsystem (serial and parallel ata drivers), the rest · Maintainers: Hans de Goede, Damien Le Moal, Niklas Cassel, Linus Torvalds

Due to hardware errata, Ampere Computing eMAG SATA can't support
AHCI ALPM feature. This patch disables the AHCI ALPM feature for
eMAG SATA.

Signed-off-by: Suman Tripathi <redacted>
Signed-off-by: Rameshwar Prasad Sahu <redacted>
---
 drivers/ata/ahci_platform.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index 99f9a89..0d0233e 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -26,7 +26,7 @@

 #define DRV_NAME "ahci"

-static const struct ata_port_info ahci_port_info = {
+static struct ata_port_info ahci_port_info = {
 	.flags		= AHCI_FLAG_COMMON,
 	.pio_mask	= ATA_PIO4,
 	.udma_mask	= ATA_UDMA6,
@@ -41,6 +41,8 @@ static int ahci_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct ahci_host_priv *hpriv;
+	struct acpi_device_info *info;
+	acpi_status status;
 	int rc;

 	hpriv = ahci_platform_get_resources(pdev);
@@ -57,6 +59,15 @@ static int ahci_probe(struct platform_device *pdev)
 	if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci"))
 		hpriv->flags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ;

+	status = acpi_get_object_info(ACPI_HANDLE(dev), &info);
+	if (ACPI_SUCCESS(status)) {
+		if (info->valid & ACPI_VALID_HID) {
+			if (!strcmp("APMC0D33", info->hardware_id.string))
+				ahci_port_info.flags |= ATA_FLAG_NO_LPM;
+		}
+		ACPI_FREE(info);
+	}
+
 	rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info,
 				     &ahci_platform_sht);
 	if (rc)
--
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help