Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2329736pxb; Sat, 25 Sep 2021 04:27:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjOg77o/OIu0oEDu43GujECACbSRMp+8pTJl/5LC2Esrs4eeJ0j0NWd7z0ZTTmC5JxdnWk X-Received: by 2002:a50:e1c3:: with SMTP id m3mr10824545edl.28.1632569274337; Sat, 25 Sep 2021 04:27:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632569274; cv=none; d=google.com; s=arc-20160816; b=s6oE6UzFCNJxly9yIkEcuIwWH8smchfCul7uFbFIHLB82DMZwxOrpuFjlAm5BbIQSn joSCQwRYfvQSQRZzkXqB3meejwh9AzZQRxeathxLuZtf/ArdsuEwJ9lZ3QRjNrKVY8aJ dQqRSNLDFX5LxK0E8J9+oDjzLNvuLcHTnLcRaE2QjxjC0mTP3kntxiTT0KzhiRWIAKG9 vxdu12ownpNwhWZRE9zgRP0Frnof/7XzKn0Nqw3BER44DlqdaFbHXkA/sZWsEmeNmgr9 9bx1v17nkc7RpqdTclE9TaIZXBuhsa6fgFpEXMJphh2VCEUzyaUobdgxXoHkOgnp/yEm qONw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oRaau8Q7OK34Ze55oGm5aeeq71/hGl5cmz7sU5CQy9o=; b=jl+ARicyW4gC0wgvQYqwsZQbx1FxKJfxYSUmG5Wm9slyKIP7Rrb4ioO9Ibup1Cscb7 0wR3op3KHZ7mlqiQ1N3mnrdw8sURK8X83E7t3jcdcviNwqyv7EtgoEvhRAbuU8GQoXPy m0PRY0iF7ZGPD31ooilMituN9+GNCbiCoe8Cwdy62XUSaBDiHegD6x9jI6jK4yfQJ8We znhYQwAGv+OcZvWHvfAo17EoNmCYaXX5tvuq6RiRLgj1AZz2IvPQ7JuVNxo8bNqziEYX 3uSmekflKMCUgRG7cSCY8TlznXq+j9VoB3Y14BdprKK6y/m9bRBpWLWgQ9l5ta8ImpsP uHFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ssn8r6T5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p12si15987424ejy.328.2021.09.25.04.27.31; Sat, 25 Sep 2021 04:27:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ssn8r6T5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245385AbhIYLZ2 (ORCPT + 99 others); Sat, 25 Sep 2021 07:25:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:56160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244871AbhIYLZI (ORCPT ); Sat, 25 Sep 2021 07:25:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 17AC6610F7; Sat, 25 Sep 2021 11:23:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632569014; bh=l4ubO1iNO/eKHGDuYjGRafB4EwpXo5nxoxsjU5XAGKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ssn8r6T5ipfBUV1Bjq6AnhfL44IZyOMHmXeWU6/9hH1lTVCmQSiosocc/kJUbkg7Y 2ibqp53ysp4VfOvt0pQcVBcLBGi1uwBdc2dShLgM8OithU5F704lKTB7QVpgQDEKjC xmoGjPqQuCIbs+A8gi2Xn5lorLDn3A7B3youjreW56czvxw13U73pZkmuVqZ04sCkz ypZ5JISMkGCifzna5/Lo6ceMPQIjL0Wz/NZvKz7rozYwHq/LYCRWlYsOvw9BeKhkIu yaZ08tgzL9k1IR8iSCJU4gK9wHDjHmylgObF4TNSoK+AUmkpzkf0/PSGQeyQ4+p2pj 19gPtbN90X9aw== From: Leon Romanovsky To: "David S . Miller" , Jakub Kicinski Cc: Leon Romanovsky , Alexandre Belloni , Andrew Lunn , Ariel Elior , Bin Luo , Claudiu Manoil , Coiby Xu , Derek Chickles , drivers@pensando.io, Felix Manlunas , Florian Fainelli , Geetha sowjanya , Greg Kroah-Hartman , GR-everest-linux-l2@marvell.com, GR-Linux-NIC-Dev@marvell.com, hariprasad , Ido Schimmel , Intel Corporation , intel-wired-lan@lists.osuosl.org, Ioana Ciornei , Jerin Jacob , Jesse Brandeburg , Jiri Pirko , Jonathan Lemon , Linu Cherian , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-rdma@vger.kernel.org, linux-staging@lists.linux.dev, Loic Poulain , Manish Chopra , M Chetan Kumar , Michael Chan , Michael Guralnik , netdev@vger.kernel.org, oss-drivers@corigine.com, Richard Cochran , Saeed Mahameed , Satanand Burla , Sergey Ryazanov , Shannon Nelson , Simon Horman , Subbaraya Sundeep , Sunil Goutham , Taras Chornyi , Tariq Toukan , Tony Nguyen , UNGLinuxDriver@microchip.com, Vadym Kochan , Vivien Didelot , Vladimir Oltean Subject: [PATCH net-next v1 06/21] ice: Open devlink when device is ready Date: Sat, 25 Sep 2021 14:22:46 +0300 Message-Id: <23884bb7be2cc08ae00c551a6bb7d200a75b5117.1632565508.git.leonro@nvidia.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Leon Romanovsky Move devlink_registration routine to be the last command, when the device is fully initialized. Signed-off-by: Leon Romanovsky --- drivers/net/ethernet/intel/ice/ice_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index aacc0b345bbe..627adf8fb89d 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -4258,8 +4258,6 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent) pf->msg_enable = netif_msg_init(debug, ICE_DFLT_NETIF_M); - ice_devlink_register(pf); - #ifndef CONFIG_DYNAMIC_DEBUG if (debug < -1) hw->debug_mask = debug; @@ -4493,6 +4491,7 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent) dev_warn(dev, "RDMA is not supported on this device\n"); } + ice_devlink_register(pf); return 0; err_init_aux_unroll: @@ -4516,7 +4515,6 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent) ice_devlink_destroy_regions(pf); ice_deinit_hw(hw); err_exit_unroll: - ice_devlink_unregister(pf); pci_disable_pcie_error_reporting(pdev); pci_disable_device(pdev); return err; @@ -4593,6 +4591,7 @@ static void ice_remove(struct pci_dev *pdev) struct ice_pf *pf = pci_get_drvdata(pdev); int i; + ice_devlink_unregister(pf); for (i = 0; i < ICE_MAX_RESET_WAIT; i++) { if (!ice_is_reset_in_progress(pf->state)) break; @@ -4629,7 +4628,6 @@ static void ice_remove(struct pci_dev *pdev) ice_deinit_pf(pf); ice_devlink_destroy_regions(pf); ice_deinit_hw(&pf->hw); - ice_devlink_unregister(pf); /* Issue a PFR as part of the prescribed driver unload flow. Do not * do it via ice_schedule_reset() since there is no need to rebuild -- 2.31.1