Netdev List
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: Saeed Mahameed <saeedm@mellanox.com>,
	Leon Romanovsky <leonro@mellanox.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Cc: Parav Pandit <parav@mellanox.com>
Subject: [PATCH mlx5-next 04/11] net/mlx5: Make load_one() and unload_one() symmetric
Date: Mon, 29 Jul 2019 21:12:58 +0000	[thread overview]
Message-ID: <20190729211209.14772-5-saeedm@mellanox.com> (raw)
In-Reply-To: <20190729211209.14772-1-saeedm@mellanox.com>

From: Parav Pandit <parav@mellanox.com>

Currently mlx5_load_one() perform device registration using
mlx5_register_device(). But mlx5_unload_one() doesn't unregister.

Make them symmetric by doing device unregistration in
mlx5_unload_one().

Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index b15b27a497fc..fa0e991f1983 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -1217,8 +1217,10 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, bool cleanup)
 {
 	int err = 0;
 
-	if (cleanup)
+	if (cleanup) {
+		mlx5_unregister_device(dev);
 		mlx5_drain_health_wq(dev);
+	}
 
 	mutex_lock(&dev->intf_state_mutex);
 	if (!test_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state)) {
@@ -1369,7 +1371,6 @@ static void remove_one(struct pci_dev *pdev)
 
 	mlx5_crdump_disable(dev);
 	mlx5_devlink_unregister(devlink);
-	mlx5_unregister_device(dev);
 
 	if (mlx5_unload_one(dev, true)) {
 		mlx5_core_err(dev, "mlx5_unload_one failed\n");
-- 
2.21.0


  parent reply	other threads:[~2019-07-29 21:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29 21:12 [PATCH mlx5-next 00/11] Mellanox, mlx5-next updates 2019-07-29 Saeed Mahameed
2019-07-29 21:12 ` [PATCH mlx5-next 01/11] net/mlx5: Refactor and optimize flow counter bulk query Saeed Mahameed
2019-07-29 21:12 ` [PATCH mlx5-next 02/11] net/mlx5: Add flow counter bulk allocation hardware bits and command Saeed Mahameed
2019-07-29 21:12 ` [PATCH mlx5-next 03/11] net/mlx5: Fix offset of tisc bits reserved field Saeed Mahameed
2019-07-29 21:12 ` Saeed Mahameed [this message]
2019-07-29 21:13 ` [PATCH mlx5-next 05/11] net/mlx5: E-Switch, Verify support QoS element type Saeed Mahameed
2019-07-29 21:13 ` [PATCH mlx5-next 06/11] net/mlx5: E-switch, Combine metadata enable/disable functionality Saeed Mahameed
2019-07-29 21:13 ` [PATCH mlx5-next 07/11] net/mlx5: E-switch, Initialize TSAR Qos hardware block before its user vports Saeed Mahameed
2019-07-29 21:13 ` [PATCH mlx5-next 08/11] net/mlx5: E-switch, Introduce helper function to enable/disable vports Saeed Mahameed
2019-07-29 21:13 ` [PATCH mlx5-next 09/11] net/mlx5: E-Switch, remove redundant error handling Saeed Mahameed
2019-07-29 21:13 ` [PATCH mlx5-next 10/11] net/mlx5: E-Switch, Remove redundant mc_promisc NULL check Saeed Mahameed
2019-07-29 21:13 ` [PATCH mlx5-next 11/11] net/mlx5: E-switch, Tide up eswitch config sequence Saeed Mahameed
2019-08-01 18:23 ` [PATCH mlx5-next 00/11] Mellanox, mlx5-next updates 2019-07-29 Saeed Mahameed
2019-08-01 18:23 ` Saeed Mahameed

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=20190729211209.14772-5-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=parav@mellanox.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