[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SA0PR12MB45107C702F031A7FF2052A2BE2669@SA0PR12MB4510.namprd12.prod.outlook.com>
Date: Mon, 29 Nov 2021 14:46:09 +0000
From: "Limonciello, Mario" <Mario.Limonciello@....com>
To: Sasha Levin <sashal@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
CC: "Shah, Nehal-bakulchandra" <Nehal-bakulchandra.Shah@....com>,
Damien Le Moal <damien.lemoal@...nsource.wdc.com>,
"linux-ide@...r.kernel.org" <linux-ide@...r.kernel.org>
Subject: RE: [PATCH AUTOSEL 5.15 28/39] ata: libahci: Adjust behavior when
StorageD3Enable _DSD is set
> -----Original Message-----
> From: Sasha Levin <sashal@...nel.org>
> Sent: Thursday, November 25, 2021 20:32
> To: linux-kernel@...r.kernel.org; stable@...r.kernel.org
> Cc: Limonciello, Mario <Mario.Limonciello@....com>; Shah, Nehal-
> bakulchandra <Nehal-bakulchandra.Shah@....com>; Damien Le Moal
> <damien.lemoal@...nsource.wdc.com>; Sasha Levin <sashal@...nel.org>;
> linux-ide@...r.kernel.org
> Subject: [PATCH AUTOSEL 5.15 28/39] ata: libahci: Adjust behavior when
> StorageD3Enable _DSD is set
>
> From: Mario Limonciello <mario.limonciello@....com>
>
> [ Upstream commit 7c5f641a5914ce0303b06bcfcd7674ee64aeebe9 ]
>
> The StorageD3Enable _DSD is used for the vendor to indicate that the disk
> should be opted into or out of a different behavior based upon the platform
> design.
>
> For AMD's Renoir and Green Sardine platforms it's important that any
> attached SATA storage has transitioned into DevSlp when s2idle is used.
>
> If the disk is left in active/partial/slumber, then the system is not able
> to resume properly.
>
> When the StorageD3Enable _DSD is detected, check the system is using
> s2idle
> and DevSlp is enabled and if so explicitly wait long enough for the disk to
> enter DevSlp.
>
> Cc: Nehal-bakulchandra Shah <Nehal-bakulchandra.Shah@....com>
> BugLink:
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugz
> illa.kernel.org%2Fshow_bug.cgi%3Fid%3D214091&data=04%7C01%7Cm
> ario.limonciello%40amd.com%7C15dc139812a0497d31bc08d9b0850f45%7C3d
> d8961fe4884e608e11a82d994e183d%7C0%7C0%7C637734907816859936%7CU
> nknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI
> 6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=%2BX2cfl%2BYeFYWZJ%2
> FPFWX%2FzxnNtneb2er7w%2BeJpVxxBcU%3D&reserved=0
> Link:
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs
> .microsoft.com%2Fen-us%2Fwindows-hardware%2Fdesign%2Fcomponent-
> guidelines%2Fpower-management-for-storage-hardware-devices-
> intro&data=04%7C01%7Cmario.limonciello%40amd.com%7C15dc139812
> a0497d31bc08d9b0850f45%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C
> 0%7C637734907816859936%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLj
> AwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&
> sdata=ubGKpzMA6EaXugHAanwRUQJ2lvL957wBRFKKMjUBGlw%3D&re
> served=0
> Signed-off-by: Mario Limonciello <mario.limonciello@....com>
> Signed-off-by: Damien Le Moal <damien.lemoal@...nsource.wdc.com>
> Signed-off-by: Sasha Levin <sashal@...nel.org>
> ---
> drivers/ata/libahci.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
> index 5b3fa2cbe7223..395772fa39432 100644
> --- a/drivers/ata/libahci.c
> +++ b/drivers/ata/libahci.c
> @@ -2305,6 +2305,18 @@ int ahci_port_resume(struct ata_port *ap)
> EXPORT_SYMBOL_GPL(ahci_port_resume);
>
> #ifdef CONFIG_PM
> +static void ahci_handle_s2idle(struct ata_port *ap)
> +{
> + void __iomem *port_mmio = ahci_port_base(ap);
> + u32 devslp;
> +
> + if (pm_suspend_via_firmware())
> + return;
> + devslp = readl(port_mmio + PORT_DEVSLP);
> + if ((devslp & PORT_DEVSLP_ADSE))
> + ata_msleep(ap, devslp_idle_timeout);
> +}
> +
> static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg)
> {
> const char *emsg = NULL;
> @@ -2318,6 +2330,9 @@ static int ahci_port_suspend(struct ata_port *ap,
> pm_message_t mesg)
> ata_port_freeze(ap);
> }
>
> + if (acpi_storage_d3(ap->host->dev))
> + ahci_handle_s2idle(ap);
> +
> ahci_rpm_put_port(ap);
> return rc;
> }
> --
> 2.33.0
Sasha,
No concerns for me to 5.15 or any of the earlier kernels the autosel picked, but would you mind also sending this to 5.14.y too?
Thanks,
Powered by blists - more mailing lists