linux-stable/drivers/crypto
Longfang Liu 5b6af0a719 crypto: hisilicon/qm - prevent soft lockup in receive loop
[ Upstream commit 33fc506d2a ]

In the scenario where the accelerator business is fully loaded.
When the workqueue receiving messages and performing callback
processing, there are a large number of messages that need to be
received, and there are continuously messages that have been
processed and need to be received.
This will cause the receive loop here to be locked for a long time.
This scenario will cause watchdog timeout problems on OS with kernel
preemption turned off.

The error logs:
watchdog: BUG: soft lockup - CPU#23 stuck for 23s! [kworker/u262:1:1407]
[ 1461.978428][   C23] Call trace:
[ 1461.981890][   C23]  complete+0x8c/0xf0
[ 1461.986031][   C23]  kcryptd_async_done+0x154/0x1f4 [dm_crypt]
[ 1461.992154][   C23]  sec_skcipher_callback+0x7c/0xf4 [hisi_sec2]
[ 1461.998446][   C23]  sec_req_cb+0x104/0x1f4 [hisi_sec2]
[ 1462.003950][   C23]  qm_poll_req_cb+0xcc/0x150 [hisi_qm]
[ 1462.009531][   C23]  qm_work_process+0x60/0xc0 [hisi_qm]
[ 1462.015101][   C23]  process_one_work+0x1c4/0x470
[ 1462.020052][   C23]  worker_thread+0x150/0x3c4
[ 1462.024735][   C23]  kthread+0x108/0x13c
[ 1462.028889][   C23]  ret_from_fork+0x10/0x18

Therefore, it is necessary to add an actively scheduled operation in the
while loop to prevent this problem.
After adding it, no matter whether the OS turns on or off the kernel
preemption function. Neither will cause watchdog timeout issues.

Signed-off-by: Longfang Liu <liulongfang@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-28 17:14:49 +00:00
..
allwinner crypto: update some Arm documentation references 2023-06-13 03:47:38 -06:00
amcc crypto: crypto4xx - remove unnecessary (void*) conversions 2023-03-24 18:22:28 +08:00
amlogic crypto: amlogic - Remove kcalloc without check 2022-12-02 18:12:40 +08:00
aspeed crypto: aspeed - fix uninitialized symbol 'idx' warning 2023-03-14 17:06:45 +08:00
axis crypto: artpec6 - Use request_complete helpers 2023-02-13 18:34:49 +08:00
bcm crypto: bcm - Use request_complete helpers 2023-02-13 18:34:49 +08:00
caam crypto: caam/jr - fix Chacha20 + Poly1305 self test failure 2023-11-20 11:57:08 +01:00
cavium crypto: cavium/nitrox - remove unnecessary aer.h include 2023-03-17 11:16:43 +08:00
ccp crypto: ccp - Add support for PCI device 0x156E 2023-06-02 18:21:32 +08:00
ccree crypto: ccree - Use devm_platform_get_and_ioremap_resource() 2023-03-14 17:06:42 +08:00
chelsio crypto: chelsio - Use request_complete helpers 2023-02-13 18:34:49 +08:00
gemini Revert "crypto: gemini - Fix error check for dma_map_sg" 2022-09-02 18:15:53 +08:00
hisilicon crypto: hisilicon/qm - prevent soft lockup in receive loop 2023-11-28 17:14:49 +00:00
inside-secure crypto: safexcel - Cleanup ring IRQ workqueues on load failure 2023-03-14 17:06:44 +08:00
intel crypto: qat - fix deadlock in backlog processing 2023-11-20 11:57:11 +01:00
marvell This update includes the following changes: 2023-06-30 21:27:13 -07:00
nx crypto: nx - fix build warnings when DEBUG_FS is not enabled 2023-05-24 18:12:33 +08:00
qce crypto: qce - Add a QCE IP family compatible 'qcom,qce' 2023-03-14 17:06:44 +08:00
rockchip crypto: rockchip - Remove surplus dev_err() when using platform_get_irq() 2022-11-11 18:14:59 +08:00
starfive crypto: starfive - Add RSA algo support 2023-06-23 16:15:36 +08:00
stm32 crypto: stm32 - fix MDMAT condition 2023-09-13 09:53:56 +02:00
virtio virtio-crypto: handle config changed by work queue 2023-11-02 09:36:46 +01:00
vmx Merge branch 'topic/objtool' into next 2022-12-08 23:57:47 +11:00
xilinx crypto: xilinx: prevent probing on non-xilinx hardware 2022-03-09 15:12:31 +12:00
Kconfig s390 updates for 6.5 merge window part 2 2023-07-06 13:18:30 -07:00
Makefile crypto: starfive - Add crypto engine support 2023-05-19 16:46:22 +08:00
atmel-aes-regs.h
atmel-aes.c crypto: atmel-aes - Match cfb block size with generic implementation 2023-04-06 16:41:28 +08:00
atmel-authenc.h
atmel-ecc.c crypto: atmel - Switch i2c drivers back to use .probe() 2023-06-02 18:21:32 +08:00
atmel-i2c.c This update includes the following changes: 2023-02-21 18:10:50 -08:00
atmel-i2c.h This update includes the following changes: 2023-02-21 18:10:50 -08:00
atmel-sha-regs.h
atmel-sha.c crypto: atmel-sha - Add zero length message digest support for hmac 2023-04-06 16:41:28 +08:00
atmel-sha204a.c crypto: atmel - Switch i2c drivers back to use .probe() 2023-06-02 18:21:32 +08:00
atmel-tdes-regs.h
atmel-tdes.c crypto: atmel-tdes - Detecting in-place operations with two sg lists 2023-04-06 16:41:28 +08:00
exynos-rng.c
geode-aes.c
geode-aes.h
hifn_795x.c crypto: drivers - remove unnecessary (void*) conversions 2023-03-24 18:22:28 +08:00
img-hash.c crypto: img-hash - Fix img_hash_match unused warning 2023-03-31 17:50:09 +08:00
mxs-dcp.c crypto: mxs-dcp - Use the devm_clk_get_optional_enabled() helper 2023-03-31 17:50:09 +08:00
n2_asm.S
n2_core.c crypto: n2 - Use of_property_read_reg() to parse "reg" 2023-06-16 20:30:57 +08:00
n2_core.h
omap-aes-gcm.c
omap-aes.c crypto: omap-aes - Drop if with an always false condition 2022-07-15 16:43:21 +08:00
omap-aes.h
omap-crypto.c
omap-crypto.h
omap-des.c crypto: omap-des - Drop if with an always false condition 2022-07-15 16:43:21 +08:00
omap-sham.c crypto: omap-sham - Use pm_runtime_resume_and_get() in omap_sham_probe() 2022-12-02 18:12:40 +08:00
padlock-aes.c
padlock-sha.c
qcom-rng.c crypto: qcom-rng - Fix qcom_rng_of_match unused warning 2022-08-19 18:39:35 +08:00
s5p-sss.c crypto: s5p-sss - Use request_complete helpers 2023-02-13 18:35:14 +08:00
sa2ul.c crypto: drivers - remove unnecessary (void*) conversions 2023-03-24 18:22:28 +08:00
sa2ul.h crypto: sa2ul - change unsafe data size limit to 255 bytes 2023-05-19 16:45:43 +08:00
sahara.c crypto: drivers - remove unnecessary (void*) conversions 2023-03-24 18:22:28 +08:00
talitos.c crypto: talitos - Use request_complete helpers 2023-02-13 18:35:14 +08:00
talitos.h crypto: talitos - Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper 2022-10-21 19:05:24 +08:00