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.
johannes
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
From: Johannes Berg <johannes@sipsolutions.net> Date: 2017-09-06 13:30:15
On Wed, 2017-09-06 at 15:27 +0200, Stefano Brivio wrote:
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.
That's not really the point, if that changes that function would have
to move the locking around, and nothing else.
The point is more that code in ieee80211_ba_session_work() could assume
the lock is held across the entire loop, since that's the way it's
written and looks like even with your patch.
So for example replacing the loop of tid = 0..NUM_TIDS-1 with a
list_for_each_entry() would already be unsafe with the dropping if the
list were to require the mutex for locking.
johannes
On Wed, 06 Sep 2017 15:30:10 +0200
Johannes Berg [off-list ref] wrote:
So for example replacing the loop of tid = 0..NUM_TIDS-1 with a
list_for_each_entry() would already be unsafe with the dropping if the
list were to require the mutex for locking.
Sure. Still, it would need another code change to break, but in general
I do agree indeed. :)
--
Stefano