From: Devulapally Shiva Krishna <shiva@chelsio.com>
Date: Wed, 19 Feb 2020 18:43:57 +0530
Subject: crypto: chelsio - un-register crypto algorithms
Patch-mainline: v5.7-rc1
Git-commit: 6ff78ffaddd807cd458ec3fdcc714d3a79414e5e
References: jsc#SLE-15131
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 <shiva@chelsio.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
drivers/crypto/chelsio/chcr_core.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/crypto/chelsio/chcr_core.c
+++ b/drivers/crypto/chelsio/chcr_core.c
@@ -288,6 +288,8 @@ static int chcr_uld_state_change(void *h
case CXGB4_STATE_DETACH:
chcr_detach_device(u_ctx);
+ if (!atomic_read(&drv_data.dev_count))
+ stop_crypto();
break;
case CXGB4_STATE_START_RECOVERY: