Forgot to send to list
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: RE: [PATCH] b43: Fix rfkill callback deadlock
> Date: Mon, 29 Oct 2007 21:56:51 -0400
>
>
> > From: [EMAIL PROTECTED]
> > To: [email protected]; [EMAIL PROTECTED]
> > Subject: Re: [PATCH] b43: Fix rfkill callback deadlock
> > Date: Mon, 29 Oct 2007 01:16:05 +0100
> >
> > On Monday 29 October 2007 01:06:51 David Ellingsworth wrote:
> >>> - mutex_lock(&wl->mutex);
> >>> + /* When RFKILL is registered, it will call back into this callback.
> >>> + * wl->mutex will already be locked when this happens.
> >>> + * So first trylock. On contention check if we are in initialization.
> >>> + * Silently return if that happens to avoid a deadlock. */
> >>> + if (mutex_trylock(&wl->mutex) == 0) {
> >>> + if (b43_status(dev) < B43_STAT_INITIALIZED)
> >>> + return 0;
> >>> + mutex_lock(&wl->mutex);
> >>> + }
> >>> if (b43_status(dev) < B43_STAT_INITIALIZED)
> >>> goto out_unlock;
> >> Why not replace everything above up to and including the '-
> >> mutex_lock(&wl->mutex); with:
> >>
> >> if(b43_status(dev) < B43_STAT_INITIALIZED)
> >> return 0;
> >>
> >> mutex_lock(&wl->mutex);
> >
> > because the status should be queried under lock, of course.
>
> If that is the case, then a proper fix would be to use two locks to protect
> access to the status. One for allowing read access when no one is writing,
> and another for allowing exclusive write access. In such a configuration you
> could allow multiple readers while having only one writer. The above fix is
> not proper since the lock obtained by another section of code could be
> released before or during the status check.
>
> Regards,
>
> David Ellingsworth
> _________________________________________________________________
> Peek-a-boo FREE Tricks & Treats for You!
> http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
_________________________________________________________________
Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it
now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033
_______________________________________________
Bcm43xx-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev