From 6ff78ffaddd807cd458ec3fdcc714d3a79414e5e Mon Sep 17 00:00:00 2001 From: Devulapally Shiva Krishna Date: Wed, 19 Feb 2020 18:43:57 +0530 Subject: [PATCH] crypto: chelsio - un-register crypto algorithms When a PCI device will be removed, cxgb4(LLD) will notify chcr(ULD). Incase if it's a last pci device, chcr should un-register all the crypto algorithms. Signed-off-by: Devulapally Shiva Krishna Signed-off-by: Herbert Xu --- drivers/crypto/chelsio/chcr_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/chelsio/chcr_core.c b/drivers/crypto/chelsio/chcr_core.c index 507ba20f0874..6e02254c007a 100644 --- a/drivers/crypto/chelsio/chcr_core.c +++ b/drivers/crypto/chelsio/chcr_core.c @@ -271,6 +271,8 @@ static int chcr_uld_state_change(void *handle, enum cxgb4_state state) case CXGB4_STATE_DETACH: chcr_detach_device(u_ctx); + if (!atomic_read(&drv_data.dev_count)) + stop_crypto(); break; case CXGB4_STATE_START_RECOVERY: