Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3641659ioa; Tue, 26 Apr 2022 07:24:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhssgzDomm4AZoKGsXBD+HVtS9NFhbZDhYbJrdsUOo97CCXM6LCLK6USiISva8329u2S1g X-Received: by 2002:a17:906:9c82:b0:6e1:1d6c:914c with SMTP id fj2-20020a1709069c8200b006e11d6c914cmr20864535ejc.769.1650983048040; Tue, 26 Apr 2022 07:24:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650983048; cv=none; d=google.com; s=arc-20160816; b=srNJoeF8DkYUpE6o/igz7FmlB4eKXxX2oKV6b+qjYtKz5Ri1wuLbHzmKQ406DxoxhD bqrKh+UdwxQyrju3Vc/9CD80BAhjEx37lOIHBrhNzN2cWUqL43u6AWb2HYq0Rs1IlQYc 9toR7waqyOJVvo3G3zKXahQuy5wZWS51Txe8dN5FxpjKtKUdD41TPrtVNWMwi3Xaaf2J soYFLIZoiITF7217dxv4qkbAseDi6kY6J7leqxnI+nqj4kH9osk0A5SltyFYJa1uXaLI Z4NLXtwVgYsTqTEcmo534VcQc3LVlX+WaGvUEonkUV2AHO9bG9qaTSOMroxXE0umsVio cRwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=GTsEdXn491qPq9CntZ0vXSrj34SAbeJiBaBwaTF2/pU=; b=p78j8SubLAR2YEmjjFANjjv7taL6Ea03SLn10EkFjqf8kTCiO1PN5UlGR3WgFNYZvg Y4QbIQ4exOA4wrm+DFwOrTqCO07mVGsVPYt2kaGblj2PhGcW+/tyjE3DwQwedakI4FYF TAeqQSLqvikkI0wv3/DJLw7qVtPwLffxbZ0TWc8XbhDhPof3CIO7kxhDlzTXN9VRl6A/ Z3gTnBMgnEvYv41q7Zgec7kMfTCKllz/lQnvVbuWYKQwd3+1K/zg3NcqjMO/XoWeKSNA WrTSD6VDphIBd2hb2mQJeYX1Zh+e/WGBkkpEOkYGOcnnYVjE21r8o1iT4JzmukKb+e5P kF9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=pEbSVKbl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f13-20020a0564021e8d00b0042600135621si882448edf.546.2022.04.26.07.23.40; Tue, 26 Apr 2022 07:24:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=pEbSVKbl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351430AbiDZOGL (ORCPT + 99 others); Tue, 26 Apr 2022 10:06:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351411AbiDZOGD (ORCPT ); Tue, 26 Apr 2022 10:06:03 -0400 Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 308AF194B3B; Tue, 26 Apr 2022 07:02:54 -0700 (PDT) Received: from relay4-d.mail.gandi.net (unknown [IPv6:2001:4b98:dc4:8::224]) by mslow1.mail.gandi.net (Postfix) with ESMTP id A5F24CCCE7; Tue, 26 Apr 2022 13:59:27 +0000 (UTC) Received: (Authenticated sender: maxime.chevallier@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id B1127E0005; Tue, 26 Apr 2022 13:59:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1650981560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GTsEdXn491qPq9CntZ0vXSrj34SAbeJiBaBwaTF2/pU=; b=pEbSVKbl1mUCAPjU5O2M4QD9ktkNY1MhXV702GU3++Yr3XYy4/bv1zL6bBvV4PMxLagnW4 /t0ra18CveutBw25GWFoPLqVkQr5soc1LpqMm4hjAunhaYTekh2qF92DcIP6Re2iaosXvi NOzWesBoHBw4ez/2huWOJtg2E1dao0u6k4dC5XoB2bWEsKkBOYYEGus/dzukssvJnGQkdk EX2Thw4tV80V7SR22wae7ZRuMxTHq9NDOe2zH0Tg96r9+G9zYqQ/spU4kkSkRPEtxziaUE WRCRK3sYI2qaVnrvpCDmyist5DKFswrbyeRhkpDEmnajIbYsqhwImCuG0SAqvQ== Date: Tue, 26 Apr 2022 15:59:18 +0200 From: Maxime Chevallier To: Andrew Lunn Cc: davem@davemloft.net, Rob Herring , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, thomas.petazzoni@bootlin.com, Florian Fainelli , Heiner Kallweit , Russell King , linux-arm-kernel@lists.infradead.org, Vladimir Oltean , Luka Perkov , Robert Marko Subject: Re: [PATCH net-next 1/5] net: ipqess: introduce the Qualcomm IPQESS driver Message-ID: <20220426155918.4baeafd8@pc-19.home> In-Reply-To: References: <20220422180305.301882-1-maxime.chevallier@bootlin.com> <20220422180305.301882-2-maxime.chevallier@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Andrew, On Fri, 22 Apr 2022 22:19:43 +0200 Andrew Lunn wrote: Thanks for the review :) > > +static int ipqess_axi_probe(struct platform_device *pdev) > > +{ > > + struct device_node *np = pdev->dev.of_node; > > + struct net_device *netdev; > > + phy_interface_t phy_mode; > > + struct resource *res; > > + struct ipqess *ess; > > + int i, err = 0; > > + > > + netdev = devm_alloc_etherdev_mqs(&pdev->dev, sizeof(struct > > ipqess), > > + IPQESS_NETDEV_QUEUES, > > + IPQESS_NETDEV_QUEUES); > > + if (!netdev) > > + return -ENOMEM; > > + > > + ess = netdev_priv(netdev); > > + ess->netdev = netdev; > > + ess->pdev = pdev; > > + spin_lock_init(&ess->stats_lock); > > + SET_NETDEV_DEV(netdev, &pdev->dev); > > + platform_set_drvdata(pdev, netdev); > > .... > > > + > > + ipqess_set_ethtool_ops(netdev); > > + > > + err = register_netdev(netdev); > > + if (err) > > + goto err_out; > > Before register_netdev() even returns, your devices can be in use, the > open callback called and packets sent. This is particularly true for > NFS root. Which means any setup done after this is probably wrong. Nice catch, thank you ! > > + > > + err = ipqess_hw_init(ess); > > + if (err) > > + goto err_out; > > + > > + for (i = 0; i < IPQESS_NETDEV_QUEUES; i++) { > > + int qid; > > + > > + netif_tx_napi_add(netdev, &ess->tx_ring[i].napi_tx, > > + ipqess_tx_napi, 64); > > + netif_napi_add(netdev, > > + &ess->rx_ring[i].napi_rx, > > + ipqess_rx_napi, 64); > > + > > + qid = ess->tx_ring[i].idx; > > + err = devm_request_irq(&ess->netdev->dev, > > ess->tx_irq[qid], > > + ipqess_interrupt_tx, 0, > > + ess->tx_irq_names[qid], > > + &ess->tx_ring[i]); > > + if (err) > > + goto err_out; > > + > > + qid = ess->rx_ring[i].idx; > > + err = devm_request_irq(&ess->netdev->dev, > > ess->rx_irq[qid], > > + ipqess_interrupt_rx, 0, > > + ess->rx_irq_names[qid], > > + &ess->rx_ring[i]); > > + if (err) > > + goto err_out; > > + } > > All this should probably go before netdev_register(). I'll fix this for V2. > > +static int ipqess_get_strset_count(struct net_device *netdev, int > > sset) +{ > > + switch (sset) { > > + case ETH_SS_STATS: > > + return ARRAY_SIZE(ipqess_stats); > > + default: > > + netdev_dbg(netdev, "%s: Invalid string set", > > __func__); > > Unsupported would be better than invalid. That's right, thanks > > + return -EOPNOTSUPP; > > + } > > +} > > Andrew Best Regards, Maxime