diff options
author | Atul Gupta <atul.gupta@chelsio.com> | 2019-05-02 03:47:27 -0700 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-05-09 13:17:22 +0800 |
commit | 33ddc108c5a1cfba72a08a92f35a0ba5bbd1cfd8 (patch) | |
tree | 37b36d62ad42674e3847760c3311b595760fc36f | |
parent | b4f91664307d5bf4f0d93da12a6146f9cf3559fb (diff) | |
download | linux-33ddc108c5a1cfba72a08a92f35a0ba5bbd1cfd8.tar.bz2 |
crypto: chelsio - Fix softlockup with heavy I/O
removed un-necessary lock_chcr_dev to protect device state
DETACH. lock is not required to protect I/O count
Signed-off-by: Atul Gupta <atul.gupta@chelsio.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/chelsio/chcr_algo.c | 13 | ||||
-rw-r--r-- | drivers/crypto/chelsio/chcr_core.c | 4 |
2 files changed, 3 insertions, 14 deletions
diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c index 8a76fce22943..73bbd499b6ff 100644 --- a/drivers/crypto/chelsio/chcr_algo.c +++ b/drivers/crypto/chelsio/chcr_algo.c @@ -200,17 +200,10 @@ void chcr_verify_tag(struct aead_request *req, u8 *input, int *err) static int chcr_inc_wrcount(struct chcr_dev *dev) { - int err = 0; - - spin_lock_bh(&dev->lock_chcr_dev); if (dev->state == CHCR_DETACH) - err = 1; - else - atomic_inc(&dev->inflight); - - spin_unlock_bh(&dev->lock_chcr_dev); - - return err; + return 1; + atomic_inc(&dev->inflight); + return 0; } static inline void chcr_dec_wrcount(struct chcr_dev *dev) diff --git a/drivers/crypto/chelsio/chcr_core.c b/drivers/crypto/chelsio/chcr_core.c index 239b933d6df6..029a7354f541 100644 --- a/drivers/crypto/chelsio/chcr_core.c +++ b/drivers/crypto/chelsio/chcr_core.c @@ -243,15 +243,11 @@ static void chcr_detach_device(struct uld_ctx *u_ctx) { struct chcr_dev *dev = &u_ctx->dev; - spin_lock_bh(&dev->lock_chcr_dev); if (dev->state == CHCR_DETACH) { - spin_unlock_bh(&dev->lock_chcr_dev); pr_debug("Detached Event received for already detach device\n"); return; } dev->state = CHCR_DETACH; - spin_unlock_bh(&dev->lock_chcr_dev); - if (atomic_read(&dev->inflight) != 0) { schedule_delayed_work(&dev->detach_work, WQ_DETACH_TM); wait_for_completion(&dev->detach_comp); |