Search Linux Wireless

[PATCH] b43: Don't cancel the restart workqueue in wireless_core_exit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
Cc: Larry Finger <larry.finger@xxxxxxxxxxxx>

Index: wireless-dev/drivers/net/wireless/b43/main.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/b43/main.c	2007-09-09 13:27:14.000000000 +0200
+++ wireless-dev/drivers/net/wireless/b43/main.c	2007-09-09 13:46:31.000000000 +0200
@@ -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);
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux