linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [Bugme-new] [Bug 13312] New: at76c50x-usb mutex deadlock
       [not found] <bug-13312-10286@http.bugzilla.kernel.org/>
@ 2009-05-28  7:49 ` Andrew Morton
  2009-05-28  9:45   ` [PATCH] at76c50x-usb: avoid mutex deadlock in at76_dwork_hw_scan John W. Linville
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2009-05-28  7:49 UTC (permalink / raw)
  To: linux-wireless
  Cc: bugzilla-daemon, bugme-daemon, Kalle Valo, Jason Andryuk,
	Johannes Berg, karllinuxtest.relton


(switched to email.  Please respond via emailed reply-to-all, not via the
bugzilla web interface).

On Thu, 14 May 2009 20:54:54 GMT bugzilla-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=13312
> 
>            Summary: at76c50x-usb mutex deadlock
>            Product: Drivers
>            Version: 2.5
>     Kernel Version: 2.6.30-rc5
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: network-wireless
>         AssignedTo: drivers_network-wireless@kernel-bugs.osdl.org
>         ReportedBy: karllinuxtest.relton@ntlworld.com
>                 CC: kalle.valo@iki.fi
>         Regression: No
> 
> 
> at76_dwork_hw_scan() does a mutex_lock and then calls
> ieee80211_scan_completed(). This in turn calls at76_config() which then tries
> to do the same mutex_lock and thus the driver goes into deadlock.
> 
> I believe the solution would be for at76_dwork_hw_scan() to unlock the mutex
> before calling ieee80211_scan_completed(). I've tried this with my card, and it
> does indeed avoid the lockup - though I have yet to get the card working
> properly with this driver.
> 

umm, is anyone looking at
drivers_network-wireless@kernel-bugs.osdl.org?  This one seems a bit of
a no-brainer?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] at76c50x-usb: avoid mutex deadlock in at76_dwork_hw_scan
  2009-05-28  7:49 ` [Bugme-new] [Bug 13312] New: at76c50x-usb mutex deadlock Andrew Morton
@ 2009-05-28  9:45   ` John W. Linville
  2009-06-01 13:11     ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: John W. Linville @ 2009-05-28  9:45 UTC (permalink / raw)
  To: linux-wireless
  Cc: bugzilla-daemon, bugme-daemon, Kalle Valo, Jason Andryuk,
	Johannes Berg, karllinuxtest.relton, John W. Linville

http://bugzilla.kernel.org/show_bug.cgi?id=13312

at76_dwork_hw_scan holds a mutex while calling ieee80211_scan_completed,
which then calls at76_config which needs the same mutex.  This reworks
the ordering to not hold the lock while calling ieee80211_scan_completed.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/at76c50x-usb.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index e3caeef..b51281f 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -1873,18 +1873,18 @@ static void at76_dwork_hw_scan(struct work_struct *work)
 	if (ret != CMD_STATUS_COMPLETE) {
 		queue_delayed_work(priv->hw->workqueue, &priv->dwork_hw_scan,
 				   SCAN_POLL_INTERVAL);
-		goto exit;
+		mutex_unlock(&priv->mtx);
+		return;
 	}
 
-	ieee80211_scan_completed(priv->hw, false);
-
 	if (is_valid_ether_addr(priv->bssid))
 		at76_join(priv);
 
-	ieee80211_wake_queues(priv->hw);
-
-exit:
 	mutex_unlock(&priv->mtx);
+
+	ieee80211_scan_completed(priv->hw, false);
+
+	ieee80211_wake_queues(priv->hw);
 }
 
 static int at76_hw_scan(struct ieee80211_hw *hw,
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] at76c50x-usb: avoid mutex deadlock in at76_dwork_hw_scan
  2009-05-28  9:45   ` [PATCH] at76c50x-usb: avoid mutex deadlock in at76_dwork_hw_scan John W. Linville
@ 2009-06-01 13:11     ` Kalle Valo
  0 siblings, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2009-06-01 13:11 UTC (permalink / raw)
  To: John W. Linville
  Cc: linux-wireless, bugzilla-daemon, bugme-daemon, Jason Andryuk,
	Johannes Berg, karllinuxtest.relton

"John W. Linville" <linville@tuxdriver.com> writes:

> http://bugzilla.kernel.org/show_bug.cgi?id=13312
>
> at76_dwork_hw_scan holds a mutex while calling ieee80211_scan_completed,
> which then calls at76_config which needs the same mutex.  This reworks
> the ordering to not hold the lock while calling ieee80211_scan_completed.
>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>

Thanks.

Acked-by: Kalle Valo <kalle.valo@iki.fi>

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-06-01 13:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <bug-13312-10286@http.bugzilla.kernel.org/>
2009-05-28  7:49 ` [Bugme-new] [Bug 13312] New: at76c50x-usb mutex deadlock Andrew Morton
2009-05-28  9:45   ` [PATCH] at76c50x-usb: avoid mutex deadlock in at76_dwork_hw_scan John W. Linville
2009-06-01 13:11     ` Kalle Valo

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).