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 732EFC433EF for ; Fri, 22 Apr 2022 20:21:11 +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:In-Reply-To:MIME-Version:References: 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=mDofnc+OANUb2PwfsDsd3vH+vOFqBzLFhKvmmyE9CWU=; b=3QGChFTDTQ8oC+ OwIHTRUtaNhZ1YvfAyQInV7fIrF2r50+ZOnbQ0XFOV/pnEmNdZxUoqj5+j4agqC/GJkmw8gdsRyTZ 8efS8X2wztIFPkaM+MIz+jAwup2bJR/jVgKqk6aSi31i0pE0f4TzP2xYzs4p/nWwYi5nvR+MjFHD4 Nzom/UU8N2jUkKtr9xOK4bLLmJfS2poc8GL87BeAx+KGGdkPJkMUBk+OV/MIq+7v0DDxwVX4BxADa NHdqzCfahJqF8wdPF2+nuuf1UF+Y9TBWrFE1UXziDN6rJ96Jri5+fx5+OEDce4ShooalhLvZL8nVi l98tC7Fdz4nKmcy7vtUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhzl6-002Dy5-VH; Fri, 22 Apr 2022 20:20:05 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhzl3-002Dwv-S2 for linux-arm-kernel@lists.infradead.org; Fri, 22 Apr 2022 20:20:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=IJ9Mu/aUYM3vuD5oQcui/J0/WhPDdyFZPtdQU+Ga/QI=; b=T1tOkSyynfaYwEC/xaB+p6az3Z XtQ2o1NqRu4SayBGALcPLXyZykVvU5An2x8p6KxswgnsA7y9ZqXOckyg10qAdYaxD1v/tTnx308tr 3W0frA8HsyBxGGYZJ3dC1060Ed0pognN1wfkuOy5+1/JWKY9TF19h+gO4BQyUbykPAwM=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nhzkl-00H2Uf-Si; Fri, 22 Apr 2022 22:19:43 +0200 Date: Fri, 22 Apr 2022 22:19:43 +0200 From: Andrew Lunn To: Maxime Chevallier 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: References: <20220422180305.301882-1-maxime.chevallier@bootlin.com> <20220422180305.301882-2-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220422180305.301882-2-maxime.chevallier@bootlin.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220422_132001_952578_C4D3BD89 X-CRM114-Status: GOOD ( 12.96 ) 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 > +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. > + > + 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(). > +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. > + return -EOPNOTSUPP; > + } > +} Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel