Skip to contentSkip to conversation

ata: Disable AHCI ALPM feature for Ampere Computing eMAG SATA

PATCH In review Suman Tripathi 3 participants 6 messages Sep 6, 2018 – Sep 7, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 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.

---
Changes for v3:

* Fix the indentation and whitespace warnings.

Changes for v2:

* Introduce the new ata_port_info object which includes ATA_FLAG_NO_LPM.
* Include this object for eMAG SATA inside the acpi match table.
* Retrieve the ata_port_info from the acpi match table.

---
 drivers/ata/ahci_platform.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/ata/ahci_platform.c +14 -1
index 99f9a89..9ba283f 100644
@@ -33,6 +33,13 @@ static const struct ata_port_info ahci_port_info = {
        .port_ops       = &ahci_platform_ops,
 };
 
+static const struct ata_port_info ahci_port_info_nolpm = {
+       .flags          = AHCI_FLAG_COMMON | ATA_FLAG_NO_LPM,
+       .pio_mask       = ATA_PIO4,
+       .udma_mask      = ATA_UDMA6,
+       .port_ops       = &ahci_platform_ops,
+};
+
 static struct scsi_host_template ahci_platform_sht = {
        AHCI_SHT(DRV_NAME),
 };
@@ -41,6 +48,7 @@ static int ahci_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct ahci_host_priv *hpriv;
+       const struct ata_port_info *port;
        int rc;
 
        hpriv = ahci_platform_get_resources(pdev);
@@ -57,7 +65,11 @@ 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;
 
-       rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info,
+       port = acpi_device_get_match_data(dev);
+       if (!port)
+               port = &ahci_port_info;
+
+       rc = ahci_platform_init_host(pdev, hpriv, port,
                                     &ahci_platform_sht);
        if (rc)
                goto disable_resources;
@@ -85,6 +97,7 @@ static const struct of_device_id ahci_of_match[] = {
 MODULE_DEVICE_TABLE(of, ahci_of_match);
 
 static const struct acpi_device_id ahci_acpi_match[] = {
+       { "APMC0D33", (unsigned long)&ahci_port_info_nolpm },
        { ACPI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff) },
        {},
 };

--
2.7.4

CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and contains information that is confidential and proprietary to Ampere Computing or its subsidiaries. It is to be used solely for the purpose of furthering the parties' business relationship. Any review, copying, or distribution of this email (or any attachments thereto) is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently delete the original and any copies of this email and any attachments thereto.

#1 lore raw

Hi,

Quoted 6 lines · Suman Tripathi

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

Sorry, but the patch is still coming through mangled. Did you use git send-email ?

Regards,

Hans

Quoted 66 lines

---
Changes for v3:

* Fix the indentation and whitespace warnings.

Changes for v2:

* Introduce the new ata_port_info object which includes ATA_FLAG_NO_LPM.
* Include this object for eMAG SATA inside the acpi match table.
* Retrieve the ata_port_info from the acpi match table.

---
  drivers/ata/ahci_platform.c | 15 ++++++++++++++-
  1 file changed, 14 insertions(+), 1 deletion(-)
drivers/ata/ahci_platform.c +14 -2
index 99f9a89..9ba283f 100644
@@ -33,6 +33,13 @@ static const struct ata_port_info ahci_port_info = {
  	.port_ops	= &ahci_platform_ops,
  };
 
+static const struct ata_port_info ahci_port_info_nolpm = {
+	.flags		= AHCI_FLAG_COMMON | ATA_FLAG_NO_LPM,
+	.pio_mask	= ATA_PIO4,
+	.udma_mask	= ATA_UDMA6,
+	.port_ops	= &ahci_platform_ops,
+};
+
  static struct scsi_host_template ahci_platform_sht = {
  	AHCI_SHT(DRV_NAME),
  };
@@ -41,6 +48,7 @@ static int ahci_probe(struct platform_device *pdev)
  {
  	struct device *dev = &pdev->dev;
  	struct ahci_host_priv *hpriv;
+	const struct ata_port_info *port;
  	int rc;
 
  	hpriv = ahci_platform_get_resources(pdev);
@@ -57,7 +65,11 @@ 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;
 
-	rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info,
+	port = acpi_device_get_match_data(dev);
+	if (!port)
+		port = &ahci_port_info;
+
+	rc = ahci_platform_init_host(pdev, hpriv, port,
  				     &ahci_platform_sht);
  	if (rc)
  		goto disable_resources;
@@ -85,6 +97,7 @@ static const struct of_device_id ahci_of_match[] = {
  MODULE_DEVICE_TABLE(of, ahci_of_match);
 
  static const struct acpi_device_id ahci_acpi_match[] = {
+	{ "APMC0D33", (unsigned long)&ahci_port_info_nolpm },
  	{ ACPI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff) },
  	{},
  };
--

2.7.4

#2 lore raw

Hi Hans,

With regards,
Suman

-----Original Message-----
From: Hans de Goede <[email protected]>
Sent: Thursday, September 6, 2018 1:06 PM
To: Suman Tripathi <[email protected]>; axboe at kernel.dk; tj at kernel.org; linux-ide at vger.kernel.org; linux-arm-kernel at lists.infradead.org; linux-kernel at vger.kernel.org; joe at perches.com; arnd at arndb.de; gregkh at linuxfoundation.org
Cc: Open Source Submission <[email protected]>; Rameshwar Sahu <[email protected]>
Subject: Re: [PATCH v3] ata: Disable AHCI ALPM feature for Ampere Computing eMAG SATA

[NOTICE: This email originated from an external sender. Please be mindful of safe email handling and proprietary information protection practices.] ________________________________________________________________________________________________________________________

Hi,

Quoted 6 lines · Suman Tripathi

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 Rameshwar Prasad Sahu

<[email protected]>

Sorry, but the patch is still coming through mangled. Did you use git send-email ?
[Suman Tripathi] yes. I rechecked before sending twice. Sorry for the inconvenience. Will figure the issue out

Regards,

Hans

Quoted 66 lines

---
Changes for v3:

* Fix the indentation and whitespace warnings.

Changes for v2:

* Introduce the new ata_port_info object which includes ATA_FLAG_NO_LPM.
* Include this object for eMAG SATA inside the acpi match table.
* Retrieve the ata_port_info from the acpi match table.

---
  drivers/ata/ahci_platform.c | 15 ++++++++++++++-
  1 file changed, 14 insertions(+), 1 deletion(-)
drivers/ata/ahci_platform.c +14 -2
index 99f9a89..9ba283f 100644
@@ -33,6 +33,13 @@ static const struct ata_port_info ahci_port_info = {
      .port_ops       = &ahci_platform_ops,
  };
 
+static const struct ata_port_info ahci_port_info_nolpm = {
+     .flags          = AHCI_FLAG_COMMON | ATA_FLAG_NO_LPM,
+     .pio_mask       = ATA_PIO4,
+     .udma_mask      = ATA_UDMA6,
+     .port_ops       = &ahci_platform_ops,
+};
+
  static struct scsi_host_template ahci_platform_sht = {
      AHCI_SHT(DRV_NAME),
  };
@@ -41,6 +48,7 @@ static int ahci_probe(struct platform_device *pdev)
  {
      struct device *dev = &pdev->dev;
      struct ahci_host_priv *hpriv;
+     const struct ata_port_info *port;
      int rc;
 
      hpriv = ahci_platform_get_resources(pdev);
@@ -57,7 +65,11 @@ 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;
 
-     rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info,
+     port = acpi_device_get_match_data(dev);
+     if (!port)
+             port = &ahci_port_info;
+
+     rc = ahci_platform_init_host(pdev, hpriv, port,
                                   &ahci_platform_sht);
      if (rc)
              goto disable_resources;
@@ -85,6 +97,7 @@ static const struct of_device_id ahci_of_match[] = {
  MODULE_DEVICE_TABLE(of, ahci_of_match);
 
  static const struct acpi_device_id ahci_acpi_match[] = {
+     { "APMC0D33", (unsigned long)&ahci_port_info_nolpm },
      { ACPI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff) },
      {},
  };
--

2.7.4

#3 lore raw
Quoted 5 lines · Suman Tripathi
Quoted 2 lines

Sorry, but the patch is still coming through mangled. Did you use git send-email ?

[Suman Tripathi] yes. I rechecked before sending twice. Sorry for the inconvenience. Will figure the issue out

I can apply it manually while you work out the kinks in your email setup. It might even be your company MTA mangling it, I've seen all sorts of crazy like that.

Signature · 1 line
Jens Axboe
#4 lore raw

Hi Jens

With regards,
Suman

Quoted 18 lines

-----Original Message-----
From: Jens Axboe <[email protected]>
Sent: Friday, September 7, 2018 7:26 AM
To: Suman Tripathi <[email protected]>; Hans de Goede <[email protected]>; tj at kernel.org; linux-ide at vger.kernel.org; linux- arm-kernel at lists.infradead.org; linux-kernel at vger.kernel.org; joe at perches.com; arnd at arndb.de; gregkh at linuxfoundation.org
Cc: Open Source Submission <[email protected]>; Rameshwar Sahu <[email protected]>
Subject: Re: [PATCH v3] ata: Disable AHCI ALPM feature for Ampere Computing eMAG SATA

[NOTICE: This email originated from an external sender. Please be mindful of safe email handling and proprietary information protection practices.]
_____________________________________________________________
___________________________________________________________

On 9/6/18 2:08 PM, Suman Tripathi wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Sorry, but the patch is still coming through mangled. Did you use git send-email ?

[Suman Tripathi] yes. I rechecked before sending twice. Sorry for the inconvenience. Will figure the issue out

I can apply it manually while you work out the kinks in your email setup. It might even be your company MTA mangling it, I've seen all sorts of crazy like that.

Thanks for the support. We are working with IT to fix this issue.

Quoted 3 lines

--
Jens Axboe

#5 lore raw
Quoted 5 lines · Suman Tripathi
Quoted 3 lines

I can apply it manually while you work out the kinks in your email setup. It might even be your company MTA mangling it, I've seen all sorts of crazy like that.

Thanks for the support. We are working with IT to fix this issue.

Good luck! If all else fails, there's always gmail...

In any case, queued up:

http://git.kernel.dk/cgit/linux-block/commit/?h=for-4.20/libata&id=20bdc376b427cb420836f39ee8f281ea85dbaeef

Signature · 1 line
Jens Axboe