[ofa-general] [PATCH] ipoib: take rtnl_lock when calling ipoib_open
Yossi Etigin
yosefe at Voltaire.COM
Sun Oct 19 06:17:58 PDT 2008
ipoib_open() has to be called with rtnl_lock. First, it calls dev_change_flags()
which needs rtnl_lock, and second, it needs to sync with ipoib_stop().
Signed-off-by: Yossi Etigin <yosefe at voltaire.com>
--
It will not deadlock because we don't flush ipoib_workqueue with rtnl_lock taken.
Index: b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
===================================================================
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c 2008-10-17 17:29:51.000000000 +0200
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c 2008-10-19 14:17:12.000000000 +0200
@@ -1045,9 +1045,11 @@ void ipoib_pkey_poll(struct work_struct
ipoib_pkey_dev_check_presence(dev);
- if (test_bit(IPOIB_PKEY_ASSIGNED, &priv->flags))
+ if (test_bit(IPOIB_PKEY_ASSIGNED, &priv->flags)) {
+ rtnl_lock();
ipoib_open(dev);
- else {
+ rtnl_unlock();
+ } else {
mutex_lock(&pkey_mutex);
if (!test_bit(IPOIB_PKEY_STOP, &priv->flags))
More information about the general
mailing list