From: Brian Norris <briannorris@chromium.org>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: "René Rebe" <rene@exactco.de>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
"Bjorn Helgaas" <bhelgaas@google.com>,
"John Paul Adrian Glaubitz" <glaubitz@physik.fu-berlin.de>,
"Riccardo Mottola" <riccardo.mottola@libero.it>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Lukas Wunner" <lukas@wunner.de>,
"Mario Limonciello" <mario.limonciello@amd.com>
Subject: Re: [PATCH] PCI: Fix PCI bridges not to go to D3Hot on older RISC systems
Date: Tue, 2 Dec 2025 13:54:00 -0800 [thread overview]
Message-ID: <aS9f-K_MN0uYUCYx@google.com> (raw)
In-Reply-To: <20251202172837.GA3078292@bhelgaas>
On Tue, Dec 02, 2025 at 11:28:37AM -0600, Bjorn Helgaas wrote:
> I think we need some kind of analysis of what is happening to the PCI
> devices here. I don't know why the CPU architecture per se would be
> related to PCI power management.
Agreed, and I think it will be very hard to ever make any traction on
modernizing the PM stack here if we can't any sort of "why?" answer out
of the systems that don't work. The last time this came up, the answer
was essentially:
https://lore.kernel.org/all/CAJZ5v0j_6jeMAQ7eFkZBe5Yi+USGzysxAgfemYh=-zq4h5W+Qg@mail.gmail.com/
The DMI check at the end of pci_bridge_d3_possible() is really
something to the effect of "there is no particular reason to prevent
this bridge from going into D3, but try to avoid platforms where it
may not work".
i.e., no specific reason, but a vague understanding that there is some
old HW that doesn't work. That's not very helpful for supporting non-DMI
systems that don't have a programmatic notion of "old."
OTOH, I sympathize with Rene, that it's hard to dig into what amounts to
new development on old platforms, and yet, they do remain broken.
> pci_bridge_d3_possible() is already a barely maintainable hodge podge
> of random things that work and don't work. Generally speaking most of
> those cases relate to firmware.
I wonder if we could take a different approach that helps straddle the
uncertain boundary here a bit:
1) be more aggressive at *permitting* runtime PM / D3 for bridges
(i.e., if we think a bridge might be OK to go to D3, then manage its
get()/put() properly); and
2) be less aggressive about default-enabling runtime suspend / D3
(i.e., only call pm_runtime_allow() in drivers/pci/pcie/portdrv.c in
limited circumstances).
For #2, that would actually match the documentation:
Documentation/power/pci.rst
The driver itself should not call pm_runtime_allow(), though. Instead, it
should let user space or some platform-specific code do that (user space can
do it via sysfs as stated above), but it must be prepared to handle the
runtime PM of the device correctly as soon as pm_runtime_allow() is called
(which may happen at any time, even before the driver is loaded).
So instead of portdrv.c calling pm_runtime_allow(), we'd leave that
decision to user space (i.e., udev or similar). That will help limit the
impact of getting #1 "wrong." And it's possible the bad systems didn't
really want aggressive PM anyway, so it's not worth much trouble.
For #1, that means pci_bridge_d3_possible() would become more like
pci_bridge_d3_impossible(). We could leave it as-is, or at least ensure
it fails toward the "possible" side.
IOW, user space can choose to opt in by way of:
echo auto > /sys/bus/pci/devices/[port device]/power/control
That might require some new udev rules if existing x86 systems are
supposed to retain their old behavior.
Personally, I care more about #1 (that the kernel manages pm_runtime_*()
refcounts properly, so that my systems *can* opt into aggressive PM),
and less about #2 (it's a fact of life that PM policy often requires
careful udev / sysfs management, and that the defaults will not
necessarily give the best power savings).
This might leave some old unmaintained systems as "D3 possible", but we
don't actually exercise it if user space doesn't poke
/sys/bus/pci/devices/[port device]/power/control.
Brian
next prev parent reply other threads:[~2025-12-02 21:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-02 16:40 [PATCH] PCI: Fix PCI bridges not to go to D3Hot on older RISC systems René Rebe
2025-12-02 16:54 ` John Paul Adrian Glaubitz
2025-12-02 17:04 ` René Rebe
2025-12-02 18:20 ` PCI bridge window issue (Was: Re: [PATCH] PCI: Fix PCI bridges not to go to D3Hot on older RISC systems) Ilpo Järvinen
2025-12-02 18:29 ` PCI bridge window issue René Rebe
2025-12-02 19:35 ` Ilpo Järvinen
2025-12-06 1:07 ` [PATCH] PCI: Fix PCI bridges not to go to D3Hot on older RISC systems Maciej W. Rozycki
2025-12-06 8:31 ` John Paul Adrian Glaubitz
2025-12-06 10:02 ` René Rebe
[not found] ` <339B5A39-BC20-489A-9969-BF01B4E6AD63@exactco.de>
2025-12-07 14:40 ` Maciej W. Rozycki
2025-12-06 10:14 ` René Rebe
2025-12-07 14:31 ` Maciej W. Rozycki
2025-12-02 17:28 ` Bjorn Helgaas
2025-12-02 17:41 ` René Rebe
2025-12-02 21:54 ` Brian Norris [this message]
2025-12-03 4:49 ` Lukas Wunner
2025-12-03 14:27 ` Mika Westerberg
2025-12-03 14:48 ` René Rebe
2025-12-03 15:22 ` Rafael J. Wysocki
2025-12-03 15:26 ` René Rebe
2025-12-03 17:16 ` Rafael J. Wysocki
2025-12-03 5:15 ` Lukas Wunner
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=aS9f-K_MN0uYUCYx@google.com \
--to=briannorris@chromium.org \
--cc=bhelgaas@google.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=helgaas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mani@kernel.org \
--cc=mario.limonciello@amd.com \
--cc=rafael@kernel.org \
--cc=rene@exactco.de \
--cc=riccardo.mottola@libero.it \
/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