From: Kalle Valo <kvalo@codeaurora.org>
To: Ganapathi Bhat <gbhat@marvell.com>
Cc: "linux-wireless\@vger.kernel.org"
<linux-wireless@vger.kernel.org>,
"Brian Norris" <briannorris@chromium.org>,
Cathy Luo <cluo@marvell.com>, 'Xinming Hu' <huxm@marvell.com>,
Zhiyuan Yang <yangzy@marvell.com>, James Cao <jcao@marvell.com>,
Mangesh Malusare <mmangesh@marvell.com>
Subject: Re: [EXT] Re: [PATCH] mwifiex: fix nested rtnl locking on BG_SCAN_STOPPED
Date: Wed, 27 Jun 2018 18:22:45 +0300 [thread overview]
Message-ID: <87zhzgs18a.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <b534bd7a3e6a43baa7593a493f18e6fa@SC-EXCH02.marvell.com> (Ganapathi Bhat's message of "Wed, 27 Jun 2018 15:00:26 +0000")
Ganapathi Bhat <gbhat@marvell.com> writes:
> Hi Kalle,
>
>> > >
>> > > case EVENT_BG_SCAN_STOPPED:
>> > > dev_dbg(adapter->dev, "event: BGS_STOPPED\n");
>> > > - cfg80211_sched_scan_stopped(priv->wdev.wiphy, 0);
>> > > + if (rtnl_is_locked())
>> > > + cfg80211_sched_scan_stopped_rtnl(priv-
>> > >wdev.wiphy, 0);
>> > > + else
>> > > + cfg80211_sched_scan_stopped(priv->wdev.wiphy,
>> > 0);
>> >
>> > IMHO checking if a lock is taking is rather ugly and an indication there's a
>> > problem with the locking. Instead making an ugly workaround like this I
>> > would rather investigate who is holding the rtnl and solve that.
>> There can be applications trying to access driver(via cfg80211), holding
>> rtnl_lock.
>> For example(in our case):
>> 1. "iw dev" was called, when BG_SCAN was active.
>> 2. NL80211_CMD_GET_INTERFACE requires rtnl_lock to be hold(specified in
>> internal_flags)
>> 3. cfg80211 will hold rtnl_lock before calling "get_tx_power"(in pre_doit).
>> 4. mwifiex will download RF_TX_PWR command to firmware
>> 5. firmware will send BG_SCAN_STOPPED event(since BG_SCAN was active).
>> 6. mwifiex will call "cfg80211_sched_scan_stopped" causing nested rtnl
>> locking.
>>
>> Please share your comments further.
>
> Let us know your thoughts on above sequence.
Sorry, I don't have time to help with this. Hopefully someone else can.
--
Kalle Valo
prev parent reply other threads:[~2018-06-27 15:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 5:19 [PATCH] mwifiex: fix nested rtnl locking on BG_SCAN_STOPPED Ganapathi Bhat
2018-04-25 7:16 ` Kalle Valo
2018-04-25 8:06 ` [EXT] " Ganapathi Bhat
2018-12-08 0:58 ` Brian Norris
2018-12-10 3:27 ` Ganapathi Bhat
2018-06-27 15:00 ` Ganapathi Bhat
2018-06-27 15:22 ` Kalle Valo [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=87zhzgs18a.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@codeaurora.org \
--cc=briannorris@chromium.org \
--cc=cluo@marvell.com \
--cc=gbhat@marvell.com \
--cc=huxm@marvell.com \
--cc=jcao@marvell.com \
--cc=linux-wireless@vger.kernel.org \
--cc=mmangesh@marvell.com \
--cc=yangzy@marvell.com \
/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).