From: Devulapally Shiva Krishna Date: Wed, 19 Feb 2020 13:13:57 +0000 (+0530) Subject: crypto: chelsio - un-register crypto algorithms X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6ff78ffaddd807cd458ec3fdcc714d3a79414e5e;p=linux.git 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 --- diff --git a/drivers/crypto/chelsio/chcr_core.c b/drivers/crypto/chelsio/chcr_core.c index 507ba20f08744..6e02254c007a4 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: