Re: hung task in mac80211

From: Stefano Brivio
Date: Wed Sep 06 2017 - 09:27:27 EST


On Wed, 06 Sep 2017 15:21:00 +0200
Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:

> On Wed, 2017-09-06 at 15:19 +0200, Stefano Brivio wrote:
> > On Wed, 06 Sep 2017 14:48:35 +0200
> > Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:
> >
> > > I'll look in a bit - but
> > >
> > > > + mutex_unlock(&sta->ampdu_mlme.mtx);
> > > > Â ___ieee80211_stop_rx_ba_session(
> > > > Â sta, tid, WLAN_BACK_RECIPIENT,
> > > > Â WLAN_REASON_QSTA_TIMEOUT,
> > > > true);ÂÂ
> > >
> > > This already has three underscores so shouldn't drop.
> >
> > Right, of course.
> >
> > > [...]
> > > > + mutex_unlock(&sta->ampdu_mlme.mtx);
> > > > Â __ieee80211_start_rx_ba_session(sta, 0,
> > > > 0,
> > > > 0, 1, tid,ÂÂ
> > >
> > > maybe this one needs a ___ version then?
> >
> > Either that, or as it's a single call, perhaps just the following?
> > Matter of taste I guess...
>
> I don't think it's a matter of taste - for me, in principle, dropping
> locks for small sections of code where the larger section holds it is a
> bug waiting to happen. It may (may, I don't even know) be OK here, but
> in general it's something to avoid.

Yes, that was based on the assumption that the initial part of
__ieee80211_start_rx_ba_session() can't really affect the AMPDU
state-machine in any way.

But sure, one small change there in the future and the assumption
doesn't hold anymore.


--
Stefano