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.
(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?
Created attachment 21599 [details] 0001-at76c50x-usb-avoid-mutex-deadlock-in-at76_dwork_hw_.patch Would you mind trying this patch?
The patch does resolve the mutex lockup.
commit 21a4cc00e8e67edcfc1bdb9af6d370ed1226eb86 Author: John W. Linville <linville@tuxdriver.com> Date: Thu May 28 11:39:02 2009 +0200 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. Signed-off-by: John W. Linville <linville@tuxdriver.com>