linux/drivers/crypto
Leonard Crestez d585747f95 crypto: mxs-dcp - Fix wait logic on chan threads
commit d80771c083 upstream.

When compiling with CONFIG_DEBUG_ATOMIC_SLEEP=y the mxs-dcp driver
prints warnings such as:

WARNING: CPU: 0 PID: 120 at kernel/sched/core.c:7736 __might_sleep+0x98/0x9c
do not call blocking ops when !TASK_RUNNING; state=1 set at [<8081978c>] dcp_chan_thread_sha+0x3c/0x2ec

The problem is that blocking ops will manipulate current->state
themselves so it is not allowed to call them between
set_current_state(TASK_INTERRUPTIBLE) and schedule().

Fix this by converting the per-chan mutex to a spinlock (it only
protects tiny list ops anyway) and rearranging the wait logic so that
callbacks are called current->state as TASK_RUNNING. Those callbacks
will indeed call blocking ops themselves so this is required.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-12-16 22:09:28 +00:00
..
amcc crypto: crypto4xx - Remove redundant dev_set_drvdata 2013-12-30 20:19:15 +08:00
caam crypto: caam - fix endless loop when DECO acquire fails 2018-06-16 22:22:11 +01:00
ccp crypto: ccp - Fix AES XTS error for request sizes above 4096 2016-08-22 22:38:05 +01:00
nx crypto: nx - off by one bug in nx_of_update_msc() 2016-11-20 01:16:53 +00:00
ux500 crypto: ux500 - memmove the right size 2016-08-22 22:38:14 +01:00
atmel-aes-regs.h crypto: atmel - add Atmel AES driver 2012-07-11 11:07:40 +08:00
atmel-aes.c crypto: atmel-aes - check alignment of cfb64 mode 2014-04-28 18:21:19 +08:00
atmel-sha-regs.h crypto: atmel-sha - add support for latest release of the IP (0x410) 2013-03-10 16:46:42 +08:00
atmel-sha.c crypto: atmel - only treat EBUSY as transient if backlog 2017-10-12 15:28:05 +01:00
atmel-tdes-regs.h crypto: atmel-tdes - add support for latest release of the IP (0x700) 2013-03-10 16:46:42 +08:00
atmel-tdes.c crypto: atmel-tdes - add support for Device Tree 2013-12-12 18:39:35 +01:00
bfin_crc.c crypto: hash - annotate algorithms taking optional key 2018-06-16 22:21:51 +01:00
bfin_crc.h crypto: bfin_crc - access crc registers by readl and writel functions 2014-04-16 20:40:15 +08:00
geode-aes.c crypto: geode - Don't use tfm->__crt_alg->cra_name directly 2014-05-22 21:03:13 +08:00
geode-aes.h crypto: geode - Consistently use AES_KEYSIZE_128 2014-05-22 21:03:12 +08:00
hifn_795x.c crypto: hifn_795x - Pass correct pointer to free_irq() 2013-05-28 15:43:04 +08:00
ixp4xx_crypto.c crypto: ixp4xx - Remove bogus BUG_ON on scattered dst buffer 2015-08-27 12:08:06 +01:00
Kconfig crypto/nx: disable NX on little endian builds 2014-06-11 17:03:19 +10:00
Makefile crypto: tegra - remove driver 2014-02-27 05:56:57 +08:00
mv_cesa.c crypto: cesa - tfm->__crt_alg->cra_type directly 2014-05-22 21:03:17 +08:00
mv_cesa.h crypto: mv_cesa - Add sha1 and hmac(sha1) async hash drivers 2010-04-13 16:50:49 +08:00
mxs-dcp.c crypto: mxs-dcp - Fix wait logic on chan threads 2018-12-16 22:09:28 +00:00
n2_asm.S crypto: n2 - Add Niagara2 crypto driver 2010-05-19 14:14:04 +10:00
n2_core.c crypto: n2 - cure use after free 2018-03-03 15:52:05 +00:00
n2_core.h crypto: n2 - Add Niagara2 crypto driver 2010-05-19 14:14:04 +10:00
omap-aes.c crypto: omap-aes - Fix support for unequal lengths 2015-05-06 11:33:03 +01:00
omap-des.c crypto: omap-des - Fix unmapping of dma channels 2015-08-10 09:54:10 +01:00
omap-sham.c crypto: omap-sham - Map SG pages if they are HIGHMEM before accessing 2014-03-10 20:17:13 +08:00
padlock-aes.c crypto: padlock-aes - Fix Nano workaround data corruption 2018-11-20 18:05:45 +00:00
padlock-sha.c crypto: prefix module autoloading with "crypto-" 2015-02-04 10:57:48 +00:00
picoxcell_crypto.c crypto: picoxcell - Use devm_ioremap_resource() 2014-02-27 05:56:47 +08:00
picoxcell_crypto_regs.h crypto: picoxcell - add support for the picoxcell crypto engines 2011-02-21 22:42:40 +11:00
s5p-sss.c crypto: s5p-sss - Fix kernel Oops in AES-ECB mode 2018-06-16 22:22:15 +01:00
sahara.c crypto: sahara - tfm->__crt_alg->cra_name directly 2014-05-22 21:03:16 +08:00
talitos.c crypto: talitos - Don't provide setkey for non hmac hashing algs. 2018-01-01 20:51:34 +00:00
talitos.h crypto: talitos - add sha224, sha384 and sha512 to existing AEAD algorithms 2012-07-11 11:08:29 +08:00