On 9/18/2023 09:26, Lukas Wunner wrote:
On Mon, Sep 18, 2023 at 08:28:51AM -0500, Mario Limonciello wrote:
On 9/18/2023 08:24, Lukas Wunner wrote:
On Mon, Sep 18, 2023 at 08:14:21AM -0500, Mario Limonciello wrote:
What's the history behind why userspace is allowed to opt a device out of
D3cold in the first place?
It feels like it should have been a debugging only thing to me.
That's a fair question.
Apparently the default for d3cold_allowed was originally "false"
and user space could opt in to D3cold. Then commit 4f9c1397e2e8
("PCI/PM: Enable D3/D3cold by default for most devices") changed
the default to "true". That was 11 years ago.
I agree that today this should all work automatically and a
user space option to disable D3cold on a per-device basis only
really makes sense as a debugging aid, hence belongs in debugfs.
Thanks. Then perhaps as part of moving it to debugfs it makes sense to
simplify the logic.
d3cold_allowed is documented in Documentation/ABI/testing/sysfs-bus-pci,
so it's user space ABI which we're not allowed to break. We'd have to
declare it deprecated, emit a warning when it's used and slowly phase
it out over the years.
What about as part of deprecating it to make it always return -EINVAL no
matter the input? The ABI isn't broken, but it allows for the optimization.
Until then, the $SUBJECT_PATCH probably still makes sense to reinstate
the behavior we had until 2016...
Thanks,
Lukas