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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ABC90C433EF for ; Tue, 26 Apr 2022 14:05:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BVKka+/thk1Al9GkKaXZoiHQ0IfwlgmeuhJdxmXyJ/o=; b=l1uW5qex39WdHi H3qmQ20DJBG2rcZV6sNxzMylxCv+AIdV8Z3PTVh5bsGOpaxPE25JNbmFzTRcSDJV7a/EFEifA+imu akP303/P+5FqSm2BPFnXSZmXVDKfdWSRj1XWb4IuB9UundbKSZ0t0tLEVImCHxOMkR2K+7l0lO/2P tApIk//OtggH/VfENAQV+Fy2NRcAIhgr+XilIAigNF6nsMymOHjKM6l210B2sIJSOw3wiSaBovgYV yWND7zKItVRQioVZjjBSVHbFW7DlrNnnHAiFIimi8DQgzzmWq0f6sqUotBCOrxnh0wVtI4l3NwX/I o4XUpBvXrSJIdluSZvZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1njLnT-00Eqjx-4o; Tue, 26 Apr 2022 14:04:07 +0000 Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1njLiu-00EolQ-7T for linux-arm-kernel@lists.infradead.org; Tue, 26 Apr 2022 13:59:26 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220426_065924_605536_7057E56D X-CRM114-Status: GOOD ( 17.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel