linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Jim Quinlan <james.quinlan@broadcom.com>
Cc: linux-pci@vger.kernel.org,
	"Nicolas Saenz Julienne" <nsaenz@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Cyril Brulebois" <kibi@debian.org>,
	"Stanimir Varbanov" <svarbanov@suse.de>,
	bcm-kernel-feedback-list@broadcom.com, jim2101024@gmail.com,
	"Florian Fainelli" <florian.fainelli@broadcom.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Rob Herring" <robh@kernel.org>,
	"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
	<linux-rpi-kernel@lists.infradead.org>,
	"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>,
	"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 4/8] PCI: brcmstb: Fix error path upon call of regulator_bulk_get()
Date: Thu, 6 Mar 2025 10:24:41 -0600	[thread overview]
Message-ID: <20250306162441.GA344031@bhelgaas> (raw)
In-Reply-To: <CA+-6iNyXeXhqzwbV+pcizpyXg-c-gihcLEtPv1s1uczdNN_VOQ@mail.gmail.com>

On Thu, Mar 06, 2025 at 10:24:56AM -0500, Jim Quinlan wrote:
> On Tue, Mar 4, 2025 at 9:49 AM Jim Quinlan <james.quinlan@broadcom.com> wrote:
> > On Mon, Mar 3, 2025 at 1:40 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
> > > On Fri, Feb 14, 2025 at 12:39:32PM -0500, Jim Quinlan wrote:
> > > > If regulator_bulk_get() returns an error, no regulators are created and we
> > > > need to set their number to zero.  If we do not do this and the PCIe
> > > > link-up fails, regulator_bulk_free() will be invoked and effect a panic.
> > > >
> > > > Also print out the error value, as we cannot return an error upwards as
> > > > Linux will WARN on an error from add_bus().
> > > >
> > > > Fixes: 9e6be018b263 ("PCI: brcmstb: Enable child bus device regulators from DT")
> > > > Signed-off-by: Jim Quinlan <james.quinlan@broadcom.com>
> > > > ---
> > > >  drivers/pci/controller/pcie-brcmstb.c | 3 ++-
> > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
> > > > index e0b20f58c604..56b49d3cae19 100644
> > > > --- a/drivers/pci/controller/pcie-brcmstb.c
> > > > +++ b/drivers/pci/controller/pcie-brcmstb.c
> > > > @@ -1416,7 +1416,8 @@ static int brcm_pcie_add_bus(struct pci_bus *bus)
> > > >
> > > >               ret = regulator_bulk_get(dev, sr->num_supplies, sr->supplies);
> > > >               if (ret) {
> > > > -                     dev_info(dev, "No regulators for downstream device\n");
> > > > +                     dev_info(dev, "Did not get regulators; err=%d\n", ret);
> > > > +                     pcie->sr = NULL;
> > >
> > > Is alloc_subdev_regulators() buying us something useful?  It seems
> > > like it would be simpler to have:
> > >
> > >   struct brcm_pcie {
> > >     ...
> > >     struct regulator_bulk_data supplies[3];
> > >     ...
> > >   };
> > >
> > > I think that's what most callers of devm_regulator_bulk_get() do.
> 
> Manivannan stated that this series has already been merged.  So shall
> I implement your comments with a commit sometime in the future?

Sorry, I should have mentioned this would be something possible for
the future.  This current series is all set to go.

Bjorn


  reply	other threads:[~2025-03-06 16:28 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-14 17:39 [PATCH v2 0/8] PCI: brcmstb: Misc small tweaks and fixes Jim Quinlan
2025-02-14 17:39 ` [PATCH v2 1/8] PCI: brcmstb: Set gen limitation before link, not after Jim Quinlan
2025-02-20 17:27   ` Florian Fainelli
2025-03-04 14:51   ` Manivannan Sadhasivam
2025-02-14 17:39 ` [PATCH v2 2/8] PCI: brcmstb: Write to internal register to change link cap Jim Quinlan
2025-02-20 17:28   ` Florian Fainelli
2025-03-04 14:54   ` Manivannan Sadhasivam
2025-02-14 17:39 ` [PATCH v2 3/8] PCI: brcmstb: Do not assume that reg field starts at LSB Jim Quinlan
2025-02-20 17:29   ` Florian Fainelli
2025-03-04 14:57   ` Manivannan Sadhasivam
2025-02-14 17:39 ` [PATCH v2 4/8] PCI: brcmstb: Fix error path upon call of regulator_bulk_get() Jim Quinlan
2025-02-20 17:29   ` Florian Fainelli
2025-03-03 18:40   ` Bjorn Helgaas
2025-03-04 14:49     ` Jim Quinlan
2025-03-06 15:24       ` Jim Quinlan
2025-03-06 16:24         ` Bjorn Helgaas [this message]
2025-03-04 15:03   ` Manivannan Sadhasivam
2025-03-04 16:55     ` Jim Quinlan
2025-03-04 17:07       ` Manivannan Sadhasivam
2025-03-04 17:24         ` Jim Quinlan
2025-03-04 17:32           ` Manivannan Sadhasivam
2025-03-04 17:54             ` Krzysztof Wilczyński
2025-02-14 17:39 ` [PATCH v2 5/8] PCI: brcmstb: Fix potential premature regulator disabling Jim Quinlan
2025-02-20 17:30   ` Florian Fainelli
2025-03-04 15:04   ` Manivannan Sadhasivam
2025-02-14 17:39 ` [PATCH v2 6/8] PCI: brcmstb: Use same constant table for config space access Jim Quinlan
2025-02-20 18:14   ` Florian Fainelli
2025-03-04 15:08   ` Manivannan Sadhasivam
2025-03-04 16:37     ` Jim Quinlan
2025-03-04 16:58       ` Manivannan Sadhasivam
2025-03-04 17:37         ` Jim Quinlan
2025-03-05  5:47           ` Manivannan Sadhasivam
2025-02-14 17:39 ` [PATCH v2 7/8] PCI: brcmstb: Make two changes in MDIO register fields Jim Quinlan
2025-02-20 18:15   ` Florian Fainelli
2025-03-04 15:09   ` Manivannan Sadhasivam
2025-02-14 17:39 ` [PATCH v2 8/8] PCI: brcmstb: Clarify conversion of irq_domain_set_info() param Jim Quinlan
2025-02-20 18:15   ` Florian Fainelli
2025-03-04 15:10   ` Manivannan Sadhasivam
2025-03-01 14:48 ` [PATCH v2 0/8] PCI: brcmstb: Misc small tweaks and fixes Krzysztof Wilczyński
2025-03-04 16:10   ` Krzysztof Wilczyński

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=20250306162441.GA344031@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bhelgaas@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=james.quinlan@broadcom.com \
    --cc=jim2101024@gmail.com \
    --cc=kibi@debian.org \
    --cc=kw@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=nsaenz@kernel.org \
    --cc=robh@kernel.org \
    --cc=svarbanov@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).