diff options
author | 2015-03-14 09:02:49 -0400 | |
---|---|---|
committer | 2015-03-14 09:20:07 +0100 | |
commit | a9dc960c37b0d4eb192598dc4c94276270454514 (patch) | |
tree | 769341072aeb277f71beed94b5b73f00b9dce46f /tools/perf/scripts/python/call-graph-from-postgresql.py | |
parent | net: can: Enable xilinx driver for ARM64 (diff) | |
download | linux-dev-a9dc960c37b0d4eb192598dc4c94276270454514.tar.xz linux-dev-a9dc960c37b0d4eb192598dc4c94276270454514.zip |
can: kvaser_usb: Fix tx queue start/stop race conditions
A number of tx queue wake-up events went missing due to the
outlined scenario below. Start state is a pool of 16 tx URBs,
active tx_urbs count = 15, with the netdev tx queue open.
CPU #1 [softirq] CPU #2 [softirq]
start_xmit() tx_acknowledge()
................ ................
atomic_inc(&tx_urbs);
if (atomic_read(&tx_urbs) >= 16) {
-->
atomic_dec(&tx_urbs);
netif_wake_queue();
return;
<--
netif_stop_queue();
}
At the end, the correct state expected is a 15 tx_urbs count
value with the tx queue state _open_. Due to the race, we get
the same tx_urbs value but with the tx queue state _stopped_.
The wake-up event is completely lost.
Thus avoid hand-rolled concurrency mechanisms and use a proper
lock for contexts and tx queue protection.
Signed-off-by: Ahmed S. Darwish <ahmed.darwish@valeo.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'tools/perf/scripts/python/call-graph-from-postgresql.py')
0 files changed, 0 insertions, 0 deletions