[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190625044525.6A45F60A00@smtp.codeaurora.org>
Date: Tue, 25 Jun 2019 04:45:25 +0000 (UTC)
From: Kalle Valo <kvalo@...eaurora.org>
To: Brian Norris <briannorris@...omium.org>
Cc: Ganapathi Bhat <gbhat@...vell.com>,
Nishant Sarmukadam <nishants@...vell.com>,
Amitkumar Karwar <amitkarwar@...il.com>,
Xinming Hu <huxinming820@...il.com>,
<linux-kernel@...r.kernel.org>, linux-wireless@...r.kernel.org,
Doug Anderson <dianders@...omium.org>,
Brian Norris <briannorris@...omium.org>
Subject: Re: [PATCH 1/2] mwifiex: dispatch/rotate from reorder table atomically
Brian Norris <briannorris@...omium.org> wrote:
> mwifiex_11n_scan_and_dispatch() and
> mwifiex_11n_dispatch_pkt_until_start_win() share similar patterns, where
> they perform a few different actions on the same table, using the same
> lock, but non-atomically. There have been other attempts to clean up
> this sort of behavior, but they have had problems (incomplete;
> introducing new deadlocks).
>
> We can improve these functions' atomicity by queueing up our RX packets
> in a list, to dispatch at the end of the function. This avoids problems
> of another operation modifying the table in between our dispatch and
> rotation operations.
>
> This was inspired by investigations around this:
>
> http://lkml.kernel.org/linux-wireless/20181130175957.167031-1-briannorris@chromium.org
> Subject: [4.20 PATCH] Revert "mwifiex: restructure rx_reorder_tbl_lock usage"
>
> While the original (now-reverted) patch had good intentions in
> restructuring some of the locking patterns in this driver, it missed an
> important detail: we cannot defer to softirq contexts while already in
> an atomic context. We can help avoid this sort of problem by separating
> the two steps of:
> (1) iterating / clearing the mwifiex reordering table
> (2) dispatching received packets to upper layers
>
> This makes it much harder to make lock recursion mistakes, as these
> two steps no longer need to hold the same locks.
>
> Testing: I've played with a variety of stress tests, including download
> stress tests on the same APs which caught regressions with commit
> 5188d5453bc9 ("mwifiex: restructure rx_reorder_tbl_lock usage"). I've
> primarily tested on Marvell 8997 / PCIe, although I've given 8897 / SDIO
> a quick spin as well.
>
> Signed-off-by: Brian Norris <briannorris@...omium.org>
> Acked-by: Ganapathi Bhat <gbhat@...vell.com>
New warning:
drivers/net/wireless/marvell/mwifiex/wmm.c: In function 'mwifiex_wmm_process_tx':
drivers/net/wireless/marvell/mwifiex/wmm.c:1438:4: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
mwifiex_11n_aggregate_pkt(priv, ptr, ptr_index, flags);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/marvell/mwifiex/wmm.c:1406:16: note: 'flags' was declared here
unsigned long flags;
^~~~~
2 patches set to Changes Requested.
10976083 [1/2] mwifiex: dispatch/rotate from reorder table atomically
10976087 [2/2] mwifiex: don't disable hardirqs; just softirqs
--
https://patchwork.kernel.org/patch/10976083/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Powered by blists - more mailing lists