From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2889CC433DB for ; Thu, 7 Jan 2021 21:25:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E2A8E23441 for ; Thu, 7 Jan 2021 21:25:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726929AbhAGVZX (ORCPT ); Thu, 7 Jan 2021 16:25:23 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:55828 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726437AbhAGVZW (ORCPT ); Thu, 7 Jan 2021 16:25:22 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kxclq-00Gkhr-4A; Thu, 07 Jan 2021 22:24:38 +0100 Date: Thu, 7 Jan 2021 22:24:38 +0100 From: Andrew Lunn To: Ioana Ciornei Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, laurentiu.tudor@nxp.com, Ioana Ciornei Subject: Re: [PATCH 4/6] dpaa2-eth: retry the probe when the MAC is not yet discovered on the bus Message-ID: References: <20210107153638.753942-1-ciorneiioana@gmail.com> <20210107153638.753942-5-ciorneiioana@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210107153638.753942-5-ciorneiioana@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Jan 07, 2021 at 05:36:36PM +0200, Ioana Ciornei wrote: > From: Ioana Ciornei > > 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 > --- > 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