Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2727860ybh; Fri, 24 Jul 2020 23:10:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeWSszUG4NriiLgK8INquUhHsoYw1J82qNgwQ3W/Emfe9BOOCt05dF7vADFjzf1OueJ899 X-Received: by 2002:a17:906:e91:: with SMTP id p17mr12896433ejf.252.1595657407114; Fri, 24 Jul 2020 23:10:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595657407; cv=none; d=google.com; s=arc-20160816; b=gK4/8w+MmYf4w+RhsOIFRRw53v9KngZyIhaqEQ+anaZtNTYNJz8bTs7JOOSXr+Mv9q qGdWeU5uDXuxKIoPZMDDozaV4WtEYVyDOc+/Ad2dRYCulRF8vMRy3lhomJ0jSJID5thH ZHuqqFDa5o1vmzhs9vyduWVY9GB3GghwG130gO8XEffz8ZKoIY2fftpfUDJVBGDobhHK r3davHAnjJ8p99VEEJrFcbLK3unlnSRQCazPLBF0kQh+/mcFkyPQkhHiJawhWjkS2AfN WZkkQlCj8z+BUdAco+KtxsY6gfQJnhQQZ6FlQB5tqUtNtl8Sb/8CHS5lHENwL3Hr1QeE S6NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=qbE6fkAh4zVwtIbqWHnIjZSL1frpGQFHZdFQvS59IZQ=; b=r8Y1TttQ5SDRQ5VpSMHPpUcpQgKjOKQWslz1jZKbnKW5P/3gKXDy9LoN2rG38TyCyS +PXw8x/0dsdaRLpo+C3tDoz3VLlnyOGUsJwf1+KPwdVBELpTHL4AZP/swb/fHXZl2Z5A mGa7yGXYPGRYga0JtX0rcmww7aASkSffa8BD0H0ZteDHJRKM3Gmrc9ePkRnKh3hem9mb 3S5OZ0K2LVAKLQXK46wbeoH83SxDnrQQzZbxeLHBps3Ho+BKlpx5LhbDYUjAZN35EptR /98PgzbDoAA89mfkLa9dDm9k83u3oahqUpNEqikzCKrM11zIsMGiRFEUe4nv8QfQpHvY a3wQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h5si1893361ejj.464.2020.07.24.23.09.44; Fri, 24 Jul 2020 23:10:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726901AbgGYGJg (ORCPT + 99 others); Sat, 25 Jul 2020 02:09:36 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:33164 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726434AbgGYGJd (ORCPT ); Sat, 25 Jul 2020 02:09:33 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 8C10AF589E6A4665A933; Sat, 25 Jul 2020 14:09:28 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Sat, 25 Jul 2020 14:09:21 +0800 From: Yang Shen To: , CC: , , , Subject: [PATCH 3/4] crypto: hisilicon/zip - fix the return value when device is busy Date: Sat, 25 Jul 2020 14:06:49 +0800 Message-ID: <1595657210-3964-4-git-send-email-shenyang39@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595657210-3964-1-git-send-email-shenyang39@huawei.com> References: <1595657210-3964-1-git-send-email-shenyang39@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As before, when the ZIP device is too busy to creat a request, it will return '-EBUSY'. But the crypto process think the '-EBUSY' means a successful request and wait for its completion. So replace '-EBUSY' with '-EAGAIN' to show crypto this request is failed. Fixes: 62c455ca853e("crypto: hisilicon - add HiSilicon ZIP...") Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- drivers/crypto/hisilicon/zip/zip_crypto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/hisilicon/zip/zip_crypto.c b/drivers/crypto/hisilicon/zip/zip_crypto.c index a1703eb..f88edf4 100644 --- a/drivers/crypto/hisilicon/zip/zip_crypto.c +++ b/drivers/crypto/hisilicon/zip/zip_crypto.c @@ -498,7 +498,7 @@ static struct hisi_zip_req *hisi_zip_create_req(struct acomp_req *req, if (req_id >= req_q->size) { write_unlock(&req_q->req_lock); dev_dbg(&qp_ctx->qp->qm->pdev->dev, "Req cache is full!\n"); - return ERR_PTR(-EBUSY); + return ERR_PTR(-EAGAIN); } set_bit(req_id, req_q->req_bitmap); @@ -563,6 +563,7 @@ static int hisi_zip_do_work(struct hisi_zip_req *req, ret = hisi_qp_send(qp, &zip_sqe); if (ret < 0) { atomic64_inc(&dfx->send_busy_cnt); + ret = -EAGAIN; dev_dbg_ratelimited(dev, "Send task message failed!\n"); goto err_unmap_output; } -- 2.7.4