linux-stable/drivers/crypto/qat/qat_c3xxxvf
Ahsan Atta 8af4a436e6 crypto: qat - flush vf workqueue at driver removal
There is a race condition during shutdown in adf_disable_sriov() where
both the PF and the VF drivers are loaded on the host system.
The PF notifies a VF with a "RESTARTING" message due to which the VF
starts an asynchronous worker to stop and shutdown itself.
At the same time the PF calls pci_disable_sriov() which invokes the
remove() routine on the VF device driver triggering the shutdown flow
again.

This change fixes the problem by ensuring that the VF flushes the worker
that performs stop()/shutdown() before these two functions are called in
the remove(). To make sure that no additional PV/VF messages are
processed by the VF, interrupts are disabled before flushing the
workqueue.

Signed-off-by: Ahsan Atta <ahsan.atta@intel.com>
Co-developed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Reviewed-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2021-08-21 15:44:56 +08:00
..
adf_c3xxxvf_hw_data.c crypto: qat - remove the unnecessary get_vintmsk_offset() 2021-08-21 15:44:56 +08:00
adf_c3xxxvf_hw_data.h crypto: qat - remove the unnecessary get_vintmsk_offset() 2021-08-21 15:44:56 +08:00
adf_drv.c crypto: qat - flush vf workqueue at driver removal 2021-08-21 15:44:56 +08:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00