login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-netdev
»
2008
»
November
»
6
Re: [PATCH 2.6.28] RDMA/cxgb3: deadlock in iw_cxgb3 can cause hang when configuring interface.
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Divy Le Ray
Subject:
Re: [PATCH 2.6.28] RDMA/cxgb3: deadlock in iw_cxgb3 can cause hang when configuring interface.
Date: Thursday, November 6, 2008 - 4:27 pm
Steve Wise wrote:
quoted text
> From: Steve Wise <swise@opengridcomputing.com> > > When the iw_cxgb3 module's cxgb3_client "add" func gets called by the > cxgb3 module, the iwarp driver ends up calling the ethtool ops get_drvinfo > function in cxgb3 to get the fw version and other info. Currently the > iwarp driver grabs the rtnl lock around this down call to serialize. > As of 2.6.27 or so, things changed such that the rtnl lock is held around > the call to the netdev driver open function. Also the cxgb3_client "add" > function doesn't get called if the device is down. > > So, if you load cxgb3, then load iw_cxgb3, then ifconfig up the device, > the iw_cxgb3 add func gets called with the rtnl_lock held. If you > load cxgb3, ifconfig up the device, then load iw_cxgb3, the add func > gets called without the rtnl_lock held. The former causes the deadlock, > the latter does not. > > In addition, there are iw_cxgb3 sysfs handlers that also can call > down into cxgb3 to gather the fw and hw versions. These can be called > concurrently on different processors and at any time. Thus we need to > push this serialization down in the cxgb3 driver get_drvinfo func. > > The fix is to remove rtnl lock usage, and use a per-device lock in cxgb3. > > Signed-off-by: Steve Wise <swise@opengridcomputing.com> >
Acked-by: Divy Le Ray <divy@chelsio.com>
quoted text
> --- > > drivers/infiniband/hw/cxgb3/iwch_provider.c | 6 ------ > drivers/net/cxgb3/cxgb3_main.c | 2 ++ > 2 files changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c > index ecff980..160ef48 100644 > --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c > +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c > @@ -1102,9 +1102,7 @@ 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, "."); > @@ -1192,9 +1190,7 @@ 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); > } > > @@ -1207,9 +1203,7 @@ 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); > } > > diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c > index 1ace41a..5e663cc 100644 > --- a/drivers/net/cxgb3/cxgb3_main.c > +++ b/drivers/net/cxgb3/cxgb3_main.c > @@ -1307,8 +1307,10 @@ static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) > u32 fw_vers = 0; > u32 tp_vers = 0; > > + spin_lock(&adapter->stats_lock); > t3_get_fw_version(adapter, &fw_vers); > t3_get_tp_version(adapter, &tp_vers); > + spin_unlock(&adapter->stats_lock); > > strcpy(info->driver, DRV_NAME); > strcpy(info->version, DRV_VERSION); >
-- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 2.6.28] RDMA/cxgb3: deadlock in iw_cxgb3 can cause ...
, Steve Wise
, (Thu Nov 6, 4:06 pm)
Re: [PATCH 2.6.28] RDMA/cxgb3: deadlock in iw_cxgb3 can ca ...
, Divy Le Ray
, (Thu Nov 6, 4:27 pm)
Re: [PATCH 2.6.28] RDMA/cxgb3: deadlock in iw_cxgb3 can ca ...
, Roland Dreier
, (Wed Nov 12, 11:20 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Michael Trimarchi
Re: [PATCH] VFS: make file->f_pos access atomic on 32bit arch
Miklos Szeredi
[patch 14/15] vfs: more path_permission() conversions
Serge E. Hallyn
Re: [RFC v5][PATCH 7/8] Infrastructure for shared objects
Bernd Schmidt
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Takashi Iwai
[PATCH 2/2] input: Add LED support to Synaptics device
git
:
Junio C Hamano
Re: mingw, windows, crlf/lf, and git
Eyvind Bernhardsen
Re: Where has "git ls-remote" reference pattern matching gone?
Shawn O. Pearce
Re: Switching from CVS to GIT
Todd Zullinger
Re: [PATCH 2/2] send-email: rfc2047-quote subject lines with non-ascii characters
Santi Béjar
Re: How to use git-fmt-merge-msg?
linux-netdev
:
Ramkrishna Vepa
[net-2.6 PATCH 1/10] Neterion: New driver: Driver help file
Mark Anthony
invitation / inquiry
Ingo Molnar
Re: [PATCH 08/16] dma-debug: add core checking functions
David Miller
Re: [PATCH 1/3] f_phonet: dev_kfree_skb instead of dev_kfree_skb_any in TX callback
Sascha Hauer
[PATCH 03/12] fec: do not typedef struct types
git-commits-head
:
Linux Kernel Mailing List
amba: struct device - replace bus_id with dev_name(), dev_set_name()
Linux Kernel Mailing List
MIPS: Yosemite: Convert SMP startup lock to arch spinlock.
Linux Kernel Mailing List
ARM: S5PC100: IRQ and timer
Linux Kernel Mailing List
davinci: edma: clear interrupt status for interrupt enabled channels only
Linux Kernel Mailing List
x86, mm, kprobes: fault.c, simplify notify_page_fault()
openbsd-misc
:
Daniel A. Ramaley
Re: [semi-OT] Can anyone recommend an OpenBSD-compatible colour laser printer?
Matthias Kilian
Re: can't get vesa @ 1280x800 or nv
Tobias Ulmer
Re: Problem after upgrade 4.5 to 4.6: ERR M
Philip Guenther
Re: SIGCHLD and libpthread.so
J.C. Roberts
Re: [semi-OT] Can anyone recommend an OpenBSD-compatible colour laser printer?
Colocation donated by:
Syndicate