From: Rob Herring <robh@kernel.org>
To: Luca Ceresoli <luca@lucaceresoli.net>,
Saravana Kannan <saravanak@google.com>
Cc: PCI <linux-pci@vger.kernel.org>,
"Dan Carpenter" <dan.carpenter@oracle.com>,
linux-omap <linux-omap@vger.kernel.org>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Kishon Vijay Abraham I" <kishon@ti.com>,
"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Sekhar Nori" <nsekhar@ti.com>
Subject: Re: [PATCH 1/2] PCI: dra7xx: Fix link removal on probe error
Date: Sat, 15 Jan 2022 10:02:00 -0600 [thread overview]
Message-ID: <CAL_JsqJ5nr6xJoTv3A6UPMMDXhWKcwSEUA3ux3kK8OMWQxdc6w@mail.gmail.com> (raw)
In-Reply-To: <4579940c-27dc-733e-4022-ebea4671c839@lucaceresoli.net>
+Saravana
On Tue, Jan 11, 2022 at 4:35 AM Luca Ceresoli <luca@lucaceresoli.net> wrote:
>
> Hi Rob,
>
> On 16/12/21 10:08, Luca Ceresoli wrote:
> > Hi Rob,
> >
> > thanks for the quick feedback!
> >
> > On 14/12/21 23:42, Rob Herring wrote:
> >> On Tue, Dec 14, 2021 at 4:15 PM Luca Ceresoli <luca@lucaceresoli.net> wrote:
> >>>
> >>> If a devm_phy_get() calls fails with phy_count==N (N > 0), then N links
> >>> have already been added by device_link_add() and won't be deleted by
> >>> device_link_del() because the code calls 'return' and not 'goto err_link'.
> >>>
> >>> Fix in a very simple way by doing all the devm_phy_get() calls before all
> >>> the device_link_add() calls.
> >>>
> >>> Fixes: 7a4db656a635 ("PCI: dra7xx: Create functional dependency between PCIe and PHY")
> >>> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> >>> ---
> >>> drivers/pci/controller/dwc/pci-dra7xx.c | 2 ++
> >>> 1 file changed, 2 insertions(+)
> >>>
> >>> diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c
> >>> index f7f1490e7beb..2ccc53869e13 100644
> >>> --- a/drivers/pci/controller/dwc/pci-dra7xx.c
> >>> +++ b/drivers/pci/controller/dwc/pci-dra7xx.c
> >>> @@ -757,7 +757,9 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)
> >>> phy[i] = devm_phy_get(dev, name);
> >>> if (IS_ERR(phy[i]))
> >>> return PTR_ERR(phy[i]);
> >>> + }
> >>>
> >>> + for (i = 0; i < phy_count; i++) {
> >>> link[i] = device_link_add(dev, &phy[i]->dev, DL_FLAG_STATELESS);
> >>
> >> I think this should happen automatically now with fw_devlink being
> >> enabled by default. Can you try?
> >
> > Do you mean removal should be done automatically? I think they are not
> > due to the DL_FLAG_STATELESS flag.
>
> I would love to have feedback because, as said, I think my patch is
> correct, but if I'm wrong (which might well be) I have to drop patch 1
> and rewrite patch 2 in a slightly more complex form.
I mean that why do you need explicit dependency tracking here when
dependencies on a PHY should happen automatically now. IOW, what is
special about this driver and dependency?
Rob
next prev parent reply other threads:[~2022-01-15 16:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-14 22:14 [PATCH 1/2] PCI: dra7xx: Fix link removal on probe error Luca Ceresoli
2021-12-14 22:14 ` [PATCH 2/2] PCI: dra7xx: Fix clk disabling in some error paths Luca Ceresoli
2021-12-14 22:42 ` [PATCH 1/2] PCI: dra7xx: Fix link removal on probe error Rob Herring
2021-12-16 9:08 ` Luca Ceresoli
2022-01-11 10:35 ` Luca Ceresoli
2022-01-15 16:02 ` Rob Herring [this message]
2022-05-11 16:41 ` Lorenzo Pieralisi
2022-05-12 14:07 ` Luca Ceresoli
2022-05-14 3:46 ` Saravana Kannan
2022-05-17 7:32 ` Luca Ceresoli
2022-05-19 20:25 ` Saravana Kannan
2022-05-23 13:28 ` Luca Ceresoli
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=CAL_JsqJ5nr6xJoTv3A6UPMMDXhWKcwSEUA3ux3kK8OMWQxdc6w@mail.gmail.com \
--to=robh@kernel.org \
--cc=bhelgaas@google.com \
--cc=dan.carpenter@oracle.com \
--cc=kishon@ti.com \
--cc=kw@linux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=luca@lucaceresoli.net \
--cc=nsekhar@ti.com \
--cc=saravanak@google.com \
/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).