diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2015-03-08 16:07:41 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-03-10 05:48:56 -0400 |
commit | 9b2de7ff424220c731276aaef9025cdd1d4052a8 (patch) | |
tree | 8dc84a967ea0fc79af9329d56ad77db845f7b026 /arch/mips/cavium-octeon | |
parent | 3265c4babe93832167cb148083a0544548c23e6a (diff) |
crypto: octeon - don't disable bottom half in octeon-md5
Don't disable bottom half while the crypto engine is in use, as it
should be unnecessary: All kernel crypto engine usage is wrapped with
crypto engine state save/restore, so if we get interrupted by softirq
that uses crypto they should save and restore our context.
This actually fixes an issue when running OCTEON MD5 with interrupts
disabled (tcrypt mode=302). There's a WARNING because the module is
trying to enable the bottom half with irqs disabled:
[ 52.656610] ------------[ cut here ]------------
[ 52.661439] WARNING: CPU: 1 PID: 428 at /home/aaro/git/linux/kernel/softirq.c:150 __local_bh_enable_ip+0x9c/0xd8()
[ 52.671780] Modules linked in: tcrypt(+)
[...]
[ 52.763539] [<ffffffff8114082c>] warn_slowpath_common+0x94/0xd8
[ 52.769465] [<ffffffff81144614>] __local_bh_enable_ip+0x9c/0xd8
[ 52.775390] [<ffffffff81119574>] octeon_md5_final+0x12c/0x1e8
[ 52.781144] [<ffffffff81337050>] shash_compat_digest+0xd0/0x1b0
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')
-rw-r--r-- | arch/mips/cavium-octeon/crypto/octeon-md5.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/arch/mips/cavium-octeon/crypto/octeon-md5.c b/arch/mips/cavium-octeon/crypto/octeon-md5.c index b909881ba6c1..3dd88450d440 100644 --- a/arch/mips/cavium-octeon/crypto/octeon-md5.c +++ b/arch/mips/cavium-octeon/crypto/octeon-md5.c | |||
@@ -97,7 +97,6 @@ static int octeon_md5_update(struct shash_desc *desc, const u8 *data, | |||
97 | memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), data, | 97 | memcpy((char *)mctx->block + (sizeof(mctx->block) - avail), data, |
98 | avail); | 98 | avail); |
99 | 99 | ||
100 | local_bh_disable(); | ||
101 | preempt_disable(); | 100 | preempt_disable(); |
102 | flags = octeon_crypto_enable(&state); | 101 | flags = octeon_crypto_enable(&state); |
103 | octeon_md5_store_hash(mctx); | 102 | octeon_md5_store_hash(mctx); |
@@ -115,7 +114,6 @@ static int octeon_md5_update(struct shash_desc *desc, const u8 *data, | |||
115 | octeon_md5_read_hash(mctx); | 114 | octeon_md5_read_hash(mctx); |
116 | octeon_crypto_disable(&state, flags); | 115 | octeon_crypto_disable(&state, flags); |
117 | preempt_enable(); | 116 | preempt_enable(); |
118 | local_bh_enable(); | ||
119 | 117 | ||
120 | memcpy(mctx->block, data, len); | 118 | memcpy(mctx->block, data, len); |
121 | 119 | ||
@@ -133,7 +131,6 @@ static int octeon_md5_final(struct shash_desc *desc, u8 *out) | |||
133 | 131 | ||
134 | *p++ = 0x80; | 132 | *p++ = 0x80; |
135 | 133 | ||
136 | local_bh_disable(); | ||
137 | preempt_disable(); | 134 | preempt_disable(); |
138 | flags = octeon_crypto_enable(&state); | 135 | flags = octeon_crypto_enable(&state); |
139 | octeon_md5_store_hash(mctx); | 136 | octeon_md5_store_hash(mctx); |
@@ -153,7 +150,6 @@ static int octeon_md5_final(struct shash_desc *desc, u8 *out) | |||
153 | octeon_md5_read_hash(mctx); | 150 | octeon_md5_read_hash(mctx); |
154 | octeon_crypto_disable(&state, flags); | 151 | octeon_crypto_disable(&state, flags); |
155 | preempt_enable(); | 152 | preempt_enable(); |
156 | local_bh_enable(); | ||
157 | 153 | ||
158 | memcpy(out, mctx->hash, sizeof(mctx->hash)); | 154 | memcpy(out, mctx->hash, sizeof(mctx->hash)); |
159 | memset(mctx, 0, sizeof(*mctx)); | 155 | memset(mctx, 0, sizeof(*mctx)); |