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

ata: Disable AHCI ALPM feature for Ampere Computing eMAG SATA

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 Trpathi <stripathi@amperecomputing.com>
Signed-off-by: Rameshwar Prasad Sahu <rameshwar.sahu@amperecomputing.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Suman Tripathi and committed by
Jens Axboe
20bdc376 caf8975b

+14 -1
+14 -1
drivers/ata/ahci_platform.c
··· 33 33 .port_ops = &ahci_platform_ops, 34 34 }; 35 35 36 + static const struct ata_port_info ahci_port_info_nolpm = { 37 + .flags = AHCI_FLAG_COMMON | ATA_FLAG_NO_LPM, 38 + .pio_mask = ATA_PIO4, 39 + .udma_mask = ATA_UDMA6, 40 + .port_ops = &ahci_platform_ops, 41 + }; 42 + 36 43 static struct scsi_host_template ahci_platform_sht = { 37 44 AHCI_SHT(DRV_NAME), 38 45 }; ··· 48 41 { 49 42 struct device *dev = &pdev->dev; 50 43 struct ahci_host_priv *hpriv; 44 + const struct ata_port_info *port; 51 45 int rc; 52 46 53 47 hpriv = ahci_platform_get_resources(pdev, ··· 66 58 if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci")) 67 59 hpriv->flags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ; 68 60 69 - rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info, 61 + port = acpi_device_get_match_data(dev); 62 + if (!port) 63 + port = &ahci_port_info; 64 + 65 + rc = ahci_platform_init_host(pdev, hpriv, port, 70 66 &ahci_platform_sht); 71 67 if (rc) 72 68 goto disable_resources; ··· 97 85 MODULE_DEVICE_TABLE(of, ahci_of_match); 98 86 99 87 static const struct acpi_device_id ahci_acpi_match[] = { 88 + { "APMC0D33", (unsigned long)&ahci_port_info_nolpm }, 100 89 { ACPI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff) }, 101 90 {}, 102 91 };