linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Longfang Liu <liulongfang@huawei.com>
To: <herbert@gondor.apana.org.au>
Cc: <linux-crypto@vger.kernel.org>
Subject: [PATCH 1/5] crypto: hisilicon/sec2 - clear SEC debug regs
Date: Fri, 26 Jun 2020 18:32:05 +0800	[thread overview]
Message-ID: <1593167529-22463-2-git-send-email-liulongfang@huawei.com> (raw)
In-Reply-To: <1593167529-22463-1-git-send-email-liulongfang@huawei.com>

From: Kai Ye <yekai13@huawei.com>

SEC debug registers aren't cleared even if its driver is removed,
so add a clearing operation in driver removing.

Signed-off-by: Kai Ye <yekai13@huawei.com>
Reviewed-by: Longfang Liu <liulongfang@huawei.com>
---
 drivers/crypto/hisilicon/sec2/sec_main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main.c
index a4cb58b..c2567cc 100644
--- a/drivers/crypto/hisilicon/sec2/sec_main.c
+++ b/drivers/crypto/hisilicon/sec2/sec_main.c
@@ -346,10 +346,17 @@ static int sec_set_user_domain_and_cache(struct hisi_qm *qm)
 /* sec_debug_regs_clear() - clear the sec debug regs */
 static void sec_debug_regs_clear(struct hisi_qm *qm)
 {
+	int i;
+
 	/* clear current_qm */
 	writel(0x0, qm->io_base + QM_DFX_MB_CNT_VF);
 	writel(0x0, qm->io_base + QM_DFX_DB_CNT_VF);
 
+	/* clear sec dfx regs */
+	writel(0x1, qm->io_base + SEC_CTRL_CNT_CLR_CE);
+	for (i = 0; i < ARRAY_SIZE(sec_dfx_regs); i++)
+		readl(qm->io_base + sec_dfx_regs[i].offset);
+
 	/* clear rdclr_en */
 	writel(0x0, qm->io_base + SEC_CTRL_CNT_CLR_CE);
 
-- 
2.8.1


  reply	other threads:[~2020-06-26 10:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26 10:32 [PATCH 0/5] crypto: hisilicon/sec2 - fix SEC bugs and coding styles Longfang Liu
2020-06-26 10:32 ` Longfang Liu [this message]
2020-06-26 10:32 ` [PATCH 2/5] crypto:hisilicon/sec2 - update busy processing logic Longfang Liu
2020-07-03  4:14   ` Herbert Xu
2020-07-03  8:18     ` liulongfang
2020-06-26 10:32 ` [PATCH 3/5] crypto: hisilicon/sec2 - update SEC initialization and reset Longfang Liu
2020-06-26 10:32 ` [PATCH 4/5] crypto: hisilicon/sec2 - update debugfs interface parameters Longfang Liu
2020-06-26 10:32 ` [PATCH 5/5] crypto: hisilicon/sec2 - fix some coding styles Longfang Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1593167529-22463-2-git-send-email-liulongfang@huawei.com \
    --to=liulongfang@huawei.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).