lkml.org 
[lkml]   [2023]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/2] crypto: starfive - Add RSA algo support
On Fri, Jun 02, 2023 at 10:55:51AM +0800, Jia Jie Ho wrote:
>
> +static inline void starfive_pka_irq_mask_clear(struct starfive_cryp_ctx *ctx)
> +{
> + struct starfive_cryp_dev *cryp = ctx->cryp;
> + u32 stat;
> +
> + reinit_completion(&cryp->pka_done);
> +
> + stat = readl(cryp->base + STARFIVE_IE_MASK_OFFSET);
> + stat &= ~STARFIVE_IE_MASK_PKA_DONE;
> + writel(stat, cryp->base + STARFIVE_IE_MASK_OFFSET);
> +}

Shouldn't the order of reinit_completion and the register write
be reversed? Otherwise what's to stop a spurious interrupt from
completing pka_done prematurely?

Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

\
 
 \ /
  Last update: 2023-06-09 11:06    [W:0.185 / U:1.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site