* [PATCH 1/1] mac80211: only single mutex locked to prevent deadlock
@ 2010-01-25 18:12 wey-yi.w.guy
2010-01-25 18:23 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: wey-yi.w.guy @ 2010-01-25 18:12 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Wey-Yi Guy
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Both ifmgd->mtx and sdata->local->iflist_mtx are locked in
ieee80211_mgd_probe_ap(), not sure it will cause deadlock condition. but
it is better to only has one mutex at a time.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
net/mac80211/mlme.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 1e1d16c..e23df14 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -914,10 +914,13 @@ static void ieee80211_mgd_probe_ap(struct ieee80211_sub_if_data *sdata,
if (already)
goto out;
+ mutex_unlock(&ifmgd->mtx);
+
mutex_lock(&sdata->local->iflist_mtx);
ieee80211_recalc_ps(sdata->local, -1);
mutex_unlock(&sdata->local->iflist_mtx);
+ mutex_lock(&ifmgd->mtx);
ifmgd->probe_send_count = 0;
ieee80211_mgd_probe_ap_send(sdata);
out:
--
1.5.6.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] mac80211: only single mutex locked to prevent deadlock
2010-01-25 18:12 [PATCH 1/1] mac80211: only single mutex locked to prevent deadlock wey-yi.w.guy
@ 2010-01-25 18:23 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2010-01-25 18:23 UTC (permalink / raw)
To: wey-yi.w.guy; +Cc: linux-wireless
[-- Attachment #1: Type: text/plain, Size: 472 bytes --]
On Mon, 2010-01-25 at 10:12 -0800, wey-yi.w.guy@intel.com wrote:
> From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
>
> Both ifmgd->mtx and sdata->local->iflist_mtx are locked in
> ieee80211_mgd_probe_ap(), not sure it will cause deadlock condition. but
> it is better to only has one mutex at a time.
It shouldn't cause a deadlock, we do this all the time, e.g. in
ieee80211_rx_mgmt_probe_resp(), so I don't think the extra locking makes
a lot of sense.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-25 18:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-25 18:12 [PATCH 1/1] mac80211: only single mutex locked to prevent deadlock wey-yi.w.guy
2010-01-25 18:23 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox