All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Limonciello, Mario" <mario.limonciello@amd.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>, Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@fb.com>,
	Sagi Grimberg <sagi@grimberg.me>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	"open list:NVM EXPRESS DRIVER" <linux-nvme@lists.infradead.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	rrangel@chromium.org, David Box <david.e.box@linux.intel.com>,
	Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
	Nehal-bakulchandra.Shah@amd.com,
	Alex Deucher <Alexander.Deucher@amd.com>,
	Prike Liang <prike.liang@amd.com>,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH v6 1/2] ACPI: Move check for _DSD StorageD3Enable property to acpi
Date: Tue, 8 Jun 2021 09:18:53 -0500	[thread overview]
Message-ID: <556a22c7-58af-b9d4-d50c-25d7d16bd344@amd.com> (raw)
In-Reply-To: <CAJZ5v0gMgwJ9kq_mo_dYoTUAqQzhXmrgp9wnY4TRPU1pJp=TyQ@mail.gmail.com>

On 6/8/2021 06:20, Rafael J. Wysocki wrote:
> On Tue, Jun 8, 2021 at 7:35 AM Christoph Hellwig <hch@lst.de> wrote:
>>
>> On Mon, Jun 07, 2021 at 12:31:55PM -0500, Mario Limonciello wrote:
>>> +/**
>>> + * acpi_storage_d3 - Check if a storage device should use D3.
> 
> Let's be specific about what D3 means here in the first place and
> that's D3hot AFAICS.
> 
> And the comment should be something like "Check whether or not to use
> D3hot in the suspend path".

Actually it can be D3hot or D3cold.  Microsoft's documentation doesn't 
indicate it's D3hot.  On the AMD platforms that prompted some of these 
changes it's D3cold.

> 
>>> + * @dev: Device to check
>>> + *
>>> + * Returns %true if @dev should be put into D3 when the ->suspend method is
>>> + * called, else %false.  The name of this function is somewhat misleading
>>> + * as it has nothing to do with storage except for the name of the ACPI
>>> + * property.  On some platforms resume will not work if this hint is ignored.
> 
> I would write it this way:
> 
> "Return %true if the platform firmware wants @dev to be programmed
> into D3hot in the suspend path, or %false when there is no specific
> preference. On some platforms, if this hint is ignored, @dev may
> remain unresponsive after suspending the platform as a whole."
> 
> And I'm not sure if it is necessary to mention "storage" in this comment at all.
> 

Is your thought here in not mentioning "storage" that this symbol may be 
overloaded in the future to look at more than just the StorageD3Enable 
property and used for other things too?

>>> + *
>>> + */
>>
>> I still do not like this comment.  There is nothing about only using this
>> for storage devices.  It is specific to a PCIe slot, and if I plug
>> something that is not a storage device into it the same restrictions
>> still apply.
> 
> Originally, it was about storage devices IIUC (and that's why the
> property name is what it is).
>  > IIRC PCIe link management was broken in some NVMe drives and putting
> them into D3hot would allow the link to go down later and it would
> never go up again.  So you-know-who decided to avoid using D3hot for
> all NVMe drives and they were generally characterized as "storage".
> Alas, that turned out to break other things depending on the devices
> being put into D3hot (like PS_ON) so the property was invented to
> allow OEMs to mark the configurations including the devices that
> actually worked (and Linux was/is on the receiving end). And
> originally the property applied to the endpoint device under the root
> port it was present for (my personal opinion about this doesn't really
> matter, so let me avoid wasting time on expressing it).
> 
> Now, it evidently has been re-purposed to mark PCIe root ports that
> require devices under them to be put into D3hot in the suspend path
> (and it now means any device under the root port with this property,
> at least in some cases).
> 
>> Also no need for the empty-ish line at the end.
> 
> Right.
> 


WARNING: multiple messages have this Message-ID (diff)
From: "Limonciello, Mario" <mario.limonciello@amd.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>, Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@fb.com>,
	Sagi Grimberg <sagi@grimberg.me>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	"open list:NVM EXPRESS DRIVER" <linux-nvme@lists.infradead.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	rrangel@chromium.org, David Box <david.e.box@linux.intel.com>,
	Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
	Nehal-bakulchandra.Shah@amd.com,
	Alex Deucher <Alexander.Deucher@amd.com>,
	Prike Liang <prike.liang@amd.com>,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH v6 1/2] ACPI: Move check for _DSD StorageD3Enable property to acpi
Date: Tue, 8 Jun 2021 09:18:53 -0500	[thread overview]
Message-ID: <556a22c7-58af-b9d4-d50c-25d7d16bd344@amd.com> (raw)
In-Reply-To: <CAJZ5v0gMgwJ9kq_mo_dYoTUAqQzhXmrgp9wnY4TRPU1pJp=TyQ@mail.gmail.com>

On 6/8/2021 06:20, Rafael J. Wysocki wrote:
> On Tue, Jun 8, 2021 at 7:35 AM Christoph Hellwig <hch@lst.de> wrote:
>>
>> On Mon, Jun 07, 2021 at 12:31:55PM -0500, Mario Limonciello wrote:
>>> +/**
>>> + * acpi_storage_d3 - Check if a storage device should use D3.
> 
> Let's be specific about what D3 means here in the first place and
> that's D3hot AFAICS.
> 
> And the comment should be something like "Check whether or not to use
> D3hot in the suspend path".

Actually it can be D3hot or D3cold.  Microsoft's documentation doesn't 
indicate it's D3hot.  On the AMD platforms that prompted some of these 
changes it's D3cold.

> 
>>> + * @dev: Device to check
>>> + *
>>> + * Returns %true if @dev should be put into D3 when the ->suspend method is
>>> + * called, else %false.  The name of this function is somewhat misleading
>>> + * as it has nothing to do with storage except for the name of the ACPI
>>> + * property.  On some platforms resume will not work if this hint is ignored.
> 
> I would write it this way:
> 
> "Return %true if the platform firmware wants @dev to be programmed
> into D3hot in the suspend path, or %false when there is no specific
> preference. On some platforms, if this hint is ignored, @dev may
> remain unresponsive after suspending the platform as a whole."
> 
> And I'm not sure if it is necessary to mention "storage" in this comment at all.
> 

Is your thought here in not mentioning "storage" that this symbol may be 
overloaded in the future to look at more than just the StorageD3Enable 
property and used for other things too?

>>> + *
>>> + */
>>
>> I still do not like this comment.  There is nothing about only using this
>> for storage devices.  It is specific to a PCIe slot, and if I plug
>> something that is not a storage device into it the same restrictions
>> still apply.
> 
> Originally, it was about storage devices IIUC (and that's why the
> property name is what it is).
>  > IIRC PCIe link management was broken in some NVMe drives and putting
> them into D3hot would allow the link to go down later and it would
> never go up again.  So you-know-who decided to avoid using D3hot for
> all NVMe drives and they were generally characterized as "storage".
> Alas, that turned out to break other things depending on the devices
> being put into D3hot (like PS_ON) so the property was invented to
> allow OEMs to mark the configurations including the devices that
> actually worked (and Linux was/is on the receiving end). And
> originally the property applied to the endpoint device under the root
> port it was present for (my personal opinion about this doesn't really
> matter, so let me avoid wasting time on expressing it).
> 
> Now, it evidently has been re-purposed to mark PCIe root ports that
> require devices under them to be put into D3hot in the suspend path
> (and it now means any device under the root port with this property,
> at least in some cases).
> 
>> Also no need for the empty-ish line at the end.
> 
> Right.
> 


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2021-06-08 14:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 17:31 [PATCH v6 1/2] ACPI: Move check for _DSD StorageD3Enable property to acpi Mario Limonciello
2021-06-07 17:31 ` Mario Limonciello
2021-06-07 17:31 ` [PATCH v6 2/2] ACPI: Add quirks for AMD Renoir/Lucienne CPUs to force the D3 hint Mario Limonciello
2021-06-07 17:31   ` Mario Limonciello
2021-06-07 17:38   ` Raul Rangel
2021-06-07 17:38     ` Raul Rangel
2021-06-08  6:01   ` Julian Sikorski
2021-06-08  6:01     ` Julian Sikorski
2021-06-08 11:27   ` Rafael J. Wysocki
2021-06-08 11:27     ` Rafael J. Wysocki
2021-06-08  5:35 ` [PATCH v6 1/2] ACPI: Move check for _DSD StorageD3Enable property to acpi Christoph Hellwig
2021-06-08  5:35   ` Christoph Hellwig
2021-06-08 11:20   ` Rafael J. Wysocki
2021-06-08 11:20     ` Rafael J. Wysocki
2021-06-08 14:18     ` Limonciello, Mario [this message]
2021-06-08 14:18       ` Limonciello, Mario
2021-06-08 15:27       ` Rafael J. Wysocki
2021-06-08 15:27         ` Rafael J. Wysocki
2021-06-08 20:01   ` Keith Busch
2021-06-08 20:01     ` Keith Busch
2021-06-09 13:00     ` Christoph Hellwig
2021-06-09 13:00       ` Christoph Hellwig

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=556a22c7-58af-b9d4-d50c-25d7d16bd344@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Nehal-bakulchandra.Shah@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=axboe@fb.com \
    --cc=david.e.box@linux.intel.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=prike.liang@amd.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=rrangel@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.