lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+-6iNy9KxwZ67+PUqukou3KVZ7_VwZMRQ7tty+6yG_osaOE8g@mail.gmail.com>
Date: Thu, 6 Feb 2025 12:57:29 -0500
From: Jim Quinlan <james.quinlan@...adcom.com>
To: Bjorn Helgaas <helgaas@...nel.org>
Cc: linux-pci@...r.kernel.org, Nicolas Saenz Julienne <nsaenz@...nel.org>, 
	Bjorn Helgaas <bhelgaas@...gle.com>, Lorenzo Pieralisi <lorenzo.pieralisi@....com>, 
	Cyril Brulebois <kibi@...ian.org>, Stanimir Varbanov <svarbanov@...e.de>, 
	bcm-kernel-feedback-list@...adcom.com, jim2101024@...il.com, 
	Florian Fainelli <florian.fainelli@...adcom.com>, Lorenzo Pieralisi <lpieralisi@...nel.org>, 
	Krzysztof Wilczyński <kw@...ux.com>, 
	Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>, Rob Herring <robh@...nel.org>, 
	"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" <linux-rpi-kernel@...ts.infradead.org>, 
	"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" <linux-arm-kernel@...ts.infradead.org>, 
	open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 3/6] PCI: brcmstb: Fix potential premature regluator disabling

On Thu, Feb 6, 2025 at 12:33 PM Bjorn Helgaas <helgaas@...nel.org> wrote:
>
> In subject,
>
> s/regluator/regulator/

ack
>
>
> On Wed, Feb 05, 2025 at 02:12:03PM -0500, Jim Quinlan wrote:
> > Our system for enabling and disabling regulators is designed to work
> > only on the port driver below the root complex.  The conditions to
> > discriminate for this case should be the same when we are adding or
> > removing the bus.  Without this change the regulators may be disabled
> > prematurely when a bus further down the tree is removed.
>
> What did the user do to cause the bus to be removed?  I'm wondering if
> we turn off the power while the link is still up.  If we do, how does
> it get turned back on?  Does that require a manual rescan, and the
> scan of the child bus gets the power turned back on?

Hi Bjorn,

We only support having a regulator  for the device immediately
connected to the RC.  If the entire RC driver is unbound or rmod'd for
example, a device further down in the tree would be dismantled first
and it would turn off the regulator for the device closest to the RC.
This could cause errors during the removal of the closest device, as
it would be unable to access its registers.

Note that we do not support hotplug so there are no rescans going on
in our world.  We do have customers whose chip has several PCIe
controllers and they do unbind some of their drivers during power
critical scenarios.

The RPi folks do not use this regulator mechanism AFAICT.

Regards,
Jim Quiinlan
Broadcom STB/CM
>
>
> > Fixes: 9e6be018b263 ("PCI: brcmstb: Enable child bus device regulators from DT")
> > Signed-off-by: Jim Quinlan <james.quinlan@...adcom.com>
> > ---
> >  drivers/pci/controller/pcie-brcmstb.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
> > index bf919467cbcd..4f5d751cbdd7 100644
> > --- a/drivers/pci/controller/pcie-brcmstb.c
> > +++ b/drivers/pci/controller/pcie-brcmstb.c
> > @@ -1441,7 +1441,7 @@ static void brcm_pcie_remove_bus(struct pci_bus *bus)
> >       struct subdev_regulators *sr = pcie->sr;
> >       struct device *dev = &bus->dev;
> >
> > -     if (!sr)
> > +     if (!sr || !bus->parent || !pci_is_root_bus(bus->parent))
> >               return;
> >
> >       if (regulator_bulk_disable(sr->num_supplies, sr->supplies))
> > --
> > 2.43.0
> >

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4210 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ