All of lore.kernel.org
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] b43: Fix locking problem when stopping rfkill polling
Date: Wed, 7 Oct 2009 15:01:06 -0400	[thread overview]
Message-ID: <20091007190106.GB22394@tuxdriver.com> (raw)
In-Reply-To: <4accae5d.BgSJpcmlvg+W5PGM%Larry.Finger@lwfinger.net>

On Wed, Oct 07, 2009 at 10:06:05AM -0500, Larry Finger wrote:
> In commit 26e5ab35b4c7b1d4cb487a11084520aed9a8d05e entitled "b43: Fix PPC
> crash in rfkill polling on unload", the call to stop polling should not have
> been placed inside the wl->mutex. The result was incorrect locking messages.
> 
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
> 
> John,
> 
> I had not intended for the previous patch to be applied as I was waiting for
> the Bugzilla OP to test. He promised to do that today. In any case, that patch
> introduced a locking problem that needs to be fixed.
> 
> Why do the one-liners cause so many problems?
> 
> Larry
> ---
> 
> 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
> @@ -4501,8 +4501,8 @@ static void b43_op_stop(struct ieee80211
>  
>  	cancel_work_sync(&(wl->beacon_update_trigger));
>  
> -	mutex_lock(&wl->mutex);
>  	wiphy_rfkill_stop_polling(hw->wiphy);
> +	mutex_lock(&wl->mutex);
>  	if (b43_status(dev) >= B43_STAT_STARTED) {
>  		dev = b43_wireless_core_stop(dev);
>  		if (!dev)

OK, but why do we start polling under the lock but stop polling without
the lock?  Should we start polling without holding the lock too?

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

  reply	other threads:[~2009-10-07 19:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-07 15:06 [PATCH] b43: Fix locking problem when stopping rfkill polling Larry Finger
2009-10-07 19:01 ` John W. Linville [this message]
2009-10-07 19:28   ` Larry Finger
2009-10-07 19:46     ` Michael Buesch
2009-10-07 22:36     ` Johannes Berg
2009-10-07 22:43       ` Larry Finger
2009-10-07 23:08         ` Michael Buesch
2009-10-08 20:23   ` Larry Finger
2009-10-08 22:31     ` John W. Linville

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=20091007190106.GB22394@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=Larry.Finger@lwfinger.net \
    --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.