From: Johannes Berg <johannes@sipsolutions.net>
To: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2] mac80211: fix iflist_mtx/mtx locking in radar detection
Date: Thu, 19 Dec 2013 13:35:46 +0100 [thread overview]
Message-ID: <1387456546.4298.9.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <1387395944-17785-1-git-send-email-johannes@sipsolutions.net> (sfid-20131218_204552_502543_D48E4AAE)
On Wed, 2013-12-18 at 20:45 +0100, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> The scan code creates an iflist_mtx -> mtx locking dependency,
> and a few other places, notably radar detection, were creating
> the opposite dependency, causing lockdep to complain. As scan
> and radar detection are mutually exclusive, the deadlock can't
> really happen in practice, but it's still bad form.
>
> A similar issue exists in the monitor mode code, but this is
> only used by channel-context drivers right now and those have
> to have hardware scan, so that also can't happen.
>
> Still, fix these issues by making some of the channel context
> code require the mtx to be held rather than acquiring it, thus
> allowing the monitor/radar callers to keep the iflist_mtx->mtx
> lock ordering.
>
> While at it, also fix access to the local->scanning variable
> in the radar code, and document that radar_detect_enabled is
> now properly protected by the mtx.
>
> All this would now introduce an ABBA deadlock between the DFS
> work cancelling and local->mtx, so change the locking there a
> bit to not need to use cancel_delayed_work_sync() but be able
> to just use cancel_delayed_work(). The work is also safely
> stopped/removed when the interface is stopped, so no extra
> changes are needed.
Applied.
johannes
prev parent reply other threads:[~2013-12-19 12:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-18 19:45 [PATCH v2] mac80211: fix iflist_mtx/mtx locking in radar detection Johannes Berg
2013-12-19 12:35 ` Johannes Berg [this message]
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=1387456546.4298.9.camel@jlt4.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).