From: Lukas Wunner <lukas@wunner.de>
To: Mario Limonciello <mario.limonciello@amd.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
bhelgaas@google.com, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: Make d3cold_allowed sysfs attribute read only
Date: Tue, 3 Oct 2023 22:07:39 +0200 [thread overview]
Message-ID: <20231003200739.GC16417@wunner.de> (raw)
In-Reply-To: <6291393a-b830-4a37-ad2a-1e23b6ec778e@amd.com>
On Tue, Oct 03, 2023 at 11:30:54AM -0500, Mario Limonciello wrote:
> On 10/3/2023 04:44, Mika Westerberg wrote:
> > On Mon, Oct 02, 2023 at 01:10:25PM -0500, Mario Limonciello wrote:
> > > Before d3cold was stable userspace was allowed to influence the kernel's
> > > decision of whether to enable d3cold for a device by a sysfs file
> > > `d3cold_allowed`. This potentially allows userspace to break the suspend
> > > for the system.
> > >
> > > For debugging purposes `pci_port_pm=` can be used to control whether
> > > a PCI port will go into D3cold and runtime PM can be turned off by
> > > sysfs on PCI end points.
> > >
> > > Change the sysfs attribute to read-only and simplify the internal kernel
> > > logic to avoid needing to store the userspace request.
> >
> > I wonder if this ends up breaking some userspace apps? Not objecting
> > though, just wanted to mention ;-)
> >
> > One thing we could do is to taint the kernel or log a warning if
> > userspace touches this but allow it to do so.
>
> If we collectively decide it needs to stay RW for userspace compatbility
> then I'll respin it to keep the store call but ignore whatever is written,
> return -EINVAL and emit a pr_warn_once() that it's a no-op.
I'd suggest to return 0 to avoid even the faintest ABI change whiff.
Just emit a warning once explaining that the feature is deprecated and
mark the attribute as such in ABI documentation.
Thanks,
Lukas
prev parent reply other threads:[~2023-10-03 20:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-02 18:10 [PATCH] PCI: Make d3cold_allowed sysfs attribute read only Mario Limonciello
2023-10-03 9:44 ` Mika Westerberg
2023-10-03 16:30 ` Mario Limonciello
2023-10-03 20:07 ` Lukas Wunner [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=20231003200739.GC16417@wunner.de \
--to=lukas@wunner.de \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=mika.westerberg@linux.intel.com \
/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