mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Keith Busch <kbusch@kernel.org>
Cc: Jens Axboe <axboe@fb.com>, Christoph Hellwig <hch@lst.de>,
	Sagi Grimberg <sagi@grimberg.me>,
	elvis.angelaccio@kde.org, linux-nvme@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvme: Add a module parameter for users to force simple suspend
Date: Tue, 28 Feb 2023 17:48:28 -0600	[thread overview]
Message-ID: <576494fb-c3c0-1072-a461-8a822f079f1d@amd.com> (raw)
In-Reply-To: <Y/6BX58qVUUx/Ey2@kbusch-mbp.dhcp.thefacebook.com>

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.

      reply	other threads:[~2023-02-28 23:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28 22:11 Mario Limonciello
2023-02-28 22:34 ` Keith Busch
2023-02-28 23:48   ` Mario Limonciello [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=576494fb-c3c0-1072-a461-8a822f079f1d@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=axboe@fb.com \
    --cc=elvis.angelaccio@kde.org \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®