Skip to content

Commit

Permalink
crypto: hisilicon/sec2 - clear SEC debug regs
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Longfang Liu <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
yekai123123 authored and herbertx committed Jul 16, 2020
1 parent eeedb61 commit 7dc95d0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/crypto/hisilicon/sec2/sec_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 7dc95d0

Please sign in to comment.