linux/drivers/net/ethernet/ibm
Sukadev Bhattiprolu 4a41c421f3 ibmvnic: serialize access to work queue on remove
The work queue is used to queue reset requests like CHANGE-PARAM or
FAILOVER resets for the worker thread. When the adapter is being removed
the adapter state is set to VNIC_REMOVING and the work queue is flushed
so no new work is added. However the check for adapter being removed is
racy in that the adapter can go into REMOVING state just after we check
and we might end up adding work just as it is being flushed (or after).

The ->rwi_lock is already being used to serialize queue/dequeue work.
Extend its usage ensure there is no race when scheduling/flushing work.

Fixes: 6954a9e419 ("ibmvnic: Flush existing work items before device removal")
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Cc:Uwe Kleine-König <uwe@kleine-koenig.org>
Cc:Saeed Mahameed <saeed@kernel.org>
Reviewed-by: Dany Madden <drt@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-02-15 15:17:30 -08:00
..
ehea net: ehea: convert tasklets to use new tasklet_setup() API 2020-09-14 13:02:37 -07:00
emac treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
ibmveth.c ibmveth: Fix use of ibmveth in a bridge. 2020-10-27 17:52:51 -07:00
ibmveth.h net/ethtool: Introduce link_ksettings API for virtual network devices 2020-02-29 21:48:55 -08:00
ibmvnic.c ibmvnic: serialize access to work queue on remove 2021-02-15 15:17:30 -08:00
ibmvnic.h ibmvnic: serialize access to work queue on remove 2021-02-15 15:17:30 -08:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00