diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2015-03-08 23:07:42 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-03-10 12:48:57 +0300 |
commit | c3bc38d9fb30cca2567a4f6f0d52a12d4565c7e5 (patch) | |
tree | 36783922bc5299a6693fa91b9d3a7a1fe9754912 /arch/mips/cavium-octeon/crypto/octeon-crypto.c | |
parent | 9b2de7ff424220c731276aaef9025cdd1d4052a8 (diff) | |
download | linux-c3bc38d9fb30cca2567a4f6f0d52a12d4565c7e5.tar.xz |
crypto: octeon - always disable preemption when using crypto engine
Always disable preemption on behalf of the drivers when crypto engine
is taken into use. This will simplify the usage.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/mips/cavium-octeon/crypto/octeon-crypto.c')
-rw-r--r-- | arch/mips/cavium-octeon/crypto/octeon-crypto.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/mips/cavium-octeon/crypto/octeon-crypto.c b/arch/mips/cavium-octeon/crypto/octeon-crypto.c index 7c82ff463b65..f66bd1adc7ff 100644 --- a/arch/mips/cavium-octeon/crypto/octeon-crypto.c +++ b/arch/mips/cavium-octeon/crypto/octeon-crypto.c @@ -17,7 +17,7 @@ * crypto operations in calls to octeon_crypto_enable/disable in order to make * sure the state of COP2 isn't corrupted if userspace is also performing * hardware crypto operations. Allocate the state parameter on the stack. - * Preemption must be disabled to prevent context switches. + * Returns with preemption disabled. * * @state: Pointer to state structure to store current COP2 state in. * @@ -28,6 +28,7 @@ unsigned long octeon_crypto_enable(struct octeon_cop2_state *state) int status; unsigned long flags; + preempt_disable(); local_irq_save(flags); status = read_c0_status(); write_c0_status(status | ST0_CU2); @@ -62,5 +63,6 @@ void octeon_crypto_disable(struct octeon_cop2_state *state, else write_c0_status(read_c0_status() & ~ST0_CU2); local_irq_restore(flags); + preempt_enable(); } EXPORT_SYMBOL_GPL(octeon_crypto_disable); |