From: Andrew Lunn <andrew@lunn.ch>
To: Ioana Ciornei <ciorneiioana@gmail.com>
Cc: 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 22:24:38 +0100 [thread overview]
Message-ID: <X/d8FkhFsfnlp2hA@lunn.ch> (raw)
In-Reply-To: <20210107153638.753942-5-ciorneiioana@gmail.com>
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.
Andrew
next prev parent reply other threads:[~2021-01-07 21:25 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 [this message]
2021-01-07 21:33 ` Ioana Ciornei
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=X/d8FkhFsfnlp2hA@lunn.ch \
--to=andrew@lunn.ch \
--cc=ciorneiioana@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.