netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: netdev@vger.kernel.org, David Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: Michal Schmidt <mschmidt@redhat.com>,
	Wojciech Drewek <wojciech.drewek@intel.com>,
	Jacob Keller <jacob.e.keller@intel.com>
Subject: [PATCH net-next 7/9] iavf: use unregister_netdev
Date: Mon, 23 Oct 2023 16:08:24 -0700	[thread overview]
Message-ID: <20231023230826.531858-9-jacob.e.keller@intel.com> (raw)
In-Reply-To: <20231023230826.531858-1-jacob.e.keller@intel.com>

From: Michal Schmidt <mschmidt@redhat.com>

Use unregister_netdev, which takes rtnl_lock for us. We don't have to
check the reg_state under rtnl_lock. There's nothing to race with. We
have just cancelled the finish_config work.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 6e93e73385b3..85252b9dce50 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -5166,10 +5166,8 @@ static void iavf_remove(struct pci_dev *pdev)
 	cancel_delayed_work_sync(&adapter->watchdog_task);
 	cancel_work_sync(&adapter->finish_config);
 
-	rtnl_lock();
 	if (netdev->reg_state == NETREG_REGISTERED)
-		unregister_netdevice(netdev);
-	rtnl_unlock();
+		unregister_netdev(netdev);
 
 	if (CLIENT_ALLOWED(adapter)) {
 		err = iavf_lan_del_device(adapter);
-- 
2.41.0


  parent reply	other threads:[~2023-10-23 23:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23 23:08 [PATCH net-next 0/9] Intel Wired LAN Driver Updates for 2023-10-23 (iavf) Jacob Keller
2023-10-23 23:08 ` [PATCH net-next 1/1] iavf: delete the iavf client interface Jacob Keller
2023-10-23 23:08 ` [PATCH net-next 1/9] iavf: fix comments about old bit locks Jacob Keller
2023-10-23 23:08 ` [PATCH net-next 2/9] iavf: simplify mutex_trylock+sleep loops Jacob Keller
2023-10-23 23:08 ` [PATCH net-next 3/9] iavf: in iavf_down, don't queue watchdog_task if comms failed Jacob Keller
2023-10-23 23:08 ` [PATCH net-next 4/9] iavf: in iavf_down, disable queues when removing the driver Jacob Keller
2023-10-24 23:42   ` Jakub Kicinski
2023-10-25 15:24     ` Michal Schmidt
2023-10-25 16:25       ` Jakub Kicinski
2023-10-25 17:23         ` Jacob Keller
2023-10-25 18:32           ` Jacob Keller
2023-10-23 23:08 ` [PATCH net-next 5/9] iavf: fix the waiting time for initial reset Jacob Keller
2023-10-23 23:08 ` [PATCH net-next 6/9] iavf: rely on netdev's own registered state Jacob Keller
2023-10-23 23:08 ` Jacob Keller [this message]
2023-10-24 23:44   ` [PATCH net-next 7/9] iavf: use unregister_netdev Jakub Kicinski
2023-10-23 23:08 ` [PATCH net-next 8/9] iavf: add a common function for undoing the interrupt scheme Jacob Keller
2023-10-23 23:08 ` [PATCH net-next 9/9] iavf: delete the iavf client interface Jacob Keller
2023-10-27 16:58 ` [PATCH net-next 0/9] Intel Wired LAN Driver Updates for 2023-10-23 (iavf) Jacob Keller
2023-10-27 17:41   ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231023230826.531858-9-jacob.e.keller@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=mschmidt@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=wojciech.drewek@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).