summaryrefslogtreecommitdiff
path: root/drivers/crypto/qat/qat_common/adf_ctl_drv.c
diff options
context:
space:
mode:
authorTadeusz Struk <tadeusz.struk@intel.com>2016-04-06 18:01:54 (GMT)
committerHerbert Xu <herbert@gondor.apana.org.au>2016-04-15 14:35:45 (GMT)
commitd6064165ba4449ea085a389724d728258a3180ec (patch)
treeae38a87001011166778e6c1fa6a437560bab8a4e /drivers/crypto/qat/qat_common/adf_ctl_drv.c
parent7587c407540006e4e8fd5ed33f66ffe6158e830a (diff)
downloadlinux-d6064165ba4449ea085a389724d728258a3180ec.tar.xz
crypto: qat - adf_dev_stop should not be called in atomic context
VFs call adf_dev_stop() from a PF to VF interrupt bottom half. This causes an oops "scheduling while atomic", because it tries to acquire a mutex to un-register crypto algorithms. This patch fixes the issue by calling adf_dev_stop() asynchronously. Changes in v2: - change kthread to a work queue. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/qat/qat_common/adf_ctl_drv.c')
-rw-r--r--drivers/crypto/qat/qat_common/adf_ctl_drv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/crypto/qat/qat_common/adf_ctl_drv.c b/drivers/crypto/qat/qat_common/adf_ctl_drv.c
index 48a1248..116ddda 100644
--- a/drivers/crypto/qat/qat_common/adf_ctl_drv.c
+++ b/drivers/crypto/qat/qat_common/adf_ctl_drv.c
@@ -471,12 +471,17 @@ static int __init adf_register_ctl_device_driver(void)
if (adf_init_aer())
goto err_aer;
+ if (adf_init_vf_wq())
+ goto err_vf_wq;
+
if (qat_crypto_register())
goto err_crypto_register;
return 0;
err_crypto_register:
+ adf_exit_vf_wq();
+err_vf_wq:
adf_exit_aer();
err_aer:
adf_chr_drv_destroy();
@@ -489,6 +494,7 @@ static void __exit adf_unregister_ctl_device_driver(void)
{
adf_chr_drv_destroy();
adf_exit_aer();
+ adf_exit_vf_wq();
qat_crypto_unregister();
adf_clean_vf_map(false);
mutex_destroy(&adf_ctl_lock);