Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp393585imm; Wed, 29 Aug 2018 02:44:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZH3cN7/jmBkd1eePGFHbi1+Ln+yfKLdhF2q5LfR9VzKr+us96/xMOO4SyTiF1FQeTDTj0s X-Received: by 2002:a62:5f82:: with SMTP id t124-v6mr5136292pfb.223.1535535874139; Wed, 29 Aug 2018 02:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535535874; cv=none; d=google.com; s=arc-20160816; b=iXfz4qWemzQRqQSrfQUNhgs6Bn6BY9QhNaxx6yBu0a2m0BLZNzFQeP7viDi9tKo777 KvvxittKyte1FuSRn3M3PxScp0jOqlKtYlDqf948tU4iX/owNvP+NHxDYnMLcG4pKU9x NXJRl1QCtGRhnprXizKyc7dpfzSvu1S3kfZKcxnN/W+lRF1TQ7m4yfWFqGDyZncSaViI 3+1bnBnuJNyRyAPVhsREwXncwwV7MM33hXz0QqL6pyDC01eGfhdHKqWqm346A6EUGsyZ QNdCaXS741Bis9vjR9Y3bAaUVlWvhIF0w2TsLJQtPQGSdS+/NmsmCi1+DPDechqD52es e04w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=kcQpyyO9j0dbGfXZsgg/EFeDFwntfyDdVZEAUzQIEJ4=; b=mszTEMlS/pdvH+FOXlXFs1oyTVayitUIwUyyJb1QdWTzalUXw8HJNkC/D3RHug+4tF 0l4bz8fJVtwUgtNqJppcp0hTeM0v8+Y2sSf8zfa1cAZHg8dkTuANv8VpVZPU8YPqsvUV uXQvVquw36A0g85taDLaQRQ/5b67Z9nRmXvobmNczayJOuI/zNdsbur2oaEGYa/5s/+V Ve4kDvs9VhQpIbQLOh3lAm3V4Is9XBYjHATWcyRTRtZpMlb+32xiQ5/NLHn9CsbXOSFb lfP+HsGat5WfwOJdTxkiTktzP0KJGBULuQjhbWUgE+NwzX6tmIoGlZvc3hbKRL6tCsgm 14fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=wnGrC+Ds; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d191-v6si3408549pga.157.2018.08.29.02.44.19; Wed, 29 Aug 2018 02:44:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=wnGrC+Ds; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728030AbeH2NjP (ORCPT + 99 others); Wed, 29 Aug 2018 09:39:15 -0400 Received: from mail-eopbgr40056.outbound.protection.outlook.com ([40.107.4.56]:17666 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727264AbeH2NjP (ORCPT ); Wed, 29 Aug 2018 09:39:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kcQpyyO9j0dbGfXZsgg/EFeDFwntfyDdVZEAUzQIEJ4=; b=wnGrC+Ds+SciZgaQFnc95xRecuUgmdYv7r5Fq9ZKBANHMmqcgeGrPKdGoTV7RsLUvobPH6mqTzoPYRH0gTpNQtKkYRtoAOPAvlP+gD4Mt6f6jqscgDKnleS/rCe8SPn8r8sq9vE9njmyLNuQ24rz7X7uZOSliCXdiwZxqUVz554= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ruxandra.radulescu@nxp.com; Received: from rhuath.am.freescale.net (64.157.242.222) by AM3PR04MB337.eurprd04.prod.outlook.com (2a01:111:e400:881e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Wed, 29 Aug 2018 09:43:03 +0000 From: Ioana Radulescu To: netdev@vger.kernel.org, davem@davemloft.net Cc: gregkh@linuxfoundation.org, andrew@lunn.ch, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, ioana.ciornei@nxp.com, laurentiu.tudor@nxp.com, madalin.bucur@nxp.com, horia.geanta@nxp.com Subject: [PATCH net-next v2 1/2] staging: fsl-dpaa2/eth: Delay netdev_register() call Date: Wed, 29 Aug 2018 04:42:39 -0500 Message-Id: <20180829094240.27242-2-ruxandra.radulescu@nxp.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180829094240.27242-1-ruxandra.radulescu@nxp.com> References: <20180829094240.27242-1-ruxandra.radulescu@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [64.157.242.222] X-ClientProxiedBy: SN6PR1501CA0011.namprd15.prod.outlook.com (2603:10b6:805::24) To AM3PR04MB337.eurprd04.prod.outlook.com (2a01:111:e400:881e::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 82a6aadf-0019-49c6-bf00-08d60d93d240 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRV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A5i9VFqQ0U1z+Qu23mwyJhFbXFBRaLnt14f/nA+zN0rQOxEX9cWZb6cMnNye5PlQiAIfCOks/omxa4If7YazdwyE8kKkz+ving3OpeFT4DwC6lsi0Hmxew60+Ea/XuB07kqFBd/DCV391CxddPhsSTFzvlwaHZ+m8RRjnRXT9EDkyz4kR+tfzrDK9mPdTjW7hLT+XA40eL4dMN8Tnyo3jADByiLAyfx44Y7RbwnWZ/gSMvzxqKyg7UDwNi0K+k1+2ylEMFKpBuGIyEDyTTlgRglk8aRDT1hubL84+mBOuAw6EfEW/IU4MTPsLWOV7hcTpK6WzOmWbR/zSC1n5ANEtYMh6nXQbCVg8BMddBBZEgYG3pk9JiXPnaggYpdC9K9g5qjTi692sPnPdie;4:bD7uApoDbzwNP5Rl7Ss2ksD5NpDanRzk8BQjYXcZcOt7rt3Fw+ALdDyak5Syc9RI5/EzK6SF+tb+qtQ8vR39rPdsGNXAd2LzGTvdAAgvsbH51RNdk4QPo5V1EdRdY7hS7DLWKID3HnfWNzwACKXAI2kwx8vLlr9wik/oAgjKogYQTDwBxrJ8Vhv/23gFEo36OqCkMtazwA6I2rCCqMLuwQzANCQkxVCllbJNu4njcSeQpz2chdVxlSy/53eBWpGYGg+8Krq0Ekat1Nj8XR3IFYsIAOS36ylrKEZrkMYzSvsrM1/Yct+8wZ8eeS6+keHj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699016);SRVR:AM3PR04MB337;BCL:0;PCL:0;RULEID:;SRVR:AM3PR04MB337; X-Forefront-PRVS: 077929D941 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(396003)(366004)(346002)(376002)(39860400002)(136003)(189003)(199004)(25786009)(16526019)(16586007)(316002)(7736002)(186003)(50466002)(305945005)(86362001)(53936002)(66066001)(2906002)(47776003)(26005)(97736004)(106356001)(48376002)(478600001)(4326008)(51416003)(52116002)(105586002)(76176011)(6116002)(50226002)(3846002)(8936002)(68736007)(11346002)(486006)(476003)(2616005)(6486002)(81156014)(81166006)(1076002)(446003)(956004)(6666003)(5660300001)(386003)(6506007)(36756003)(8676002)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:AM3PR04MB337;H:rhuath.am.freescale.net;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM3PR04MB337;23:UDki2bckvq5WG5HGgohwyBAKdNFRI7OFn9+3kWAB+y?= =?us-ascii?Q?pk7qaDFrlr2L1RC60OaklUpfLYWVxzmYOQBHmF7oLIx1FZPRBWqNHQWnpH8g?= =?us-ascii?Q?fVILYkIMSJDLP9OJwl5DFGqei+bQbxxXATPikRxxUFJUE0OZhC9PPyVzjRX7?= =?us-ascii?Q?S5gjrBg6cVN2dVhCJjH0AA3wUddRu6A3T7udP5G4iV4FA8KW5wYCXpD0bdTl?= =?us-ascii?Q?KoptoOA+P9nY3BpczcoOmnw7lDQkBJdAgJWzmjg5g14ydsAGhM4ZBdnYr2LJ?= =?us-ascii?Q?oOLdUvXaUfvYkx/yU8XSq3R8HhxrJm9B08kUk3v8ov9db6mqfxtRFWhGrV7g?= =?us-ascii?Q?Az8MmwLhgNgZ8Xs46epqLUUTpNp7h4XFOiV7xGwtFB0hXx/YO3c3EbeAQLiR?= =?us-ascii?Q?lokJWKvsx94jNGz6Q5iXABGjipsp47Y7CdgI7fuBc4DGXsFd04LdXlSYPhA2?= =?us-ascii?Q?WeODQI1x+7UYZ++q/v7bu6r6m457pKHAURATVPzCce+loIpiY+TkplwuUbym?= =?us-ascii?Q?hjBYqkgREC+d0J9NHlQkYKENQ4RRXeA6ScyXgapfcFZqmBUIN7w2MJfkPn57?= =?us-ascii?Q?OAM38UCMaekmfFitwTs9CGxKiu+kGayzEiFxNefuHNm9DfbwD5+69AZducHs?= =?us-ascii?Q?Q2BIgTBWE4vk4FDi7+8tI2SNDL0sFzNDvQbyp+eJNSRulkp2qrv+86a8WKTm?= =?us-ascii?Q?4TXt4NcqV8U/lGi4d6zLsYNsZETUgRcmnTqlwGz7OZHxPpggsU4uDMpONhkd?= =?us-ascii?Q?qhk9r1+8Cb6W+TG75Caq9bWeUSCGzzidIWQHJfT+K2VEyXvZZGqHFmmuqq7h?= =?us-ascii?Q?uj/anFcQRtoabLCBnp5sdftyi2cxSKlpmud5RMZdWA0h9u9yUxl3emXV9dyJ?= =?us-ascii?Q?XGxgHGlrnR97pCSWKy8wxJ4PTXVv3cYy2MzNu8QtPxTppqPUx9tKCSgS+phN?= =?us-ascii?Q?3UPj5ya10HjWxaCsqjX9nvhCatD+4LmkiintiZWFYlvu2zE/rCiUGpnnOwoG?= =?us-ascii?Q?KnAZDoEn17FfdCNCQj+AeELXWzX3Mf53Uzw7cdO0O7ppaHV7DKyY7/qVBgqP?= =?us-ascii?Q?e2P10eDOGzOzDFeQGChTvXuCphVhhmN6Z+5nRMCQc80Y93sRSJieDH5ePO5n?= =?us-ascii?Q?sa29zirDeyU5fUDlH09hxVs/PjV53ly0TtvmKxXIe97W8su27HYA=3D=3D?= X-Microsoft-Antispam-Message-Info: I86rNodkeP1h5/b9F8bIpWJEcTSuYUL+IgWI7TCXCmZvPwEl8r9rksAxSv20LOYafEVyAafZRsDEFNtRS5txuleTweSbpPjI+ripte/AbQU2Vcvytr794egovuy6wv8iInh/wUeSJzUXE7S3u/GFKTeggxuAYynQZtJvTt8KrPioCQVBw/7Rc15wQCO3nPFMdEO0qbzOyGv0T7DjVZWk1ovC3YBr9lQd1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osticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2018 09:43:03.8471 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 82a6aadf-0019-49c6-bf00-08d60d93d240 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR04MB337 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only call netdev_register() at the end of the probe function, once all other necessary bits and pieces are properly initialized. We keep the rest of the netdevice initialization code in place, at the earlier point of the probing sequence, including the settings previously done in ndo_init. Signed-off-by: Ioana Radulescu Suggested-by: Andrew Lunn --- v2: new patch drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 71 ++++++++++++-------------- 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c index 9329fca..559154a 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c @@ -1143,34 +1143,6 @@ static int dpaa2_eth_stop(struct net_device *net_dev) return 0; } -static int dpaa2_eth_init(struct net_device *net_dev) -{ - u64 supported = 0; - u64 not_supported = 0; - struct dpaa2_eth_priv *priv = netdev_priv(net_dev); - u32 options = priv->dpni_attrs.options; - - /* Capabilities listing */ - supported |= IFF_LIVE_ADDR_CHANGE; - - if (options & DPNI_OPT_NO_MAC_FILTER) - not_supported |= IFF_UNICAST_FLT; - else - supported |= IFF_UNICAST_FLT; - - net_dev->priv_flags |= supported; - net_dev->priv_flags &= ~not_supported; - - /* Features */ - net_dev->features = NETIF_F_RXCSUM | - NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | - NETIF_F_SG | NETIF_F_HIGHDMA | - NETIF_F_LLTX; - net_dev->hw_features = net_dev->features; - - return 0; -} - static int dpaa2_eth_set_addr(struct net_device *net_dev, void *addr) { struct dpaa2_eth_priv *priv = netdev_priv(net_dev); @@ -1418,7 +1390,6 @@ static const struct net_device_ops dpaa2_eth_ops = { .ndo_open = dpaa2_eth_open, .ndo_start_xmit = dpaa2_eth_tx, .ndo_stop = dpaa2_eth_stop, - .ndo_init = dpaa2_eth_init, .ndo_set_mac_address = dpaa2_eth_set_addr, .ndo_get_stats64 = dpaa2_eth_get_stats, .ndo_set_rx_mode = dpaa2_eth_set_rx_mode, @@ -2316,11 +2287,14 @@ static int netdev_init(struct net_device *net_dev) { struct device *dev = net_dev->dev.parent; struct dpaa2_eth_priv *priv = netdev_priv(net_dev); + u32 options = priv->dpni_attrs.options; + u64 supported = 0, not_supported = 0; u8 bcast_addr[ETH_ALEN]; u8 num_queues; int err; net_dev->netdev_ops = &dpaa2_eth_ops; + net_dev->ethtool_ops = &dpaa2_ethtool_ops; err = set_mac_addr(priv); if (err) @@ -2356,12 +2330,23 @@ static int netdev_init(struct net_device *net_dev) return err; } - /* Our .ndo_init will be called herein */ - err = register_netdev(net_dev); - if (err < 0) { - dev_err(dev, "register_netdev() failed\n"); - return err; - } + /* Capabilities listing */ + supported |= IFF_LIVE_ADDR_CHANGE; + + if (options & DPNI_OPT_NO_MAC_FILTER) + not_supported |= IFF_UNICAST_FLT; + else + supported |= IFF_UNICAST_FLT; + + net_dev->priv_flags |= supported; + net_dev->priv_flags &= ~not_supported; + + /* Features */ + net_dev->features = NETIF_F_RXCSUM | + NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | + NETIF_F_SG | NETIF_F_HIGHDMA | + NETIF_F_LLTX; + net_dev->hw_features = net_dev->features; return 0; } @@ -2561,28 +2546,36 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev) if (err) goto err_alloc_rings; - net_dev->ethtool_ops = &dpaa2_ethtool_ops; - err = setup_irqs(dpni_dev); if (err) { netdev_warn(net_dev, "Failed to set link interrupt, fall back to polling\n"); priv->poll_thread = kthread_run(poll_link_state, priv, "%s_poll_link", net_dev->name); if (IS_ERR(priv->poll_thread)) { - netdev_err(net_dev, "Error starting polling thread\n"); + dev_err(dev, "Error starting polling thread\n"); goto err_poll_thread; } priv->do_link_poll = true; } + err = register_netdev(net_dev); + if (err < 0) { + dev_err(dev, "register_netdev() failed\n"); + goto err_netdev_reg; + } + dev_info(dev, "Probed interface %s\n", net_dev->name); return 0; +err_netdev_reg: + if (priv->do_link_poll) + kthread_stop(priv->poll_thread); + else + fsl_mc_free_irqs(dpni_dev); err_poll_thread: free_rings(priv); err_alloc_rings: err_csum: - unregister_netdev(net_dev); err_netdev_init: free_percpu(priv->percpu_extras); err_alloc_percpu_extras: -- 2.7.4