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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Stefan Bader-2
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 <[hidden email]>
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 <[hidden email]>
Signed-off-by: Zhu Yi <[hidden email]>
Signed-off-by: John W. Linville <[hidden email]>
Signed-off-by: Stefan Bader <[hidden email]>
---
 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 <[hidden email]>
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 <[hidden email]>
Reported-by: TJ <[hidden email]>
Reported-by: Huaxu Wan <[hidden email]>
Signed-off-by: John W. Linville <[hidden email]>
Signed-off-by: Stefan Bader <[hidden email]>
---
 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


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

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

Colin Ian King-2

On Thu, 2009-07-02 at 11:40 +0200, 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).
>
ACK, looks reasonable to me.
>
--
Colin King   <[hidden email]>
"Me transmitte sursum, caledoni"


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

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

Amit Kucheria-6
In reply to this post by Stefan Bader-2
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 <[hidden email]>
> 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 <[hidden email]>
> Signed-off-by: Zhu Yi <[hidden email]>
> Signed-off-by: John W. Linville <[hidden email]>
> Signed-off-by: Stefan Bader <[hidden email]>
> ---
>  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 <[hidden email]>
> 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 <[hidden email]>
> Reported-by: TJ <[hidden email]>
> Reported-by: Huaxu Wan <[hidden email]>
> Signed-off-by: John W. Linville <[hidden email]>
> Signed-off-by: Stefan Bader <[hidden email]>
> ---
>  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 || [hidden email]
----------------------------------------------------------------------

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

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

Tim Gardner-2
In reply to this post by Stefan Bader-2
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).
>
>

ACK

--
Tim Gardner [hidden email]

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team