[PATCH resend 13/15] arm64/crypto: add voluntary preemption to Crypto Extensions SHA1
Herbert Xu
herbert at gondor.apana.org.au
Tue May 13 18:36:39 PDT 2014
Ard Biesheuvel <ard.biesheuvel at linaro.org> wrote:
>
> + /*
> + * Pass current's thread info pointer to sha1_ce_transform()
> + * below if we want it to play nice under preemption.
> + */
> + if ((IS_ENABLED(CONFIG_PREEMPT_VOLUNTARY) ||
> + IS_ENABLED(CONFIG_PREEMPT)) && !in_interrupt())
> + ti = current_thread_info();
Instead of in_interrupt you should test CRYPTO_TFM_REQ_MAY_SLEEP.
It's not a matter of correctness but it may avoid unnecessary
breaks in the loop.
Cheers,
--
Email: Herbert Xu <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
More information about the linux-arm-kernel
mailing list