[PATCH] nvme: Add quirk to fix hang issue on SanDisk SSD

Sagi Grimberg sagi at grimberg.me
Mon Jan 15 00:57:50 PST 2024


> The WDC PC SN520 SSD hangs on boot when APST is enabled, unless the
> nvme_core.default_ps_max_latency_us kernel parameter is set to a lower
> value. Add an entry for this drive to the 'core_quirks' table with the
> NO_DEEPEST_PS quirk to fix that.
> 
> Signed-off-by: Saúl Valdelvira <saul at saulv.es>
> ---
> This patch fixes an issue I've always had when running Linux on my
> Acer Extensa 215-22 laptop. I think it might be useful to other people
> with the same hardware as mine.
> This is the first time I submit a patch to the kernel, so I hope I did
> everything correctly and that I'm not wasting your time.

Does this issue have a bugzilla link?

> 
>   drivers/nvme/host/core.c | 12 +++++++++++-
>   1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 0af612387083..496563704c63 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -2626,7 +2626,17 @@ static const struct nvme_core_quirk_entry core_quirks[] = {
>   		.quirks = NVME_QUIRK_DELAY_BEFORE_CHK_RDY |
>   			  NVME_QUIRK_NO_DEEPEST_PS |
>   			  NVME_QUIRK_IGNORE_DEV_SUBNQN,
> -	}
> +	},
> +	{
> +		/*
> +		 * This SanDisk SSD hangs on boot unless the
> +		 * nvme_core.default_ps_max_latency_us kernel parameter is
> +		 * set to a lower value.
> +		 */
> +		.vid = 0x15b7,
> +		.mn = "WDC PC SN520 SDAPNUW-512G-1014",
> +		.quirks = NVME_QUIRK_NO_DEEPEST_PS,
> +	},
>   };
> 
>   /* match is null-terminated but idstr is space-padded. */
> --
> 2.43.0
> 



More information about the Linux-nvme mailing list