linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH stable] b43: Fix controller restart crash
@ 2008-06-06 13:58 Michael Buesch
  2008-06-06 17:32 ` [stable] " Chris Wright
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Buesch @ 2008-06-06 13:58 UTC (permalink / raw)
  To: stable; +Cc: linux-wireless, bcm43xx-dev

This fixes a kernel crash on rmmod, in the case where the controller
was restarted before doing the rmmod.

Upstream commit is 4735f5022c97f6624ced2ec5056c61c4b437d53b

Signed-off-by: Michael Buesch <mb@bu3sch.de>

---

Index: linux-2.6.25.4/drivers/net/wireless/b43/main.c
===================================================================
--- linux-2.6.25.4.orig/drivers/net/wireless/b43/main.c	2008-06-06 15:36:38.000000000 +0200
+++ linux-2.6.25.4/drivers/net/wireless/b43/main.c	2008-06-06 15:36:40.000000000 +0200
@@ -3815,13 +3815,15 @@ static void b43_chip_reset(struct work_s
 		err = b43_wireless_core_start(dev);
 		if (err) {
 			b43_wireless_core_exit(dev);
 			goto out;
 		}
 	}
-      out:
+out:
+	if (err)
+		wl->current_dev = NULL; /* Failed to init the dev. */
 	mutex_unlock(&wl->mutex);
 	if (err)
 		b43err(wl, "Controller restart FAILED\n");
 	else
 		b43info(wl, "Controller restarted\n");
 }
@@ -3964,15 +3966,17 @@ err_powerdown:
 
 static void b43_one_core_detach(struct ssb_device *dev)
 {
 	struct b43_wldev *wldev;
 	struct b43_wl *wl;
 
+	/* Do not cancel ieee80211-workqueue based work here.
+	 * See comment in b43_remove(). */
+
 	wldev = ssb_get_drvdata(dev);
 	wl = wldev->wl;
-	cancel_work_sync(&wldev->restart_work);
 	b43_debugfs_remove_device(wldev);
 	b43_wireless_core_detach(wldev);
 	list_del(&wldev->list);
 	wl->nr_devs--;
 	ssb_set_drvdata(dev, NULL);
 	kfree(wldev);
@@ -4149,12 +4153,16 @@ static int b43_probe(struct ssb_device *
 
 static void b43_remove(struct ssb_device *dev)
 {
 	struct b43_wl *wl = ssb_get_devtypedata(dev);
 	struct b43_wldev *wldev = ssb_get_drvdata(dev);
 
+	/* We must cancel any work here before unregistering from ieee80211,
+	 * as the ieee80211 unreg will destroy the workqueue. */
+	cancel_work_sync(&wldev->restart_work);
+
 	B43_WARN_ON(!wl);
 	if (wl->current_dev == wldev)
 		ieee80211_unregister_hw(wl->hw);
 
 	b43_one_core_detach(dev);
 

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

* Re: [stable] [PATCH stable] b43: Fix controller restart crash
  2008-06-06 13:58 [PATCH stable] b43: Fix controller restart crash Michael Buesch
@ 2008-06-06 17:32 ` Chris Wright
  2008-06-06 17:55   ` Michael Buesch
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wright @ 2008-06-06 17:32 UTC (permalink / raw)
  To: Michael Buesch; +Cc: stable, linux-wireless, bcm43xx-dev

* Michael Buesch (mb@bu3sch.de) wrote:
> This fixes a kernel crash on rmmod, in the case where the controller
> was restarted before doing the rmmod.
> 
> Upstream commit is 4735f5022c97f6624ced2ec5056c61c4b437d53b

This is not in Linus' tree.  Where is this upstream commit?

thanks,
-chris

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

* Re: [stable] [PATCH stable] b43: Fix controller restart crash
  2008-06-06 17:32 ` [stable] " Chris Wright
@ 2008-06-06 17:55   ` Michael Buesch
  2008-06-09 15:23     ` John W. Linville
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Buesch @ 2008-06-06 17:55 UTC (permalink / raw)
  To: Chris Wright; +Cc: stable, linux-wireless, bcm43xx-dev, John Linville

On Friday 06 June 2008 19:32:23 Chris Wright wrote:
> * Michael Buesch (mb@bu3sch.de) wrote:
> > This fixes a kernel crash on rmmod, in the case where the controller
> > was restarted before doing the rmmod.
> > 
> > Upstream commit is 4735f5022c97f6624ced2ec5056c61c4b437d53b
> 
> This is not in Linus' tree.  Where is this upstream commit?

John Linville's wireless tree. That's upstream from my point of view. :P


-- 
Greetings Michael.

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

* Re: [stable] [PATCH stable] b43: Fix controller restart crash
  2008-06-06 17:55   ` Michael Buesch
@ 2008-06-09 15:23     ` John W. Linville
  0 siblings, 0 replies; 4+ messages in thread
From: John W. Linville @ 2008-06-09 15:23 UTC (permalink / raw)
  To: Michael Buesch; +Cc: Chris Wright, stable, linux-wireless, bcm43xx-dev

On Fri, Jun 06, 2008 at 07:55:27PM +0200, Michael Buesch wrote:
> On Friday 06 June 2008 19:32:23 Chris Wright wrote:
> > * Michael Buesch (mb@bu3sch.de) wrote:
> > > This fixes a kernel crash on rmmod, in the case where the controller
> > > was restarted before doing the rmmod.
> > > 
> > > Upstream commit is 4735f5022c97f6624ced2ec5056c61c4b437d53b
> > 
> > This is not in Linus' tree.  Where is this upstream commit?
> 
> John Linville's wireless tree. That's upstream from my point of view. :P

:-)

The commit ID may have gotten shuffled when Dave M. rebased net-2.6.
It is in 2.6.26-rc5 as commit 3bf0a32e22fedc0b46443699db2d61ac2a883ac4.

Hth!

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

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

end of thread, other threads:[~2008-06-09 16:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-06 13:58 [PATCH stable] b43: Fix controller restart crash Michael Buesch
2008-06-06 17:32 ` [stable] " Chris Wright
2008-06-06 17:55   ` Michael Buesch
2008-06-09 15:23     ` John W. Linville

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).