From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: netdev@vger.kernel.org
Cc: jesse@kernel.org, Eugenia Emantayev <eugenia@mellanox.com>
Subject: [PATCH net-next v5 02/10] mlx4: add rtnl lock protection in mlx4_en_restart
Date: Mon, 11 Jan 2016 13:17:23 +0100 [thread overview]
Message-ID: <1452514651-15445-3-git-send-email-hannes@stressinduktion.org> (raw)
In-Reply-To: <1452514651-15445-1-git-send-email-hannes@stressinduktion.org>
I don't really understand the use of the state_lock. Can't it be simply
replaced by rtnl_lock? It seems a lot of current users depend on
rtnl_lock anyway.
Anyway, fix this up for the moment.
Cc: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 0c7e3f69a73bb6..94abd0843901cf 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1846,6 +1846,7 @@ static void mlx4_en_restart(struct work_struct *work)
en_dbg(DRV, priv, "Watchdog task called for port %d\n", priv->port);
+ rtnl_lock();
mutex_lock(&mdev->state_lock);
if (priv->port_up) {
mlx4_en_stop_port(dev, 1);
@@ -1853,6 +1854,7 @@ static void mlx4_en_restart(struct work_struct *work)
en_err(priv, "Failed restarting port %d\n", priv->port);
}
mutex_unlock(&mdev->state_lock);
+ rtnl_unlock();
}
static void mlx4_en_clear_stats(struct net_device *dev)
--
2.5.0
next prev parent reply other threads:[~2016-01-11 12:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-11 12:17 [PATCH net-next v5 00/10] net: break dependency of drivers on geneve and vxlan Hannes Frederic Sowa
2016-01-11 12:17 ` [PATCH net-next v5 01/10] qlcnic: protect qlcnic_82xx_io_slot_reset with rtnl lock Hannes Frederic Sowa
2016-01-11 12:17 ` Hannes Frederic Sowa [this message]
2016-01-11 12:17 ` [PATCH net-next v5 03/10] ixgbe: add rtnl locking in service task around vxlan_get_rx_port Hannes Frederic Sowa
2016-01-11 12:17 ` [PATCH net-next v5 04/10] benet: add rtnl lock protection around be_open in be_resume Hannes Frederic Sowa
2016-01-11 12:17 ` [PATCH net-next v5 05/10] fm10k: add rtnl lock protection in fm10k_io_resume Hannes Frederic Sowa
2016-01-11 12:17 ` [PATCH net-next v5 06/10] netdev: add netdevice notifier type to trigger a reprogramming of offloads Hannes Frederic Sowa
2016-01-11 12:17 ` [PATCH net-next v5 07/10] vxlan: break dependency to network drivers Hannes Frederic Sowa
2016-01-11 12:17 ` [PATCH net-next v5 08/10] geneve: " Hannes Frederic Sowa
2016-01-11 12:17 ` [PATCH net-next v5 09/10] net: harmonize vxlan_get_rx_port and geneve_get_rx_port to netdev_refresh_offloads Hannes Frederic Sowa
2016-01-11 12:17 ` [PATCH net-next v5 10/10] netdev: update comments and explain idempotency and rtnl locking Hannes Frederic Sowa
2016-01-12 21:33 ` [PATCH net-next v5 00/10] net: break dependency of drivers on geneve and vxlan David Miller
2016-01-12 22:17 ` Hannes Frederic Sowa
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=1452514651-15445-3-git-send-email-hannes@stressinduktion.org \
--to=hannes@stressinduktion.org \
--cc=eugenia@mellanox.com \
--cc=jesse@kernel.org \
--cc=netdev@vger.kernel.org \
/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).