diff options
author | Shashank Gupta <shashank.gupta@intel.com> | 2023-02-27 15:55:43 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-03-14 17:06:44 +0800 |
commit | 2b60f79c7b8105994f0daa46bb4e367fdc866b53 (patch) | |
tree | 19b39650c679ea6bd4e415f7ae3e35d1ae1a82df /drivers/crypto/qat/qat_dh895xcc | |
parent | 1bdc85550a2b59bb7f62ead7173134e66dd2d60e (diff) | |
download | linux-2b60f79c7b8105994f0daa46bb4e367fdc866b53.tar.gz linux-2b60f79c7b8105994f0daa46bb4e367fdc866b53.tar.bz2 linux-2b60f79c7b8105994f0daa46bb4e367fdc866b53.zip |
crypto: qat - replace state machine calls
The device state machine functions are unsafe and interdependent on each
other. To perform a state transition, these shall be called in a
specific order:
* device up: adf_dev_init() -> adf_dev_start()
* device down: adf_dev_stop() -> adf_dev_shutdown()
Replace all the state machine functions used in the QAT driver with the
safe wrappers adf_dev_up() and adf_dev_down().
Signed-off-by: Shashank Gupta <shashank.gupta@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/qat/qat_dh895xcc')
-rw-r--r-- | drivers/crypto/qat/qat_dh895xcc/adf_drv.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/crypto/qat/qat_dh895xcc/adf_drv.c b/drivers/crypto/qat/qat_dh895xcc/adf_drv.c index ebeb17b67fcd..4d27e4e43642 100644 --- a/drivers/crypto/qat/qat_dh895xcc/adf_drv.c +++ b/drivers/crypto/qat/qat_dh895xcc/adf_drv.c @@ -201,24 +201,14 @@ static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) goto out_err_disable_aer; } - ret = hw_data->dev_config(accel_dev); - if (ret) - goto out_err_disable_aer; - - ret = adf_dev_init(accel_dev); - if (ret) - goto out_err_dev_shutdown; - - ret = adf_dev_start(accel_dev); + ret = adf_dev_up(accel_dev, true); if (ret) goto out_err_dev_stop; return ret; out_err_dev_stop: - adf_dev_stop(accel_dev); -out_err_dev_shutdown: - adf_dev_shutdown(accel_dev); + adf_dev_down(accel_dev, false); out_err_disable_aer: adf_disable_aer(accel_dev); out_err_free_reg: @@ -239,8 +229,7 @@ static void adf_remove(struct pci_dev *pdev) pr_err("QAT: Driver removal failed\n"); return; } - adf_dev_stop(accel_dev); - adf_dev_shutdown(accel_dev); + adf_dev_down(accel_dev, false); adf_disable_aer(accel_dev); adf_cleanup_accel(accel_dev); adf_cleanup_pci_dev(accel_dev); |