* [PATCH v2] ata: Disable AHCI ALPM feature for Ampere Computing eMAG SATA
@ 2018-09-05 20:12 Suman Tripathi
2018-09-05 20:15 ` Hans de Goede
0 siblings, 1 reply; 3+ messages in thread
From: Suman Tripathi @ 2018-09-05 20:12 UTC (permalink / raw)
To: linux-arm-kernel
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 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.
Signed-off-by: Suman Trpathi <stripathi@amperecomputing.com>
Signed-off-by: Rameshwar Prasad Sahu <rameshwar.sahu@amperecomputing.com>
---
drivers/ata/ahci_platform.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index 99f9a89..c3043f6 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -33,6 +33,13 @@
.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,7 +48,8 @@ static int ahci_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct ahci_host_priv *hpriv;
- int rc;
+ const struct ata_port_info *port;
+ int rc;
hpriv = ahci_platform_get_resources(pdev);
if (IS_ERR(hpriv))
@@ -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 SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_platform_suspend,
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) },
{},
};
--
1.8.3.1
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.
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2] ata: Disable AHCI ALPM feature for Ampere Computing eMAG SATA
2018-09-05 20:12 [PATCH v2] ata: Disable AHCI ALPM feature for Ampere Computing eMAG SATA Suman Tripathi
@ 2018-09-05 20:15 ` Hans de Goede
2018-09-05 20:21 ` Suman Tripathi
0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2018-09-05 20:15 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On 05-09-18 22:12, Suman Tripathi wrote:
> 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 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.
>
> Signed-off-by: Suman Trpathi <stripathi@amperecomputing.com>
> Signed-off-by: Rameshwar Prasad Sahu <rameshwar.sahu@amperecomputing.com>
> ---
> drivers/ata/ahci_platform.c | 17 +++++++++++++++--
> 1 file changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
> index 99f9a89..c3043f6 100644
> --- a/drivers/ata/ahci_platform.c
> +++ b/drivers/ata/ahci_platform.c
> @@ -33,6 +33,13 @@
> .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,7 +48,8 @@ static int ahci_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> struct ahci_host_priv *hpriv;
> - int rc;
> + const struct ata_port_info *port;
> + int rc;
You are accidentally changing the indentation of rc here.
Please fix this and run scripts/checkpatch.pl on the patch before
submitting v3. Otherwise v2 looks good.
Regards,
Hans
>
> hpriv = ahci_platform_get_resources(pdev);
> if (IS_ERR(hpriv))
> @@ -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 SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_platform_suspend,
> 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) },
> {},
> };
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] ata: Disable AHCI ALPM feature for Ampere Computing eMAG SATA
2018-09-05 20:15 ` Hans de Goede
@ 2018-09-05 20:21 ` Suman Tripathi
0 siblings, 0 replies; 3+ messages in thread
From: Suman Tripathi @ 2018-09-05 20:21 UTC (permalink / raw)
To: linux-arm-kernel
Hi Hans
Thanks for your quick review !!
With regards,
Suman
-----Original Message-----
From: Hans de Goede <hdegoede@redhat.com>
Sent: Wednesday, September 5, 2018 1:16 PM
To: Suman Tripathi <stripathi@amperecomputing.com>; 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 <patches@amperecomputing.com>; Rameshwar Sahu <Rameshwar.Sahu@amperecomputing.com>
Subject: Re: [PATCH v2] 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,
On 05-09-18 22:12, Suman Tripathi wrote:
> 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 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.
>
> Signed-off-by: Suman Trpathi <stripathi@amperecomputing.com>
> Signed-off-by: Rameshwar Prasad Sahu
> <rameshwar.sahu@amperecomputing.com>
> ---
> drivers/ata/ahci_platform.c | 17 +++++++++++++++--
> 1 file changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
> index 99f9a89..c3043f6 100644
> --- a/drivers/ata/ahci_platform.c
> +++ b/drivers/ata/ahci_platform.c
> @@ -33,6 +33,13 @@
> .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,7 +48,8 @@ static int ahci_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> struct ahci_host_priv *hpriv;
> - int rc;
> + const struct ata_port_info *port;
> + int rc;
You are accidentally changing the indentation of rc here.
[Suman Tripathi] yes will fix in v3
Please fix this and run scripts/checkpatch.pl on the patch before submitting v3. Otherwise v2 looks good.
Regards,
Hans
>
> hpriv = ahci_platform_get_resources(pdev);
> if (IS_ERR(hpriv))
> @@ -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 SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_platform_suspend,
> 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) },
> {},
> };
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-09-05 20:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-05 20:12 [PATCH v2] ata: Disable AHCI ALPM feature for Ampere Computing eMAG SATA Suman Tripathi
2018-09-05 20:15 ` Hans de Goede
2018-09-05 20:21 ` Suman Tripathi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox