[ofa-general] [PATCH for-2.6.27] RDMA/cxgb3: Fix regression from commit f4e91eb4a81559da87a3843758a641b5cc590b65.
Steve Wise
swise at opengridcomputing.com
Tue Jul 8 12:17:57 PDT 2008
From: Steve Wise <swise at opengridcomputing.com>
Roland,
Dunno if this is the correct fix or not based on the netdev discussion,
but this works. :)
Steve
---
RDMA/cxgb3: Fix regression from commit f4e91eb4a81559da87a3843758a641b5cc590b65.
The change to iwch_provider.c in commit
f4e91eb4a81559da87a3843758a641b5cc590b65 undid the fix done in commit
7f049f2f4259e4a5c213720df1ce0c2ca095641a. It removed the calls to
rtnl_lock() that serialized the iw_cxgb3 ethtool ops calls into the
cxgb3 driver.
Also, there were some more recent additions that call ethtool ops without
the rtnl_lock held.
Signed-off-by: Steve Wise <swise at opengridcomputing.com>
---
drivers/infiniband/hw/cxgb3/iwch_provider.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
index d54aace..c261c3c 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
@@ -1102,7 +1102,9 @@ static u64 fw_vers_string_to_u64(struct iwch_dev *iwch_dev)
char *cp, *next;
unsigned fw_maj, fw_min, fw_mic;
+ rtnl_lock();
lldev->ethtool_ops->get_drvinfo(lldev, &info);
+ rtnl_unlock();
next = info.fw_version + 1;
cp = strsep(&next, ".");
sscanf(cp, "%i", &fw_maj);
@@ -1190,7 +1192,9 @@ static int fw_supports_fastreg(struct iwch_dev *iwch_dev)
char *cp, *next;
unsigned fw_maj, fw_min;
+ rtnl_lock();
lldev->ethtool_ops->get_drvinfo(lldev, &info);
+ rtnl_unlock();
next = info.fw_version+1;
cp = strsep(&next, ".");
sscanf(cp, "%i", &fw_maj);
@@ -1208,7 +1212,9 @@ static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr, ch
struct net_device *lldev = iwch_dev->rdev.t3cdev_p->lldev;
PDBG("%s dev 0x%p\n", __func__, dev);
+ rtnl_lock();
lldev->ethtool_ops->get_drvinfo(lldev, &info);
+ rtnl_unlock();
return sprintf(buf, "%s\n", info.fw_version);
}
@@ -1221,7 +1227,9 @@ static ssize_t show_hca(struct device *dev, struct device_attribute *attr,
struct net_device *lldev = iwch_dev->rdev.t3cdev_p->lldev;
PDBG("%s dev 0x%p\n", __func__, dev);
+ rtnl_lock();
lldev->ethtool_ops->get_drvinfo(lldev, &info);
+ rtnl_unlock();
return sprintf(buf, "%s\n", info.driver);
}
More information about the general
mailing list