[Jaunty] SRU modprobe -r iwl3945 causes total system freeze

Amit Kucheria amit.kucheria at canonical.com
Fri Jul 3 08:57:49 UTC 2009


On 09 Jul 02, Stefan Bader wrote:
> SRU Justification:
> 
> Impact: Removing the iwl3945 module can cause a hard lockup of the
> system as there is a race condition which might get the rfkill_poll
> workqueue restarted/running after the module code has been unloaded.
> 
> Fix: Two patches from upstream, the first moving the call that
> restarts the workqueue on the way down to be executed before
> stopping the workqueue. The second patch makes the call stopping the
> workqueue wait for any running worker.
> 
> Testcase: Removing and loading the module in a loop (has been
> verified to be working after the patches being applied).
> 
> 

> From 305bc4240681a54bd13766e19a4aa1d6e2020f34 Mon Sep 17 00:00:00 2001
> From: Kolekar, Abhijeet <abhijeet.kolekar at intel.com>
> Date: Fri, 19 Dec 2008 10:37:41 +0800
> Subject: [PATCH] iwl3945: release resources before shutting down
> 
> BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/345710
> 
> Release resource before shutting down and notify upper stack.
> 
> Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar at intel.com>
> Signed-off-by: Zhu Yi <yi.zhu at intel.com>
> Signed-off-by: John W. Linville <linville at tuxdriver.com>
> Signed-off-by: Stefan Bader <stefan.bader at canonical.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl3945-base.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
> index bbc1ab1..481aed0 100644
> --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
> +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
> @@ -8152,7 +8152,12 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev)
>  
>  	set_bit(STATUS_EXIT_PENDING, &priv->status);
>  
> -	iwl3945_down(priv);
> +	if (priv->mac80211_registered) {
> +		ieee80211_unregister_hw(priv->hw);
> +		priv->mac80211_registered = 0;
> +	} else {
> +		iwl3945_down(priv);
> +	}
>  
>  	/* make sure we flush any pending irq or
>  	 * tasklet for the driver
> @@ -8176,9 +8181,6 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev)
>  	iwl3945_unset_hw_setting(priv);
>  	iwl3945_clear_stations_table(priv);
>  
> -	if (priv->mac80211_registered)
> -		ieee80211_unregister_hw(priv->hw);
> -
>  	/*netif_stop_queue(dev); */
>  	flush_workqueue(priv->workqueue);
>  
> -- 
> 1.5.4.3
> 

> From 2fc0c3a31b63de68ef525646e31c9838c9bdb43a Mon Sep 17 00:00:00 2001
> From: Reinette Chatre <reinette.chatre at intel.com>
> Date: Mon, 20 Apr 2009 14:37:01 -0700
> Subject: [PATCH] iwl3945: use cancel_delayed_work_sync to cancel rfkill_poll
> 
> BugLink: https://bugs.launchpad.net/ubuntu/+bug/345710
> 
> Users reported lockup with work still trying to run
> after module has been unloaded.
> 
> http://thread.gmane.org/gmane.linux.kernel.wireless.general/30594/focus=30601
> 
> Signed-off-by: Reinette Chatre <reinette.chatre at intel.com>
> Reported-by: TJ <ubuntu at tjworld.net>
> Reported-by: Huaxu Wan <huaxu.wan at linux.intel.com>
> Signed-off-by: John W. Linville <linville at tuxdriver.com>
> Signed-off-by: Stefan Bader <stefan.bader at canonical.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..bbc1ab1 100644
> --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
> +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
> @@ -8166,7 +8166,7 @@ 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);
> +	cancel_delayed_work_sync(&priv->rfkill_poll);
>  	iwl3945_dealloc_ucode_pci(priv);
>  
>  	if (priv->rxq.bd)
> -- 
> 1.5.4.3
> 

ACK. Looks ok.
-- 
----------------------------------------------------------------------
Amit Kucheria, Kernel Engineer || amit.kucheria at canonical.com
----------------------------------------------------------------------




More information about the kernel-team mailing list