From: Larry Finger <Larry.Finger@lwfinger.net>
To: kecsa@kutfo.hit.bme.hu
Cc: linux-wireless@vger.kernel.org
Subject: Re: hwtkip hangs on b43
Date: Sat, 23 Jan 2010 11:20:15 -0600 [thread overview]
Message-ID: <4B5B2FCF.2000005@lwfinger.net> (raw)
In-Reply-To: <Pine.LNX.4.44.1001230942190.16120-100000@kutfo.hit.bme.hu>
On 01/23/2010 02:46 AM, kecsa@kutfo.hit.bme.hu wrote:
> Hi,
>
> when I load b43 with hwtkip=1 system hangs after
> ' b43-phy0 debug: Using hardware based encryption for keyidx: 0, mac:...'
> throwing the below BUG.
>
> This is a non-SMP non-preemtive kernel. It looks like we are entering
> b43_op_update_tkip_key() already holding the wl->mutex. We lock mutex in
> b43_interrupt_thread_handler().
>
> This problem is present in stable and also in compat-wireless-2010-01-22
> shapshot if I haven't missed something. As a quick and dirty fix I have
> removed wl->mutex lock/unlock from b43_op_update_tkip_key(). Box survived
> one day (until now) and a ~3GB file transfer over WLAN using hwtkip in
> this way.
Your analysis seem to be correct. I tested with the following patch, which tests
to see if the mutex is locked on entry. If not, it logs a message, locks the
mutex and sets a flag to indicate that the mutex should be unlocked on exit.
This patch is not SMP-safe, but is merely for testing. The printk statement has
not triggered after about 1 hour of testing. I'll give it a bit more testing
before a final patch is submitted.
Index: wireless-testing/drivers/net/wireless/b43/main.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/main.c
+++ wireless-testing/drivers/net/wireless/b43/main.c
@@ -850,11 +850,16 @@ static void b43_op_update_tkip_key(struc
struct b43_wl *wl = hw_to_b43_wl(hw);
struct b43_wldev *dev;
int index = keyconf->hw_key_idx;
+ bool locked_here = 0;
if (B43_WARN_ON(!modparam_hwtkip))
return;
- mutex_lock(&wl->mutex);
+ if (!mutex_is_locked(&wl->mutex)) {
+ printk(KERN_DEBUG "b43: mutex not locked in %s\n", __func__);
+ mutex_lock(&wl->mutex);
+ locked_here = 1;
+ }
dev = wl->current_dev;
if (!dev || b43_status(dev) < B43_STAT_INITIALIZED)
@@ -866,7 +871,8 @@ static void b43_op_update_tkip_key(struc
keymac_write(dev, index, addr);
out_unlock:
- mutex_unlock(&wl->mutex);
+ if (locked_here)
+ mutex_unlock(&wl->mutex);
}
static void do_key_write(struct b43_wldev *dev,
==================================================
Larry
next prev parent reply other threads:[~2010-01-23 17:20 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-23 8:46 hwtkip hangs on b43 kecsa
2010-01-23 17:20 ` Larry Finger [this message]
2010-01-23 17:47 ` Johannes Berg
2010-01-23 18:19 ` Michael Buesch
2010-01-23 18:34 ` Larry Finger
2010-01-23 18:47 ` Michael Buesch
2010-01-23 18:48 ` Johannes Berg
2010-01-23 18:53 ` Johannes Berg
2010-01-23 19:00 ` Michael Buesch
2010-01-23 19:31 ` Larry Finger
2010-01-23 19:38 ` Michael Buesch
2010-01-24 5:58 ` Larry Finger
2010-01-24 11:32 ` Johannes Berg
2010-01-24 11:45 ` Michael Buesch
2010-01-24 11:47 ` Johannes Berg
2010-01-24 11:52 ` Michael Buesch
2010-01-24 12:37 ` Kalle Valo
2010-01-25 10:43 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B5B2FCF.2000005@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=kecsa@kutfo.hit.bme.hu \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.