Commit 33ddc108 authored by Atul Gupta's avatar Atul Gupta Committed by Herbert Xu
Browse files

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: default avatarAtul Gupta <atul.gupta@chelsio.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent b4f91664
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -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
		return 1;
	atomic_inc(&dev->inflight);

	spin_unlock_bh(&dev->lock_chcr_dev);

	return err;
	return 0;
}

static inline void chcr_dec_wrcount(struct chcr_dev *dev)
+0 −4
Original line number Diff line number Diff line
@@ -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);