All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cfg80211: Fix mutex locking in reg_last_request_cell_base
@ 2012-07-18 12:41 Mohammed Shafi Shajakhan
  2012-07-18 14:46 ` Luciano Coelho
  2012-07-18 15:04 ` Johannes Berg
  0 siblings, 2 replies; 4+ messages in thread
From: Mohammed Shafi Shajakhan @ 2012-07-18 12:41 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Mohammed Shafi Shajakhan, Luis Rodriguez

From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

should fix the following issue

	[ 3229.815012] [ BUG: lock held when returning to user space! ]
	[ 3229.815016] 3.5.0-rc7-wl #28 Tainted: G        W  O
	[ 3229.815017]
	------------------------------------------------
	[ 3229.815019] wpa_supplicant/5783 is leaving the kernel with locks still held!
	[ 3229.815022] 1 lock held by wpa_supplicant/5783:
	[ 3229.815023]  #0: (reg_mutex){+.+.+.}, at: [<fa65834d>]
	reg_last_request_cell_base+0x1d/0x60 [cfg80211]

Cc: Luis Rodriguez <mcgrof@gmail.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
---
 net/wireless/reg.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index dbb01df..2303ee7 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -929,11 +929,13 @@ static bool reg_request_cell_base(struct regulatory_request *request)
 
 bool reg_last_request_cell_base(void)
 {
+	bool val;
 	assert_cfg80211_lock();
 
 	mutex_lock(&reg_mutex);
-	return reg_request_cell_base(last_request);
+	val = reg_request_cell_base(last_request);
 	mutex_unlock(&reg_mutex);
+	return val;
 }
 
 #ifdef CONFIG_CFG80211_CERTIFICATION_ONUS
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] cfg80211: Fix mutex locking in reg_last_request_cell_base
  2012-07-18 12:41 [PATCH] cfg80211: Fix mutex locking in reg_last_request_cell_base Mohammed Shafi Shajakhan
@ 2012-07-18 14:46 ` Luciano Coelho
  2012-07-18 15:20   ` Mohammed Shafi
  2012-07-18 15:04 ` Johannes Berg
  1 sibling, 1 reply; 4+ messages in thread
From: Luciano Coelho @ 2012-07-18 14:46 UTC (permalink / raw)
  To: Mohammed Shafi Shajakhan; +Cc: Johannes Berg, linux-wireless, Luis Rodriguez

On Wed, 2012-07-18 at 18:11 +0530, Mohammed Shafi Shajakhan wrote:
> From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
> 
> should fix the following issue
> 
> 	[ 3229.815012] [ BUG: lock held when returning to user space! ]
> 	[ 3229.815016] 3.5.0-rc7-wl #28 Tainted: G        W  O
> 	[ 3229.815017]
> 	------------------------------------------------
> 	[ 3229.815019] wpa_supplicant/5783 is leaving the kernel with locks still held!
> 	[ 3229.815022] 1 lock held by wpa_supplicant/5783:
> 	[ 3229.815023]  #0: (reg_mutex){+.+.+.}, at: [<fa65834d>]
> 	reg_last_request_cell_base+0x1d/0x60 [cfg80211]
> 
> Cc: Luis Rodriguez <mcgrof@gmail.com>
> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
> ---

Tested-by: Luciano Coelho <coelho@ti.com>

This actually also fixes a similar circular lock dependency bug when
starting AP mode with hostapd (which is the case I tested this patch
on): http://pastebin.com/AVczE1Ej

--
Luca.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cfg80211: Fix mutex locking in reg_last_request_cell_base
  2012-07-18 12:41 [PATCH] cfg80211: Fix mutex locking in reg_last_request_cell_base Mohammed Shafi Shajakhan
  2012-07-18 14:46 ` Luciano Coelho
@ 2012-07-18 15:04 ` Johannes Berg
  1 sibling, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2012-07-18 15:04 UTC (permalink / raw)
  To: Mohammed Shafi Shajakhan; +Cc: linux-wireless, Luis Rodriguez

On Wed, 2012-07-18 at 18:11 +0530, Mohammed Shafi Shajakhan wrote:
> From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
> 
> should fix the following issue
> 
> 	[ 3229.815012] [ BUG: lock held when returning to user space! ]
> 	[ 3229.815016] 3.5.0-rc7-wl #28 Tainted: G        W  O
> 	[ 3229.815017]
> 	------------------------------------------------
> 	[ 3229.815019] wpa_supplicant/5783 is leaving the kernel with locks still held!
> 	[ 3229.815022] 1 lock held by wpa_supplicant/5783:
> 	[ 3229.815023]  #0: (reg_mutex){+.+.+.}, at: [<fa65834d>]
> 	reg_last_request_cell_base+0x1d/0x60 [cfg80211]
> 
> Cc: Luis Rodriguez <mcgrof@gmail.com>
> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>

Applied, thanks

johannes


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] cfg80211: Fix mutex locking in reg_last_request_cell_base
  2012-07-18 14:46 ` Luciano Coelho
@ 2012-07-18 15:20   ` Mohammed Shafi
  0 siblings, 0 replies; 4+ messages in thread
From: Mohammed Shafi @ 2012-07-18 15:20 UTC (permalink / raw)
  To: Luciano Coelho
  Cc: Mohammed Shafi Shajakhan, Johannes Berg, linux-wireless, Luis Rodriguez

Hi Luca,

On Wed, Jul 18, 2012 at 8:16 PM, Luciano Coelho <coelho@ti.com> wrote:
> On Wed, 2012-07-18 at 18:11 +0530, Mohammed Shafi Shajakhan wrote:
>> From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
>>
>> should fix the following issue
>>
>>       [ 3229.815012] [ BUG: lock held when returning to user space! ]
>>       [ 3229.815016] 3.5.0-rc7-wl #28 Tainted: G        W  O
>>       [ 3229.815017]
>>       ------------------------------------------------
>>       [ 3229.815019] wpa_supplicant/5783 is leaving the kernel with locks still held!
>>       [ 3229.815022] 1 lock held by wpa_supplicant/5783:
>>       [ 3229.815023]  #0: (reg_mutex){+.+.+.}, at: [<fa65834d>]
>>       reg_last_request_cell_base+0x1d/0x60 [cfg80211]
>>
>> Cc: Luis Rodriguez <mcgrof@gmail.com>
>> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
>> ---
>
> Tested-by: Luciano Coelho <coelho@ti.com>
>
> This actually also fixes a similar circular lock dependency bug when
> starting AP mode with hostapd (which is the case I tested this patch
> on): http://pastebin.com/AVczE1Ej

thanks !

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



-- 
thanks,
shafi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-18 15:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-18 12:41 [PATCH] cfg80211: Fix mutex locking in reg_last_request_cell_base Mohammed Shafi Shajakhan
2012-07-18 14:46 ` Luciano Coelho
2012-07-18 15:20   ` Mohammed Shafi
2012-07-18 15:04 ` Johannes Berg

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.