crypto: chelsio - un-register crypto algorithms
authorDevulapally Shiva Krishna <shiva@chelsio.com>
Wed, 19 Feb 2020 13:13:57 +0000 (18:43 +0530)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 28 Feb 2020 00:36:46 +0000 (08:36 +0800)
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>
drivers/crypto/chelsio/chcr_core.c

index 507ba20..6e02254 100644 (file)
@@ -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: