[Jaunty SRU] LP#345710 iwl3945: cancel rfkill_poll with sync when the module is exiting

Huaxu Wan huaxu.wan at linux.intel.com
Fri May 8 06:35:54 UTC 2009


>From f3628f0ac6c9713afadaa9654815c37a294ce7e2 Mon Sep 17 00:00:00 2001
From: Huaxu Wan <huaxu.wan at linux.intel.com>
Date: Fri, 8 May 2009 07:36:58 -0400
Subject: [PATCH] cancel rfkill_poll with sync when module is exiting

Re-write the patch due to there is no response from TJ.

http://marc.info/?l=linux-wireless&m=123791044313158&w=2
Bug: #345710

When the wireless interface is active and the iwl3945 module is unloaded the
call to ieee80211_unregister_hw() would call iwl3945_mac_stop() which would
restart the delayed workqueue for rfkill_poll. That workqueue had already been
cancelled so when the next work item was run (2 seconds later) the system would
suffer a hard lock-up because the module had been unloaded by then.

This patch implements STATUS_EXIT_PENDING checks in places where the rfkill_poll
work is scheduled, and moves the final workqueue cancellation to occur after the
call to ieee80211_unregister_hw().

Bug discovered, experienced and fix tested on my PC.

Signed-off-by: TJ <ubuntu at tjworld.net>
Signed-off-by: Huaxu Wan <huaxu.wan at linux.intel.com>
---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index bb92db2..08c2a9d 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -8166,7 +8166,6 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev)
 	sysfs_remove_group(&pdev->dev.kobj, &iwl3945_attribute_group);
 
 	iwl3945_rfkill_unregister(priv);
-	cancel_delayed_work(&priv->rfkill_poll);
 	iwl3945_dealloc_ucode_pci(priv);
 
 	if (priv->rxq.bd)
@@ -8181,6 +8180,7 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev)
 
 	/*netif_stop_queue(dev); */
 	flush_workqueue(priv->workqueue);
+	cancel_delayed_work_sync(&priv->rfkill_poll);
 
 	/* ieee80211_unregister_hw calls iwl3945_mac_stop, which flushes
 	 * priv->workqueue... so we can't take down the workqueue
-- 
1.6.0.4



-- 
Thanks
Huaxu




More information about the kernel-team mailing list