[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMhs-H8beY3AO83NkTM2_YYdcsqtv7Em01zqSE6wtPNdex8Dpw@mail.gmail.com>
Date: Mon, 3 Apr 2023 09:12:08 +0200
From: Sergio Paracuellos <sergio.paracuellos@...il.com>
To: Dan Carpenter <error27@...il.com>
Cc: ye.xingchen@....com.cn, lpieralisi@...nel.org, kw@...ux.com,
robh@...nel.org, bhelgaas@...gle.com, matthias.bgg@...il.com,
angelogioacchino.delregno@...labora.com, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] PCI: mt7621: Use dev_err_probe()
On Mon, Apr 3, 2023 at 6:50 AM Dan Carpenter <error27@...il.com> wrote:
>
> On Thu, Mar 23, 2023 at 07:23:26AM +0100, Sergio Paracuellos wrote:
> > Hi,
> >
> > On Thu, Mar 23, 2023 at 4:45 AM <ye.xingchen@....com.cn> wrote:
> > >
> > > From: Ye Xingchen <ye.xingchen@....com.cn>
> > >
> > > Replace the open-code with dev_err_probe() to simplify the code.
> > >
> > > Signed-off-by: Ye Xingchen <ye.xingchen@....com.cn>
> > > ---
> > > drivers/pci/controller/pcie-mt7621.c | 7 +++----
> > > 1 file changed, 3 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/pci/controller/pcie-mt7621.c b/drivers/pci/controller/pcie-mt7621.c
> > > index 63a5f4463a9f..964de0e8c6a0 100644
> > > --- a/drivers/pci/controller/pcie-mt7621.c
> > > +++ b/drivers/pci/controller/pcie-mt7621.c
> > > @@ -220,10 +220,9 @@ static int mt7621_pcie_parse_port(struct mt7621_pcie *pcie,
> > > }
> > >
> > > port->pcie_rst = of_reset_control_get_exclusive(node, NULL);
> > > - if (PTR_ERR(port->pcie_rst) == -EPROBE_DEFER) {
>
> So the theory here is that -EPROBE_DEFER is recoverable but other errors
> are not so we just ignore them? Error pointers will trigger a WARN() in
> mt7621_control_assert/deassert().
>
>
> > > --
> > > 2.25.1
> >
> > Also, this is not a probe(), so I don't see a point of using
> > dev_err_probe() here.
>
> It's a weird thing to return -EPROBE_DEFER from something which is not
> a probe function... Someone told me I should write a Smatch check for
> it but I never got around to doing that.
I don't remember clearly why this was returned in the first instance.
I think I just took the idea from pcie-mediatek driver for arm64 SoCs
platforms here:
https://elixir.bootlin.com/linux/v6.3-rc5/source/drivers/pci/controller/pcie-mediatek.c#L967
Thanks,
Sergio Paracuellos
>
> In this case, I guess the user is supposed to see the error message and
> manually fix the probe order? The dev_err_probe() will change the error
> message into a debug message so the user will not see it and will not be
> able to fix it. So using dev_err_probe() will break things for the
> user.
>
> regards,
> dan carpenter
>
Powered by blists - more mailing lists