Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp286615pxb; Sat, 10 Apr 2021 02:51:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbzoq1bhb0rTFis4TwPTFB3AKHPfvwmUHkh0dgKLwuiIbHJ/4J7kDFGq9c4kYEFn6Zka0M X-Received: by 2002:a05:6402:206d:: with SMTP id bd13mr14064976edb.38.1618048271161; Sat, 10 Apr 2021 02:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618048271; cv=none; d=google.com; s=arc-20160816; b=eFHNsCxGfnw1Cke2wPntL2Ozvz9qFGJvKf4AkKfz8m8i/uX3JVeGpmGS6uNvAgVGR8 fADpjUCoKuQqjwBfty+YcmSgZyVjkO+7LAA+YhuK02jCttPmYRoayaGVVjvhEBA4spUL uXksVZAhiljtC2TZWukM0PdnxpmywH2c8S83azFNC0Mtz/B8fy2hX2dOhwoSZ8ucdNZ7 4xs6vnEv6Twl2Yluf63gJaRFxt6GmUQZm4qwzsvLKrVHXvH0xixCVDywNUhDaZ5G69zy yVu/F6AdGCtmMwPfIxlLcKn+HdK8XNrWzx/DpEtU98zBNQMIymCEqNbWLJBtiVatftBP PiAA== 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=wIZK85kVOAoXPMQ3OqIfGUZQakSmElBPrSDGRgwnkTw=; b=XURP6qyKVnG1dQC+0mSqwQyaxeKFK1rjAfMFvBT93ls5S0TGx/AZXQ+ldLpMZyuyMi zorO7jO7vCqZ23VasYCUI0hkEZGzZJ+DEJ1o8bx3cq3dDwf3OSWEF7CEBGJB0mjPWJhZ pU38/5XT8wsrykTui+8RS7bUFih1/LnBHUSCfLAyxvRpYUjFQtFt+ZPKLBs5v18lCqFY zN+IUZx1Uw9btqJNwBOan2ETIn8S/1VkjrECUy5azCsFjbCjNgpYWXcnm4/f5RhSE6me lqunXaMLayB3wmUjonCAF5JxzzuxXhEu6xNygq8FKKcEqMLwCVjCXBKCowuj6stJCfbI toMg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s22si3822932eds.598.2021.04.10.02.50.48; Sat, 10 Apr 2021 02:51:11 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234618AbhDJJuz (ORCPT + 99 others); Sat, 10 Apr 2021 05:50:55 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:16563 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233943AbhDJJuy (ORCPT ); Sat, 10 Apr 2021 05:50:54 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FHVYg25JQz17RFW; Sat, 10 Apr 2021 17:48:23 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Sat, 10 Apr 2021 17:50:28 +0800 From: Hui Tang To: , CC: , , , Subject: [PATCH 3/3] crypto: hisilicon/hpre - add debug log Date: Sat, 10 Apr 2021 17:47:01 +0800 Message-ID: <1618048021-50335-4-git-send-email-tanghui20@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1618048021-50335-1-git-send-email-tanghui20@huawei.com> References: <1618048021-50335-1-git-send-email-tanghui20@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org When the received sqe is abnormal, the error message in the sqe written back by the hardware is printed to help to analyze the abnormal causes. Signed-off-by: Hui Tang --- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/crypto/hisilicon/hpre/hpre_crypto.c index 0adaf92..c8531c0 100644 --- a/drivers/crypto/hisilicon/hpre/hpre_crypto.c +++ b/drivers/crypto/hisilicon/hpre/hpre_crypto.c @@ -325,14 +325,16 @@ static void hpre_hw_data_clr_all(struct hpre_ctx *ctx, static int hpre_alg_res_post_hf(struct hpre_ctx *ctx, struct hpre_sqe *sqe, void **kreq) { + struct device *dev = HPRE_DEV(ctx); struct hpre_asym_request *req; - unsigned int err, done; + unsigned int err, done, alg; int id; #define HPRE_NO_HW_ERR 0 #define HPRE_HW_TASK_DONE 3 #define HREE_HW_ERR_MASK 0x7ff #define HREE_SQE_DONE_MASK 0x3 +#define HREE_ALG_TYPE_MASK 0x1f id = (int)le16_to_cpu(sqe->tag); req = ctx->req_list[id]; hpre_rm_req_from_ctx(req); @@ -347,6 +349,10 @@ static int hpre_alg_res_post_hf(struct hpre_ctx *ctx, struct hpre_sqe *sqe, if (likely(err == HPRE_NO_HW_ERR && done == HPRE_HW_TASK_DONE)) return 0; + alg = le32_to_cpu(sqe->dw0) & HREE_ALG_TYPE_MASK; + dev_err_ratelimited(dev, "alg[0x%x] error: done[0x%x], etype[0x%x]\n", + alg, done, err); + return -EINVAL; } -- 2.8.1