All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Jenkins <alan-jenkins-cCz0Lq7MMjm9FHfhHBbuYA@public.gmane.org>
To: John Linville <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Cc: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>,
	"linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Arjan van de Ven <arjan-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	linux-kernel
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Kernel Testers List
	<kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] [RFC] EEE PC hangs when booting off battery
Date: Wed, 29 Apr 2009 12:14:33 +0100	[thread overview]
Message-ID: <49F83699.3000307@tuffmail.co.uk> (raw)
In-Reply-To: <49F6DA14.7030608-cCz0Lq7MMjm9FHfhHBbuYA@public.gmane.org>

Alan Jenkins wrote:
> Johannes Berg wrote:
>   
>> That doesn't seem relevant, this just does some initialisation. However,
>> you definitely missed adding a call to wep_free().
>>   
>>     
>
> Hah, I should have realized something was wrong when I noticed I was
> removing more lines that I added. 
>
> The crypto init does cause the module load:
>
> wait_for_completion
> call_usermodehelper_exec
> __request_module
> crypto_larval_lookup
> ? extract_entropy
> crypto_alg_mod_lookup
> crypto_alloc_base
> ieee80211_wep_init
> ieee80211_register_hw
>   

Here's a corrected patch complete with changelog.  If there are no other
problems with it, can you please  apply this for 2.6.30 to keep my EeePC
regression-free?

Thanks
Alan

------>
From c5e9dc036247e70956d1a28e8850c3810385dda0 Mon Sep 17 00:00:00 2001
From: Alan Jenkins <alan-jenkins-cCz0Lq7MMjm9FHfhHBbuYA@public.gmane.org>
Date: Wed, 29 Apr 2009 11:41:24 +0100
Subject: [PATCH] mac80211: fix modprobe deadlock by not calling wep_init under rtnl_lock

 - ieee80211_wep_init(), which is called with rtnl_lock held, blocks in
   request_module() [waiting for modprobe to load a crypto module].

 - modprobe blocks in a call to flush_workqueue(), when it closes a TTY
   [presumably when it exits].

 - The workqueue item linkwatch_event() blocks on rtnl_lock.

There's no reason for wep_init() to be called with rtnl_lock held, so
just move it outside the critical section.

Signed-off-by: Alan Jenkins <alan-jenkins-cCz0Lq7MMjm9FHfhHBbuYA@public.gmane.org>
---
 net/mac80211/main.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index fbcbed6..00968c2 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -909,6 +909,13 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 	if (result < 0)
 		goto fail_sta_info;
 
+	result = ieee80211_wep_init(local);
+	if (result < 0) {
+		printk(KERN_DEBUG "%s: Failed to initialize wep: %d\n",
+		       wiphy_name(local->hw.wiphy), result);
+		goto fail_wep;
+	}
+
 	rtnl_lock();
 	result = dev_alloc_name(local->mdev, local->mdev->name);
 	if (result < 0)
@@ -930,14 +937,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 		goto fail_rate;
 	}
 
-	result = ieee80211_wep_init(local);
-
-	if (result < 0) {
-		printk(KERN_DEBUG "%s: Failed to initialize wep: %d\n",
-		       wiphy_name(local->hw.wiphy), result);
-		goto fail_wep;
-	}
-
 	/* add one default STA interface if supported */
 	if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION)) {
 		result = ieee80211_if_add(local, "wlan%d", NULL,
@@ -967,13 +966,13 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 
 	return 0;
 
-fail_wep:
-	rate_control_deinitialize(local);
 fail_rate:
 	unregister_netdevice(local->mdev);
 	local->mdev = NULL;
 fail_dev:
 	rtnl_unlock();
+	ieee80211_wep_free(local);
+fail_wep:
 	sta_info_stop(local);
 fail_sta_info:
 	debugfs_hw_del(local);
-- 
1.5.4.3




--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: John Linville <linville@tuxdriver.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	Arjan van de Ven <arjan@infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Kernel Testers List <kernel-testers@vger.kernel.org>
Subject: Re: [PATCH] [RFC] EEE PC hangs when booting off battery
Date: Wed, 29 Apr 2009 12:14:33 +0100	[thread overview]
Message-ID: <49F83699.3000307@tuffmail.co.uk> (raw)
In-Reply-To: <49F6DA14.7030608@tuffmail.co.uk>

Alan Jenkins wrote:
> Johannes Berg wrote:
>   
>> That doesn't seem relevant, this just does some initialisation. However,
>> you definitely missed adding a call to wep_free().
>>   
>>     
>
> Hah, I should have realized something was wrong when I noticed I was
> removing more lines that I added. 
>
> The crypto init does cause the module load:
>
> wait_for_completion
> call_usermodehelper_exec
> __request_module
> crypto_larval_lookup
> ? extract_entropy
> crypto_alg_mod_lookup
> crypto_alloc_base
> ieee80211_wep_init
> ieee80211_register_hw
>   

Here's a corrected patch complete with changelog.  If there are no other
problems with it, can you please  apply this for 2.6.30 to keep my EeePC
regression-free?

Thanks
Alan

------>
>From c5e9dc036247e70956d1a28e8850c3810385dda0 Mon Sep 17 00:00:00 2001
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Date: Wed, 29 Apr 2009 11:41:24 +0100
Subject: [PATCH] mac80211: fix modprobe deadlock by not calling wep_init under rtnl_lock

 - ieee80211_wep_init(), which is called with rtnl_lock held, blocks in
   request_module() [waiting for modprobe to load a crypto module].

 - modprobe blocks in a call to flush_workqueue(), when it closes a TTY
   [presumably when it exits].

 - The workqueue item linkwatch_event() blocks on rtnl_lock.

There's no reason for wep_init() to be called with rtnl_lock held, so
just move it outside the critical section.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
---
 net/mac80211/main.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index fbcbed6..00968c2 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -909,6 +909,13 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 	if (result < 0)
 		goto fail_sta_info;
 
+	result = ieee80211_wep_init(local);
+	if (result < 0) {
+		printk(KERN_DEBUG "%s: Failed to initialize wep: %d\n",
+		       wiphy_name(local->hw.wiphy), result);
+		goto fail_wep;
+	}
+
 	rtnl_lock();
 	result = dev_alloc_name(local->mdev, local->mdev->name);
 	if (result < 0)
@@ -930,14 +937,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 		goto fail_rate;
 	}
 
-	result = ieee80211_wep_init(local);
-
-	if (result < 0) {
-		printk(KERN_DEBUG "%s: Failed to initialize wep: %d\n",
-		       wiphy_name(local->hw.wiphy), result);
-		goto fail_wep;
-	}
-
 	/* add one default STA interface if supported */
 	if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION)) {
 		result = ieee80211_if_add(local, "wlan%d", NULL,
@@ -967,13 +966,13 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 
 	return 0;
 
-fail_wep:
-	rate_control_deinitialize(local);
 fail_rate:
 	unregister_netdevice(local->mdev);
 	local->mdev = NULL;
 fail_dev:
 	rtnl_unlock();
+	ieee80211_wep_free(local);
+fail_wep:
 	sta_info_stop(local);
 fail_sta_info:
 	debugfs_hw_del(local);
-- 
1.5.4.3





  parent reply	other threads:[~2009-04-29 11:14 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-11  9:41 Regression: EEE PC hangs when booting off battery Alan Jenkins
2009-04-11  9:41 ` Alan Jenkins
     [not found] ` <49E065CF.6040408-cCz0Lq7MMjm9FHfhHBbuYA@public.gmane.org>
2009-04-11 18:07   ` Tzy-Jye Daniel Lin
2009-04-11 18:07     ` Tzy-Jye Daniel Lin
     [not found]     ` <66dc75180904111107q645fbb77i3cf927ffab7a7ef0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-04-12  9:00       ` Alan Jenkins
2009-04-12  9:00         ` Alan Jenkins
     [not found]         ` <49E1ADAE.2030103-cCz0Lq7MMjm9FHfhHBbuYA@public.gmane.org>
2009-04-12 13:11           ` [BISECTED] " Alan Jenkins
2009-04-12 13:11             ` Alan Jenkins
     [not found]             ` <49E1E89D.7040502-cCz0Lq7MMjm9FHfhHBbuYA@public.gmane.org>
2009-04-13 19:15               ` Bjorn Helgaas
2009-04-13 19:15                 ` Bjorn Helgaas
     [not found]                 ` <200904131315.55519.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
2009-04-13 19:57                   ` Alan Jenkins
2009-04-13 19:57                     ` Alan Jenkins
2009-04-13 22:28                     ` Bjorn Helgaas
2009-04-14  8:06                       ` Alan Jenkins
2009-04-14  9:26                         ` Alan Jenkins
2009-04-14 14:59                           ` Bjorn Helgaas
2009-04-14 15:17                             ` Arjan van de Ven
2009-04-14 15:37                               ` Alan Jenkins
     [not found]                               ` <20090414081728.10de978a-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2009-04-14 15:48                                 ` Bjorn Helgaas
2009-04-14 15:48                                   ` Bjorn Helgaas
     [not found]                                   ` <200904140948.37633.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
2009-04-14 15:55                                     ` Moore, Robert
2009-04-14 15:55                                       ` Moore, Robert
     [not found]                                       ` <4911F71203A09E4D9981D27F9D8308581D3722EB-osO9UTpF0URQxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2009-04-14 16:56                                         ` Bjorn Helgaas
2009-04-14 16:56                                           ` Bjorn Helgaas
2009-04-14 17:22                                           ` Moore, Robert
     [not found]                                             ` <4911F71203A09E4D9981D27F9D8308581D372489-osO9UTpF0URQxe9IK+vIArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2009-04-14 17:28                                               ` Alan Jenkins
2009-04-14 17:28                                                 ` Alan Jenkins
     [not found]                                           ` <200904141056.14159.bjorn.helgaas-VXdhtT5mjnY@public.gmane.org>
2009-04-15 15:38                                             ` Len Brown
2009-04-15 15:38                                               ` Len Brown
2009-04-15 14:32                                     ` [FIXED] " Alan Jenkins
2009-04-15 14:32                                       ` Alan Jenkins
2009-04-22 12:17                                       ` Alan Jenkins
2009-04-26 11:34                                         ` Alan Jenkins
     [not found]                                           ` <49F446AE.6070607-cCz0Lq7MMjm9FHfhHBbuYA@public.gmane.org>
2009-04-28  9:19                                             ` [PATCH] [RFC] " Alan Jenkins
2009-04-28  9:19                                               ` Alan Jenkins
     [not found]                                               ` <49F6CA0E.5040101-cCz0Lq7MMjm9FHfhHBbuYA@public.gmane.org>
2009-04-28  9:58                                                 ` Johannes Berg
2009-04-28  9:58                                                   ` Johannes Berg
     [not found]                                                   ` <1240912688.28835.10.camel-YfaajirXv2244ywRPIzf9A@public.gmane.org>
2009-04-28 10:27                                                     ` Alan Jenkins
2009-04-28 10:27                                                       ` Alan Jenkins
     [not found]                                                       ` <49F6DA14.7030608-cCz0Lq7MMjm9FHfhHBbuYA@public.gmane.org>
2009-04-28 10:35                                                         ` Johannes Berg
2009-04-28 10:35                                                           ` Johannes Berg
2009-04-29 11:14                                                         ` Alan Jenkins [this message]
2009-04-29 11:14                                                           ` Alan Jenkins
     [not found]                                                           ` <49F83699.3000307-cCz0Lq7MMjm9FHfhHBbuYA@public.gmane.org>
2009-04-29 11:20                                                             ` Johannes Berg
2009-04-29 11:20                                                               ` Johannes Berg
2009-05-15 21:48                                                             ` Rafael J. Wysocki
2009-05-15 21:48                                                               ` Rafael J. Wysocki
     [not found]                                                               ` <200905152348.56449.rjw-KKrjLPT3xs0@public.gmane.org>
2009-05-16  8:39                                                                 ` Alan Jenkins
2009-05-16  8:39                                                                   ` Alan Jenkins
2009-04-14  5:03                     ` [BISECTED] " Ben Gamari
2009-04-15 15:41                       ` Len Brown
2009-04-11 19:40 ` Regression: " Kristoffer Ericson
     [not found]   ` <20090411214045.7bdd497f.kristoffer.ericson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-04-12  9:22     ` Alan Jenkins
2009-04-12  9:22       ` Alan Jenkins
2009-04-15 15:49       ` archlinux 2.6.28 ac oops (was Re: Regression: EEE PC hangs when booting off battery) Len Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49F83699.3000307@tuffmail.co.uk \
    --to=alan-jenkins-ccz0lq7mmjm9fhfhhbbuya@public.gmane.org \
    --cc=arjan-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org \
    --cc=kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.