Skip to contentSkip to conversation

b43: Don't cancel the restart workqueue in wireless_core_exit

PATCH New Michael Buesch 1 participant 1 message Sep 9, 2007 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 b43: Don't cancel the restart workqueue in wireless_core_exit

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)

drivers/net/wireless/b43/main.c +1 -7
Index: wireless-dev/drivers/net/wireless/b43/main.c
===================================================================
@@ -3317,7 +3317,6 @@ static void b43_imcfglo_timeouts_workaro
 /* Locking: wl->mutex */
 static void b43_wireless_core_exit(struct b43_wldev *dev)
 {
-	struct b43_wl *wl = dev->wl;
 	struct b43_phy *phy = &dev->phy;
 
 	B43_WARN_ON(b43_status(dev) > B43_STAT_INITIALIZED);
@@ -3325,12 +3324,6 @@ static void b43_wireless_core_exit(struc
 		return;
 	b43_set_status(dev, B43_STAT_UNINIT);
 
-	mutex_unlock(&wl->mutex);
-	/* Must unlock as it would otherwise deadlock. No races here.
-	 * Cancel possibly pending workqueues. */
-	cancel_work_sync(&dev->restart_work);
-	mutex_lock(&wl->mutex);
-
 	b43_rng_exit(dev->wl);
 	b43_pio_free(dev);
 	b43_dma_free(dev);
@@ -3811,6 +3804,7 @@ static void b43_one_core_detach(struct s
 
 	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);