Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1135319pxk; Fri, 25 Sep 2020 07:09:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEBLJSAaJ25srQ3HwnyPe3TYe+GvNRw1+66E5XqOHGAaYiuXqmCaCbT94MO6kZqUZ6bOhl X-Received: by 2002:a17:906:d936:: with SMTP id rn22mr2975504ejb.4.1601042988479; Fri, 25 Sep 2020 07:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601042988; cv=none; d=google.com; s=arc-20160816; b=N6tNEAXven7z20/umbLJVEGxi/tq3gSSsfS8SA12ivs2LSK0YaAMINDptpLrRYaiCG 1jqaAR0ZFxrxkk99R1xtbvmBZR+etCECU2SLhXRp5uITCw7qWUhrH1Gsy5U6o5qxmXmi RicnZhq9LPcSHnSdwHhkUEXi2swAARTdj17z53OJa+LmqVohSXbktmi1W0+aJfRJFxqi z4tJin1Vb+EG3K0QbYAE9SlZbT3hCmHocsjZhi8pgvcnWiUCnr0OfCfsYNQz9NeQYfZG E6BihSH1RSF6/eOPJsKbF/UDCiBQMBB4ywlfQbBPKlU/jDP8LWkGhjv+dVpY1fgzxQs/ uh7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=AFJdquXzTwdSQ48koO+k2KeX1wIHWjNYceMyshTTL0A=; b=GbGqbbW/jfqaDhWTWexO8Ac9Zl469rOhCxBkf/Jn6YuGKwjZ/fSegW2/6HmK2dF3ED Bn2Co207PNBIogvkON4ZHhqTAyC376DNo9TjThr1WDk3aBf01wUiFeU3vVsx8sPfRTic HZL5cmwyXIv8cm3azyz9N8DIDm5tEwg+HP98cq3ob7HpbWr0fMpGT/1xiI+2rBNzqdFh fvJxGc96IikgccWDk7SJ8ZYGE64cxMDe3flDVy3w0Cq5SaZaEAM0xnML2L4xoREeXXV6 cV0O+Zyo1HBBY6TW6eRseA0OBILGISw3Rr0amMfLSEEktMMrlt6lKCa65IiHMpkpJ3xE vXQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 cy19si1920027edb.313.2020.09.25.07.09.23; Fri, 25 Sep 2020 07:09:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728985AbgIYOI7 (ORCPT + 99 others); Fri, 25 Sep 2020 10:08:59 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:47128 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728960AbgIYOI6 (ORCPT ); Fri, 25 Sep 2020 10:08:58 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 4C74C18A179F095326D6; Fri, 25 Sep 2020 22:08:56 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Fri, 25 Sep 2020 22:08:50 +0800 From: Yang Shen To: , CC: , , , Subject: [PATCH RESEND 3/4] crypto: hisilicon/zip - fix the return value when device is busy Date: Fri, 25 Sep 2020 22:06:16 +0800 Message-ID: <1601042777-26150-4-git-send-email-shenyang39@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601042777-26150-1-git-send-email-shenyang39@huawei.com> References: <1601042777-26150-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 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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 48dc2fd..08b4660 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); @@ -564,6 +564,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, "failed to send request!\n"); goto err_unmap_output; } -- 2.7.4