diff mbox series

[Crypto] chcr: un-register crypto algorithms

Message ID 20200219131357.5679-1-shiva@chelsio.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series [Crypto] chcr: un-register crypto algorithms | expand

Commit Message

Devulapally Shiva Krishna Feb. 19, 2020, 1:13 p.m. UTC
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>
---
 drivers/crypto/chelsio/chcr_core.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Herbert Xu Feb. 28, 2020, 12:51 a.m. UTC | #1
On Wed, Feb 19, 2020 at 06:43:57PM +0530, Devulapally Shiva Krishna wrote:
> 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>
> ---
>  drivers/crypto/chelsio/chcr_core.c | 2 ++
>  1 file changed, 2 insertions(+)

Patch applied.  Thanks.
diff mbox series

Patch

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: