linux_dsm_epyc7002/drivers/net/can/usb
Ahmed S. Darwish a9dc960c37 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>
2015-03-14 09:20:07 +01:00
..
peak_usb can: peak_usb: fix missing ctrlmode_ init for every dev 2015-03-09 10:22:24 +01:00
ems_usb.c can: move can_stats.bus_off++ from can_bus_off into can_change_state 2015-01-20 13:56:53 +01:00
esd_usb2.c can: move can_stats.bus_off++ from can_bus_off into can_change_state 2015-01-20 13:56:53 +01:00
gs_usb.c can: gs_usb: add .ndo_change_mtu function 2014-11-18 21:34:59 +01:00
Kconfig can: peak_usb: add support for PEAK new CANFD USB adapters 2015-01-28 14:47:06 +01:00
kvaser_usb.c can: kvaser_usb: Fix tx queue start/stop race conditions 2015-03-14 09:20:07 +01:00
Makefile net: can: use kbuild magic to inherit debug settings 2014-08-18 01:03:38 +02:00
usb_8dev.c can: move can_stats.bus_off++ from can_bus_off into can_change_state 2015-01-20 13:56:53 +01:00