[PATCH] nvme: Add a module parameter for users to force simple suspend

Keith Busch kbusch at kernel.org
Tue Feb 28 14:34:07 PST 2023


On Tue, Feb 28, 2023 at 04:11:48PM -0600, Mario Limonciello wrote:
> +static bool nvme_use_simple_suspend(struct pci_dev *pdev)
> +{
> +	if (!simple_suspend)
> +		return false;
> +	if (simple_suspend == 1)
> +		return true;
> +	return !noacpi && acpi_storage_d3(&pdev->dev);
> +}
> +
>  static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  {
>  	int node, result = -ENOMEM;
> @@ -3128,11 +3145,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  
>  	quirks |= check_vendor_combination_bug(pdev);
>  
> -	if (!noacpi && acpi_storage_d3(&pdev->dev)) {
> -		/*
> -		 * Some systems use a bios work around to ask for D3 on
> -		 * platforms that support kernel managed suspend.
> -		 */
> +	if (nvme_use_simple_suspend(pdev)) {
>  		dev_info(&pdev->dev,
>  			 "platform quirk: setting simple suspend\n");
>  		quirks |= NVME_QUIRK_SIMPLE_SUSPEND;

Do you want the user setting "never" to override the driver's default quirks?



More information about the Linux-nvme mailing list