From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Lukas Wunner <lukas@wunner.de>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
linux-pci@vger.kernel.org,
Mario Limonciello <mario.limonciello@amd.com>
Subject: Re: [PATCH] PCI/sysfs: Protect driver's D3cold preference from user space
Date: Fri, 29 Sep 2023 07:44:13 +0300 [thread overview]
Message-ID: <20230929044413.GY3208943@black.fi.intel.com> (raw)
In-Reply-To: <20230928223630.GA507660@bhelgaas>
On Thu, Sep 28, 2023 at 05:36:30PM -0500, Bjorn Helgaas wrote:
> On Mon, Sep 18, 2023 at 02:48:01PM +0200, Lukas Wunner wrote:
> > struct pci_dev contains two flags which govern whether the device may
> > suspend to D3cold:
> >
> > * no_d3cold provides an opt-out for drivers (e.g. if a device is known
> > to not wake from D3cold)
> >
> > * d3cold_allowed provides an opt-out for user space (default is true,
> > user space may set to false)
> >
> > Since commit 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend"),
> > the user space setting overwrites the driver setting. Essentially user
> > space is trusted to know better than the driver whether D3cold is
> > working.
> >
> > That feels unsafe and wrong. Assume that the change was introduced
> > inadvertently and do not overwrite no_d3cold when d3cold_allowed is
> > modified. Instead, consider d3cold_allowed in addition to no_d3cold
> > when choosing a suspend state for the device.
> >
> > That way, user space may opt out of D3cold if the driver hasn't, but it
> > may no longer force an opt in if the driver has opted out.
> >
> > Fixes: 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend")
> > Signed-off-by: Lukas Wunner <lukas@wunner.de>
> > Cc: stable@vger.kernel.org # v4.8+
> > Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
>
> Mika and Mario, you both commented on this, but I *think* you were
> both OK with it as-is for now? If so, can you give a Reviewed-by?
> I don't want to go ahead if you have any concerns.
No concerns from me,
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
next prev parent reply other threads:[~2023-09-29 4:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 12:48 [PATCH] PCI/sysfs: Protect driver's D3cold preference from user space Lukas Wunner
2023-09-18 13:07 ` Mika Westerberg
2023-09-18 13:14 ` Mario Limonciello
2023-09-18 13:24 ` Lukas Wunner
2023-09-18 13:28 ` Mario Limonciello
2023-09-18 14:26 ` Lukas Wunner
2023-09-18 14:52 ` Mario Limonciello
2023-09-28 22:36 ` Bjorn Helgaas
2023-09-29 4:44 ` Mika Westerberg [this message]
2023-09-29 19:03 ` Limonciello, Mario
2023-09-29 22:48 ` Bjorn Helgaas
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=20230929044413.GY3208943@black.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mario.limonciello@amd.com \
--cc=rjw@rjwysocki.net \
/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;
as well as URLs for NNTP newsgroup(s).