New: at76c50x-usb mutex deadlock
A message that is not in the archive (sent off-list or not yet received): [email protected]/
(switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface).
Quoted 19 lines · On Thu, 14 May 2009 20:54:54 GMT [email protected] 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: [email protected] ReportedBy: [email protected] CC: [email protected] Regression: No
Quoted 9 lines
at76_dwork_hw_scan()does amutex_lockand then callsieee80211_scan_completed(). This in turn callsat76_config()which then tries to do the samemutex_lockand thus the driver goes into deadlock.I believe the solution would be for
at76_dwork_hw_scan()to unlock the mutex before callingieee80211_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 [email protected]? This one seems a bit of a no-brainer?
PATCH 1/1 at76c50x-usb: avoid mutex deadlock in at76_dwork_hw_scan
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.
--- drivers/net/wireless/at76c50x-usb.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/wireless/at76c50x-usb.c +6 -6
@@ -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,
Signature · 1 line
1.6.0.6
Re: [PATCH] at76c50x-usb: avoid mutex deadlock in at76_dwork_hw_scan
Quoted 7 lines · John W. Linville
http://bugzilla.kernel.org/show_bug.cgi?id=13312
at76_dwork_hw_scanholds a mutex while callingieee80211_scan_completed, which then callsat76_configwhich needs the same mutex. This reworks the ordering to not hold the lock while callingieee80211_scan_completed.Signed-off-by John W. Linville <[email protected]>
Thanks.
Signature · 1 line
Kalle Valo