From: Bjorn Helgaas <helgaas@kernel.org>
To: Jim Quinlan <james.quinlan@broadcom.com>
Cc: "Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
"Bartosz Golaszewski" <bartosz.golaszewski@linaro.org>,
"open list:PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS"
<linux-pci@vger.kernel.org>, "'Cyril Brulebois" <kibi@debian.org>,
"maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE"
<bcm-kernel-feedback-list@broadcom.com>,
"'Nicolas Saenz Julienne" <nsaenz@kernel.org>,
"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>
Subject: Re: POSSIBLE REGRESSION: PCI/pwrctrl: Skip scanning for the device further if pwrctrl device is created
Date: Mon, 19 May 2025 16:56:01 -0500 [thread overview]
Message-ID: <20250519215601.GA1258127@bhelgaas> (raw)
In-Reply-To: <CA+-6iNxkYumAvk5G6KhYqON9K3bwxGn+My-22KZnGF5Pg8cgfA@mail.gmail.com>
On Mon, May 19, 2025 at 03:59:10PM -0400, Jim Quinlan wrote:
> On Mon, May 19, 2025 at 2:25 PM Jim Quinlan <james.quinlan@broadcom.com> wrote:
> > On Mon, May 19, 2025 at 1:28 PM Manivannan Sadhasivam
> > <manivannan.sadhasivam@linaro.org> wrote:
> > > On Mon, May 19, 2025 at 09:05:57AM -0500, Bjorn Helgaas wrote:
> > > > On Mon, May 05, 2025 at 01:39:39PM -0400, Jim Quinlan wrote:
> > > > > Hello,
> > > > >
> > > > > I recently rebased to the latest Linux master
> > > > >
> > > > > ebd297a2affa Linus.Torvalds Merge tag 'net-6.15-rc5' of
> > > > > git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
> > > > >
> > > > > and noticed that PCI is broken for
> > > > > "drivers/pci/controller/pcie-brcmstb.c" I've bisected this
> > > > > to the following commit
> > > > >
> > > > > 2489eeb777af PCI/pwrctrl: Skip scanning for the device further if pwrctrl device is created
> > > > >
> > > > > which is part of the series [1]. The driver in
> > > > > pcie-brcmstb.c is expecting the add_bus() method to be
> > > > > invoked twice per boot-up, but the second call does not
> > > > > happen. Not only does this code in brcm_pcie_add_bus() turn
> > > > > on regulators, it also subsequently initiates PCIe linkup.
> > > > >
> > > > > If I revert the aforementioned commit, all is well.
> > > > >
> > > > > FWIW, I have included the relevant sections of the PCIe DT
> > > > > we use at [2].
> > > >
> > > > Mani, Bartosz, where are we at with this? The 2489eeb777af
> > > > commit log doesn't mention a problem fixed by that commit; it
> > > > sounds more like an optimization -- just avoiding an
> > > > unnecessary scan.
> > > >
> > > > 2489eeb777af appeared in v6.15-rc1, so there's still time to
> > > > revert it before v6.15 if that's the right way to fix this
> > > > regression.
> > >
> > > We need to find out what is happening in the pcie-brcmstb driver
> > > first. From Jim's report, it looks like the driver expects
> > > add_bus() callback to be invoked twice, which seems weird.
> >
> > The pci_ops add_bus() method is invoked once for bus 0 and once
> > for bus 1. Note that our controller only has one port. If I do
> > "lspci" I get (our controller is on pci domain==1):
> >
> > 0001:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries Device 7712 (rev 20)
> > 0001:01:00.0 Ethernet controller: Broadcom Inc. ...
> >
> > It is the second invocation of add_bus() that has the brcmstb
> > driver turning on the regulators and the subsequent link-up, and
> > this call never happens with the 2489eeb777aff9 commit.
>
> Actually, I don't think it is sufficient to just revert that one
> commit. If I checkout 6.14-rc1 and just bring in
>
> 06bf05d7349c PCI/pwrctrl: Move creation of pwrctrl devices to pci_scan_device()
06bf05d7349c doesn't exist upstream; I assume it is 957f40d039a9
("PCI/pwrctrl: Move creation of pwrctrl devices to pci_scan_device()")
> I get the following after getting the Linux prompt:
>
> pci 0001:00:00.0: deferred probe pending: pci: supplier
> 1000110000.pcie:pci@0,0 not ready
> pci 0001:00:00.0: deferred probe pending: pci: supplier
> 1000110000.pcie:pci@0,0 not ready
>
> Basically, brcmstb already picks up and controls the regulator nodes
> under the port driver node. You folks are adding a new generic
> system and we are stepping on one another's toes. The problem here
> is that I cannot seem to turn your system off using CONFIG_PWR*
> settings.
>
> We would certainly be open to adopting your system when it meets our
> requirements; such as turning off/on on regulators @suspend/resume,
> and the ability to not do that if the downstream device has
> device_may_wakeup(dev)==true. But until then we need a way to
> disable your system or allow brcmstb to "opt out".
>
> AFAICT this regression does not affect the RaspberryPi SoCs, so it
> is not a big deal for us if we take our time to fix this. But if
> so, it is incumbent on you folks to help me get past this
> regression. Is that reasonable?
What systems does the regression affect?
I'm not keen on adding any kind of regression in v6.15 if we can avoid
it. Given that v6.15 will likely be released next weekend, I want to
revert whatever is necessary tomorrow unless there's a clear path to a
fix very soon.
You first thought reverting 2489eeb777af ("PCI/pwrctrl: Skip scanning
for the device further if pwrctrl device is created") would be enough
to avoid the regression.
But it sounds like something is broken even if you include only the
first patch of the branch (957f40d039a9 ("PCI/pwrctrl: Move creation
of pwrctrl devices to pci_scan_device()")).
Maybe this means we need to revert the entire branch:
55d25a101d47 ("Merge branch 'pci/pwrctrl'")
75996c92f4de ("PCI/pwrctrl: Add pwrctrl driver for PCI slots")
2a95c1f3468b ("dt-bindings: vendor-prefixes: Document the 'pciclass' prefix")
2489eeb777af ("PCI/pwrctrl: Skip scanning for the device further if pwrctrl device is created")
2d923930f2e3 ("PCI/pwrctrl: Move pci_pwrctrl_unregister() to pci_destroy_dev()")
957f40d039a9 ("PCI/pwrctrl: Move creation of pwrctrl devices to pci_scan_device()")
The only patch there that sounds like it might fix a defect is
2d923930f2e3 ("PCI/pwrctrl: Move pci_pwrctrl_unregister() to
pci_destroy_dev()"). I guess if this *does* fix a defect, the defect
only happens when removing a device, and dropping a defect fix is
better than adding a regression.
Guidance please.
> > > If the fix takes time, then we can revert 2489eeb777af in the meantime.
> > >
> > > - Mani
> > >
> > > --
> > > மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2025-05-19 21:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-05 17:39 POSSIBLE REGRESSION: PCI/pwrctrl: Skip scanning for the device further if pwrctrl device is created Jim Quinlan
2025-05-19 14:05 ` Bjorn Helgaas
2025-05-19 17:28 ` Manivannan Sadhasivam
2025-05-19 18:25 ` Jim Quinlan
2025-05-19 19:59 ` Jim Quinlan
2025-05-19 21:56 ` Bjorn Helgaas [this message]
2025-05-19 23:03 ` Jim Quinlan
2025-05-20 4:11 ` Manivannan Sadhasivam
2025-05-20 15:06 ` Jim Quinlan
2025-05-20 23:40 ` Manivannan Sadhasivam
2025-05-21 22:08 ` Jim Quinlan
2025-05-22 9:41 ` Manivannan Sadhasivam
2025-05-19 17:26 ` Manivannan Sadhasivam
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=20250519215601.GA1258127@bhelgaas \
--to=helgaas@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=james.quinlan@broadcom.com \
--cc=kibi@debian.org \
--cc=kwilczynski@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=manivannan.sadhasivam@linaro.org \
--cc=nsaenz@kernel.org \
/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