From: Ioana Ciornei <ciorneiioana@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Ioana Ciornei <ciorneiioana@gmail.com>,
davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org,
laurentiu.tudor@nxp.com, Ioana Ciornei <ioana.ciornei@nxp.com>
Subject: Re: [PATCH 4/6] dpaa2-eth: retry the probe when the MAC is not yet discovered on the bus
Date: Thu, 7 Jan 2021 23:33:16 +0200 [thread overview]
Message-ID: <20210107213316.774mqzy5pclls44g@skbuf> (raw)
In-Reply-To: <X/d8FkhFsfnlp2hA@lunn.ch>
On Thu, Jan 07, 2021 at 10:24:38PM +0100, Andrew Lunn wrote:
> On Thu, Jan 07, 2021 at 05:36:36PM +0200, Ioana Ciornei wrote:
> > From: Ioana Ciornei <ioana.ciornei@nxp.com>
> >
> > The fsl_mc_get_endpoint() function now returns -EPROBE_DEFER when the
> > dpmac device was not yet discovered by the fsl-mc bus. When this
> > happens, pass the error code up so that we can retry the probe at a
> > later time.
> >
> > Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
> > ---
> > drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> > index f3f53e36aa00..3297e390476b 100644
> > --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> > +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
> > @@ -4042,6 +4042,10 @@ static int dpaa2_eth_connect_mac(struct dpaa2_eth_priv *priv)
> >
> > dpni_dev = to_fsl_mc_device(priv->net_dev->dev.parent);
> > dpmac_dev = fsl_mc_get_endpoint(dpni_dev);
> > +
> > + if (PTR_ERR(dpmac_dev) == -EPROBE_DEFER)
> > + return PTR_ERR(dpmac_dev);
> > +
> > if (IS_ERR_OR_NULL(dpmac_dev) || dpmac_dev->dev.type != &fsl_mc_bus_dpmac_type)
>
> Hi Ioana
>
> Given the previous change, i don't think dpmac_dev can be NULL, so you
> can change this to IS_ERR(). IS_ERR_OR_NULL() often triggers extra
> review work because it is easy to get it wrong, so removing it is nice.
>
Indeed, fsl_mc_get_endpoint() does no longer return NULL.
I'll change it to IS_ERR() in v2.
Thanks!
next prev parent reply other threads:[~2021-01-07 21:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-07 15:36 [PATCH 0/6] dpaa2-mac: various updates Ioana Ciornei
2021-01-07 15:36 ` [PATCH 1/6] dpaa2-mac: split up initializing the MAC object from connecting to it Ioana Ciornei
2021-01-07 15:36 ` [PATCH 2/6] dpaa2-mac: export MAC counters even when in TYPE_FIXED Ioana Ciornei
2021-01-07 15:36 ` [PATCH 3/6] bus: fsl-mc: return -EPROBE_DEFER when a device is not yet discovered Ioana Ciornei
2021-01-07 17:15 ` Laurentiu Tudor
2021-01-07 15:36 ` [PATCH 4/6] dpaa2-eth: retry the probe when the MAC is not yet discovered on the bus Ioana Ciornei
2021-01-07 21:24 ` Andrew Lunn
2021-01-07 21:33 ` Ioana Ciornei [this message]
2021-01-07 15:36 ` [PATCH 5/6] dpaa2-mac: remove an unnecessary check Ioana Ciornei
2021-01-07 15:36 ` [PATCH 6/6] dpaa2-mac: remove a comment regarding pause settings Ioana Ciornei
2021-01-07 21:26 ` Andrew Lunn
2021-01-07 21:37 ` Ioana Ciornei
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=20210107213316.774mqzy5pclls44g@skbuf \
--to=ciorneiioana@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=ioana.ciornei@nxp.com \
--cc=kuba@kernel.org \
--cc=laurentiu.tudor@nxp.com \
--cc=netdev@vger.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