Skip to content

crypto: qat - fix concurrency related issues

Shashank Gupta linux-crypto 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5crypto: qat - delay sysfs initializationdrivers/crypto/qat/qat_4xxx/adf_drv.c+4 -40 replies
2/5crypto: qat - fix concurrency issue when device state changesdrivers/crypto/qat/qat_common/adf_accel_devices.h drivers/crypto/qat/qat_common/adf_common_drv.h drivers/crypto/qat/qat_common/adf_dev_mgr.c +2 more+73 -200 replies
3/5crypto: qat - replace state machine callsdrivers/crypto/qat/qat_4xxx/adf_drv.c drivers/crypto/qat/qat_c3xxx/adf_drv.c drivers/crypto/qat/qat_c3xxxvf/adf_drv.c +7 more+33 -1140 replies
4/5crypto: qat - refactor device restart logicdrivers/crypto/qat/qat_common/adf_aer.c drivers/crypto/qat/qat_common/adf_common_drv.h drivers/crypto/qat/qat_common/adf_init.c+20 -30 replies
5/5crypto: qat - make state machine functions staticdrivers/crypto/qat/qat_common/adf_common_drv.h drivers/crypto/qat/qat_common/adf_init.c+5 -150 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchGiovanni Cabiddu
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] crypto: qat - fix concurrency related issues

This set fixes issues related to using unprotected QAT device state machine functions that might cause concurrency issues at the time of state transition.

The first patch fixes the QAT 4XXX device's unexpected behaviour that might occur if the user changes the device state or configuration via sysfs while the driver performing device bring-up. The sequence is changed in the probe function now the sysfs attribute is created after the device initialization.

The second patch fixes the concurrency issue in the sysfs state attribute if multiple processes change the state of the qat device in parallel. The change introduces the protected wrapper function adf_dev_up() and adf_dev_down() that protects the transition of the device state. These are used in adf_sysfs.c instead of low-level state machine functions.

The third patch replaces the use of unsafe low-level device state machine function with its protected wrapper functions.

The forth patch refactor device restart logic by moving it into adf_dev_restart() which uses safe adf_dev_up() and adf_dev_down().

The fifth patch define state machine functions static as they are unsafe to use for state transition now performed by safe adf_dev_up() and adf_dev_down().

Shashank Gupta (5):
crypto: qat - delay sysfs initialization
crypto: qat - fix concurrency issue when device state changes
crypto: qat - replace state machine calls
crypto: qat - refactor device restart logic
crypto: qat - make state machine functions static

 drivers/crypto/qat/qat_4xxx/adf_drv.c             | 21 ++---
 drivers/crypto/qat/qat_c3xxx/adf_drv.c            | 17 +---
 drivers/crypto/qat/qat_c3xxxvf/adf_drv.c          | 13 +--
 drivers/crypto/qat/qat_c62x/adf_drv.c             | 17 +---
 drivers/crypto/qat/qat_c62xvf/adf_drv.c           | 13 +--
 drivers/crypto/qat/qat_common/adf_accel_devices.h |  1 +
 drivers/crypto/qat/qat_common/adf_aer.c           |  4 +-
 drivers/crypto/qat/qat_common/adf_common_drv.h    |  8 +-
 drivers/crypto/qat/qat_common/adf_ctl_drv.c       | 27 +++----
 drivers/crypto/qat/qat_common/adf_dev_mgr.c       |  2 +
 drivers/crypto/qat/qat_common/adf_init.c          | 96 ++++++++++++++++++++---
 drivers/crypto/qat/qat_common/adf_sriov.c         | 10 +--
 drivers/crypto/qat/qat_common/adf_sysfs.c         | 23 +-----
 drivers/crypto/qat/qat_common/adf_vf_isr.c        |  3 +-
 drivers/crypto/qat/qat_dh895xcc/adf_drv.c         | 17 +---
 drivers/crypto/qat/qat_dh895xccvf/adf_drv.c       | 13 +--
 16 files changed, 132 insertions(+), 153 deletions(-)
Signature · 1 line
2.16.4