[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <576494fb-c3c0-1072-a461-8a822f079f1d@amd.com>
Date: Tue, 28 Feb 2023 17:48:28 -0600
From: Mario Limonciello <mario.limonciello@....com>
To: Keith Busch <kbusch@...nel.org>
Cc: Jens Axboe <axboe@...com>, Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>, elvis.angelaccio@....org,
linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] nvme: Add a module parameter for users to force simple
suspend
On 2/28/23 16:34, Keith Busch wrote:
> 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?
That hadn't occurred to me, but if offering a 0/1/-1 it certainly makes
sense. I'll add something to explicitly clear it if present for a V2.
Another way I've hypothesized that this problem (at least as reported)
can be approached is to examine if ANY disks in the system have simple
suspend set to apply a "global" change to all NVME disks.
If that is preferable I'm fine to spin it that way too.
Powered by blists - more mailing lists