Messages in this thread | | | Date | Fri, 9 Jun 2023 17:04:14 +0800 | From | Herbert Xu <> | Subject | Re: [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
| |