Skip to content

Commit 33ddc10

Browse files
chelsiocryptoherbertx
authored andcommitted
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 <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent b4f9166 commit 33ddc10

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

drivers/crypto/chelsio/chcr_algo.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,17 +200,10 @@ void chcr_verify_tag(struct aead_request *req, u8 *input, int *err)
200200

201201
static int chcr_inc_wrcount(struct chcr_dev *dev)
202202
{
203-
int err = 0;
204-
205-
spin_lock_bh(&dev->lock_chcr_dev);
206203
if (dev->state == CHCR_DETACH)
207-
err = 1;
208-
else
209-
atomic_inc(&dev->inflight);
210-
211-
spin_unlock_bh(&dev->lock_chcr_dev);
212-
213-
return err;
204+
return 1;
205+
atomic_inc(&dev->inflight);
206+
return 0;
214207
}
215208

216209
static inline void chcr_dec_wrcount(struct chcr_dev *dev)

drivers/crypto/chelsio/chcr_core.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,11 @@ static void chcr_detach_device(struct uld_ctx *u_ctx)
243243
{
244244
struct chcr_dev *dev = &u_ctx->dev;
245245

246-
spin_lock_bh(&dev->lock_chcr_dev);
247246
if (dev->state == CHCR_DETACH) {
248-
spin_unlock_bh(&dev->lock_chcr_dev);
249247
pr_debug("Detached Event received for already detach device\n");
250248
return;
251249
}
252250
dev->state = CHCR_DETACH;
253-
spin_unlock_bh(&dev->lock_chcr_dev);
254-
255251
if (atomic_read(&dev->inflight) != 0) {
256252
schedule_delayed_work(&dev->detach_work, WQ_DETACH_TM);
257253
wait_for_completion(&dev->detach_comp);

0 commit comments

Comments
 (0)