From: Aloka Dixit <alokad@codeaurora.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, John Crispin <john@phrozen.org>
Subject: Re: [PATCH v10 2/4] mac80211: multiple bssid support in interface handling
Date: Mon, 28 Jun 2021 10:16:26 -0700 [thread overview]
Message-ID: <9451f0db49f603d7e9a00d172ab341e2@codeaurora.org> (raw)
In-Reply-To: <6dc09b7dcfef37a703e95e264e6ab64738560160.camel@sipsolutions.net>
On 2021-06-23 08:57, Johannes Berg wrote:
> On Mon, 2021-04-26 at 12:05 -0700, Aloka Dixit wrote:
>>
> Hm wait, didn't I see the same code in cfg80211 - maybe cfg80211 should
> just pass the pointer?
>>
>> static int ieee80211_del_iface(struct wiphy *wiphy, struct
>> wireless_dev *wdev)
>> {
>> + struct ieee80211_sub_if_data *sdata =
>> IEEE80211_WDEV_TO_SUB_IF(wdev);
>> + struct ieee80211_local *local;
>> + struct ieee80211_vif *vif;
>> +
>> + if (!sdata)
>> + return 0;
>> +
>> + local = sdata->local;
>> + vif = &sdata->vif;
>> + if (vif->type == NL80211_IFTYPE_AP &&
>> + ieee80211_hw_check(&local->hw, SUPPORTS_MBSSID_AP)) {
>> + if (vif->mbssid.flags & IEEE80211_VIF_MBSSID_TX) {
>> + struct ieee80211_sub_if_data *child, *tmpsdata;
>> +
>> + wiphy_unlock(local->hw.wiphy);
>> + mutex_lock(&local->iflist_mtx);
>
> I really don't think you can drop the locking like that in the middle
> of
> something. That's almost always a recipe for disaster.
>
>> @@ -375,6 +375,18 @@ static void ieee80211_do_stop(struct
>> ieee80211_sub_if_data *sdata, bool going_do
>> struct cfg80211_chan_def chandef;
>> bool cancel_scan;
>> struct cfg80211_nan_func *func;
>> + struct ieee80211_sub_if_data *parent;
>> +
>> + if (sdata->vif.type == NL80211_IFTYPE_AP &&
>> + ieee80211_hw_check(&local->hw, SUPPORTS_MBSSID_AP) &&
>> + sdata->vif.mbssid.flags & IEEE80211_VIF_MBSSID_NON_TX) {
>> + parent = vif_to_sdata(sdata->vif.mbssid.parent);
>> + if (parent && ieee80211_sdata_running(parent)) {
>> + wiphy_unlock(local->hw.wiphy);
>> + dev_close(parent->wdev.netdev);
>> + wiphy_lock(local->hw.wiphy);
>
> Same here.
>
> johannes
Hi Johannes,
Thanks for the comments, will go through all, but need your help with
this particular one -
I'm not able to come up with a different solution which does not cause a
deadlock by continuing to hold wiphy_lock() as we discussed last time
that dev_close() will in turn call into cfg80211.
You had suggested looking at dev_close() for VLAN, that code also
doesn't lock wiphy_lock hence I did same here but locked
'local->iflist_mtx'. Dropping both won't be good for sure.
Can you please suggest a better way? I'm really not able to come up with
one.
Thanks.
next prev parent reply other threads:[~2021-06-28 17:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-26 19:05 [PATCH v10 0/4] multiple bssid and EMA support in AP mode Aloka Dixit
2021-04-26 19:05 ` [PATCH v10 1/4] nl80211: " Aloka Dixit
2021-06-14 16:15 ` Aloka Dixit
2021-06-23 15:55 ` Johannes Berg
2021-04-26 19:05 ` [PATCH v10 2/4] mac80211: multiple bssid support in interface handling Aloka Dixit
2021-06-23 15:57 ` Johannes Berg
2021-06-28 17:16 ` Aloka Dixit [this message]
2021-06-28 19:17 ` Johannes Berg
2021-04-26 19:05 ` [PATCH v10 3/4] mac80211: MBSSID and EMA support in beacon handling Aloka Dixit
2021-04-26 19:05 ` [PATCH v10 4/4] mac80211: CSA on non-transmitting interfaces Aloka Dixit
2021-06-23 16:03 ` Johannes Berg
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=9451f0db49f603d7e9a00d172ab341e2@codeaurora.org \
--to=alokad@codeaurora.org \
--cc=johannes@sipsolutions.net \
--cc=john@phrozen.org \
--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 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.