linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] b43legacy: Don't cancel the restart workqueue in  wireless_core_exit
@ 2007-09-10 16:59 Larry Finger
  2007-09-17 15:03 ` John W. Linville
  0 siblings, 1 reply; 5+ messages in thread
From: Larry Finger @ 2007-09-10 16:59 UTC (permalink / raw)
  To: John Linville; +Cc: Bcm43xx-dev, linux-wireless

From: Michael Buesch <mb@bu3sch.de>

The wq must be canceled later on rmmod. It's nonfatal, if
the wq runs on a device that's not started or down. It will
handle these cases.
But syncing in wireless_core_exit() will cause a deadlock with
the restart_work. (restart work cancels itself)

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Larry Finger <larry.finger@lwfinger.net>
---

John,

Sorry, but I sent the bare patch in the first version.

Larry

 drivers/net/wireless/b43legacy/main.c |    2 ++
 1 file changed, 2 insertions(+)

Index: wireless-dev/drivers/net/wireless/b43legacy/main.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/b43legacy/main.c
+++ wireless-dev/drivers/net/wireless/b43legacy/main.c
@@ -3021,6 +3021,7 @@ static void b43legacy_wireless_core_exit
 	B43legacy_WARN_ON(b43legacy_status(dev) > B43legacy_STAT_INITIALIZED);
 	if (b43legacy_status(dev) != B43legacy_STAT_INITIALIZED)
 		return;
+	b43legacy_set_status(dev, B43legacy_STAT_UNINIT);
 
 	b43legacy_rng_exit(dev->wl);
 	b43legacy_pio_free(dev);
@@ -3520,6 +3521,7 @@ static void b43legacy_one_core_detach(st
 
 	wldev = ssb_get_drvdata(dev);
 	wl = wldev->wl;
+	cancel_work_sync(&wldev->restart_work);
 	b43legacy_debugfs_remove_device(wldev);
 	b43legacy_wireless_core_detach(wldev);
 	list_del(&wldev->list);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] b43legacy: Don't cancel the restart workqueue in  wireless_core_exit
  2007-09-10 16:59 [PATCH V2] b43legacy: Don't cancel the restart workqueue in wireless_core_exit Larry Finger
@ 2007-09-17 15:03 ` John W. Linville
  2007-09-17 17:05   ` Larry Finger
  0 siblings, 1 reply; 5+ messages in thread
From: John W. Linville @ 2007-09-17 15:03 UTC (permalink / raw)
  To: Larry Finger; +Cc: Bcm43xx-dev, linux-wireless

Is this the correct patch?  The first hunk conflicts with an earlier
patch ("b43legacy: Fix cancellation of work queues").

John

On Mon, Sep 10, 2007 at 11:59:20AM -0500, Larry Finger wrote:
> From: Michael Buesch <mb@bu3sch.de>
> 
> The wq must be canceled later on rmmod. It's nonfatal, if
> the wq runs on a device that's not started or down. It will
> handle these cases.
> But syncing in wireless_core_exit() will cause a deadlock with
> the restart_work. (restart work cancels itself)
> 
> Signed-off-by: Michael Buesch <mb@bu3sch.de>
> Signed-off-by: Larry Finger <larry.finger@lwfinger.net>
> ---
> 
> John,
> 
> Sorry, but I sent the bare patch in the first version.
> 
> Larry
> 
>  drivers/net/wireless/b43legacy/main.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> Index: wireless-dev/drivers/net/wireless/b43legacy/main.c
> ===================================================================
> --- wireless-dev.orig/drivers/net/wireless/b43legacy/main.c
> +++ wireless-dev/drivers/net/wireless/b43legacy/main.c
> @@ -3021,6 +3021,7 @@ static void b43legacy_wireless_core_exit
>  	B43legacy_WARN_ON(b43legacy_status(dev) > B43legacy_STAT_INITIALIZED);
>  	if (b43legacy_status(dev) != B43legacy_STAT_INITIALIZED)
>  		return;
> +	b43legacy_set_status(dev, B43legacy_STAT_UNINIT);
>  
>  	b43legacy_rng_exit(dev->wl);
>  	b43legacy_pio_free(dev);
> @@ -3520,6 +3521,7 @@ static void b43legacy_one_core_detach(st
>  
>  	wldev = ssb_get_drvdata(dev);
>  	wl = wldev->wl;
> +	cancel_work_sync(&wldev->restart_work);
>  	b43legacy_debugfs_remove_device(wldev);
>  	b43legacy_wireless_core_detach(wldev);
>  	list_del(&wldev->list);
> -
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] b43legacy: Don't cancel the restart workqueue in wireless_core_exit
  2007-09-17 15:03 ` John W. Linville
@ 2007-09-17 17:05   ` Larry Finger
  2007-09-17 17:37     ` John W. Linville
  0 siblings, 1 reply; 5+ messages in thread
From: Larry Finger @ 2007-09-17 17:05 UTC (permalink / raw)
  To: John W. Linville; +Cc: Bcm43xx-dev, linux-wireless

John W. Linville wrote:
> Is this the correct patch?  The first hunk conflicts with an earlier
> patch ("b43legacy: Fix cancellation of work queues").
> 
> John

Yes, this one is correct. The first one was without a commit message, and had an error.

Larry

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] b43legacy: Don't cancel the restart workqueue in  wireless_core_exit
  2007-09-17 17:05   ` Larry Finger
@ 2007-09-17 17:37     ` John W. Linville
  2007-09-17 18:58       ` Larry Finger
  0 siblings, 1 reply; 5+ messages in thread
From: John W. Linville @ 2007-09-17 17:37 UTC (permalink / raw)
  To: Larry Finger; +Cc: Bcm43xx-dev, linux-wireless

On Mon, Sep 17, 2007 at 12:05:36PM -0500, Larry Finger wrote:
> John W. Linville wrote:
> > Is this the correct patch?  The first hunk conflicts with an earlier
> > patch ("b43legacy: Fix cancellation of work queues").
> > 
> > John
> 
> Yes, this one is correct. The first one was without a commit message, and had an error.

Hmmmm, not that one.  There was another patch that (looking closer)
you sent me and cc'ed bcm43xx-dev on or about 30 August.  I guess
I'll drop that one and use this one instead.

Thanks,

John
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] b43legacy: Don't cancel the restart workqueue in wireless_core_exit
  2007-09-17 17:37     ` John W. Linville
@ 2007-09-17 18:58       ` Larry Finger
  0 siblings, 0 replies; 5+ messages in thread
From: Larry Finger @ 2007-09-17 18:58 UTC (permalink / raw)
  To: John W. Linville; +Cc: Bcm43xx-dev, linux-wireless

John W. Linville wrote:
> On Mon, Sep 17, 2007 at 12:05:36PM -0500, Larry Finger wrote:
>> John W. Linville wrote:
>>> Is this the correct patch?  The first hunk conflicts with an earlier
>>> patch ("b43legacy: Fix cancellation of work queues").
>>>
>>> John
>> Yes, this one is correct. The first one was without a commit message, and had an error.
> 
> Hmmmm, not that one.  There was another patch that (looking closer)
> you sent me and cc'ed bcm43xx-dev on or about 30 August.  I guess
> I'll drop that one and use this one instead.

No, the Aug 30 one is needed. Somehow my patch sets got confused. Please apply the August 30 patch
and drop the Sept. 10 one. I'll fix it after your tree gets updated. I don't think it will cause any
problems. As you said, the first hunk is already in the Aug. 30 patch.

Larry

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-09-17 18:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-10 16:59 [PATCH V2] b43legacy: Don't cancel the restart workqueue in wireless_core_exit Larry Finger
2007-09-17 15:03 ` John W. Linville
2007-09-17 17:05   ` Larry Finger
2007-09-17 17:37     ` John W. Linville
2007-09-17 18:58       ` Larry Finger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).