crypto: qat - fix mutex lifetimes in the device manager
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | crypto: qat - initialise state_lock on every path in adf_devmgr_add_dev()drivers/ | +1 | 0 replies | |
| 2/2 | crypto: qat - fix use of destroyed vf2pf_lock on VF restartdrivers/ drivers/ | +8 | 0 replies |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Giovanni Cabiddu |
|---|---|
| 1/2 | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] crypto: qat - fix mutex lifetimes in the device manager
Two mutexes used by the QAT driver are initialised or destroyed on paths that do not match their actual lifetime, so with CONFIG_DEBUG_MUTEXES enabled both are reported on a dh895xcc with 32 host-bound VFs.
In summary:
Patch #1: state_lock is initialised at the end of adf_devmgr_add_dev(), after the early return taken when an id mapping for the VF already exists. Since that mapping outlives the VF, recreating VFs on the same BDF leaves the lock uninitialised while adf_dev_up() and adf_dev_down() take it. Move the initialisation up so it happens on every path.
Patch #2: vf2pf_lock is destroyed as part of the VF interrupt teardown in adf_dev_down(), but adf_dev_stop_async() sends the RESTARTING_COMPLETE message to the PF afterwards and takes that lock, so every PF restart locks a destroyed mutex. The notification cannot be moved earlier, so tie the lock lifetime to the accel device instead, next to state_lock in adf_devmgr_add_dev()/adf_devmgr_rm_dev().
Both patches are fixes for stable.
Ahsan Atta (2):
crypto: qat - initialise state_lock on every path in
adf_devmgr_add_dev()
crypto: qat - fix use of destroyed vf2pf_lock on VF restart
drivers/crypto/intel/qat/qat_common/adf_dev_mgr.c | 10 +++++++++- drivers/crypto/intel/qat/qat_common/adf_vf_isr.c | 2 -- 2 files changed, 9 insertions(+), 3 deletions(-)
base-commit: ee0454474a0f1b636dc96217b346e3571878b292
Signature · 1 line
2.50.1