linux/drivers/crypto
Svyatoslav Pankratov 55ece6d9c3 crypto: qat - fix state restore for banks with exceptions
[ Upstream commit 254923ca87 ]

Change the logic in the restore function to properly handle bank
exceptions.

The check for exceptions in the saved state should be performed before
conducting any other ringstat register checks.
If a bank was saved with an exception, the ringstat will have the
appropriate rp_halt/rp_exception bits set, causing the driver to exit
the restore process with an error. Instead, the restore routine should
first check the ringexpstat register, and if any exception was raised,
it should stop further checks and return without any error. In other
words, if a ring pair is in an exception state at the source, it should
be restored the same way at the destination but without raising an error.

Even though this approach might lead to losing the exception state
during migration, the driver will log the exception from the saved state
during the restore process.

Signed-off-by: Svyatoslav Pankratov <svyatoslav.pankratov@intel.com>
Fixes: bbfdde7d19 ("crypto: qat - add bank save and restore flows")
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-08-15 12:13:49 +02:00
..
allwinner crypto: sun8i-ce - fix nents passed to dma_unmap_sg() 2025-08-15 12:13:49 +02:00
amcc crypto: crypto4xx - Remove unused declaration crypto4xx_free_ctx() 2024-08-30 18:22:31 +08:00
amlogic crypto: amlogic - Remove unused declaration meson_enqueue() 2024-08-30 18:22:31 +08:00
aspeed crypto: aspeed - Remove cfb and ofb 2023-12-08 11:59:45 +08:00
axis crypto: axis - Remove unused struct 'dbgfs_u32' 2024-05-31 17:34:56 +08:00
bcm crypto: bcm - add error check in the ahash_hmac_init function 2024-12-05 14:01:20 +01:00
caam crypto: caam/qi - Fix drv_ctx refcount bug 2025-04-25 10:47:52 +02:00
cavium crypto: cavium - Fix an error handling path in cpt_ucode_load_fw() 2024-12-05 14:01:21 +01:00
ccp crypto: ccp - Add support for PCI device 0x1134 2025-05-02 07:59:14 +02:00
ccree crypto: ccree - Remove unused struct 'tdes_keys' 2024-05-31 17:34:56 +08:00
chelsio crypto: chelsio - stop using crypto_ahash::init 2023-10-27 18:04:29 +08:00
gemini crypto: sl3516 - Remove unused declaration sl3516_ce_enqueue() 2024-08-30 18:22:31 +08:00
hisilicon crypto: hisilicon/sec2 - fix for aead auth key length 2025-04-10 14:39:21 +02:00
inside-secure crypto: inside-secure - Fix the return value of safexcel_xcbcmac_cra_init() 2024-12-05 14:01:19 +01:00
intel crypto: qat - fix state restore for banks with exceptions 2025-08-15 12:13:49 +02:00
marvell crypto: marvell/cesa - Fix engine load inaccuracy 2025-08-15 12:13:49 +02:00
nx crypto: nx - Fix uninitialised hv_nxc on error 2025-04-10 14:39:21 +02:00
qce crypto: qce - unregister previously registered algos in error path 2025-02-17 10:05:37 +01:00
rockchip move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
starfive crypto: starfive - Fix nent assignment in rsa dec 2024-07-06 10:20:00 +10:00
stm32 move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
tegra crypto: tegra - Fix IV usage for AES ECB 2025-04-25 10:47:39 +02:00
virtio virtio: rename virtio_find_vqs_info() to virtio_find_vqs() 2024-07-17 05:20:58 -04:00
xilinx crypto: zynqmp-sha - Add locking 2025-07-10 16:04:54 +02:00
atmel-aes-regs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel-aes.c crypto: atmel - use devm_clk_get_prepared() helpers 2024-08-30 18:23:43 +08:00
atmel-authenc.h crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
atmel-ecc.c crypto: drivers - Explicitly include correct DT includes 2023-08-23 11:04:23 +08:00
atmel-i2c.c crypto: atmel-sha204a - add reading from otp zone 2024-05-10 17:15:25 +08:00
atmel-i2c.h crypto: atmel-sha204a - add reading from otp zone 2024-05-10 17:15:25 +08:00
atmel-sha-regs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel-sha.c crypto: atmel - use devm_clk_get_prepared() helpers 2024-08-30 18:23:43 +08:00
atmel-sha204a.c crypto: atmel-sha204a - Set hwrng quality to lowest possible 2025-05-02 07:59:05 +02:00
atmel-tdes-regs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
atmel-tdes.c crypto: atmel - Remove cfb and ofb 2023-12-08 11:59:45 +08:00
exynos-rng.c crypto: exynos-rng - Convert to platform remove callback returning void 2023-10-27 18:04:26 +08:00
geode-aes.c crypto: geode - use DEFINE_SPINLOCK() for spinlock 2021-04-16 21:16:31 +10:00
geode-aes.h crypto: geode-aes - convert to skcipher API and make thread-safe 2019-10-23 19:46:56 +11:00
hifn_795x.c crypto: hifn_795x - Remove unused hifn_*_command structs 2024-05-31 17:34:56 +08:00
img-hash.c crypto: img-hash - use devm_clk_get_enabled() helpers 2024-08-30 18:23:43 +08:00
Kconfig Revert "crypto: spacc - Add SPAcc Skcipher support" 2024-09-04 07:09:51 +08:00
Makefile Revert "crypto: spacc - Add SPAcc Skcipher support" 2024-09-04 07:09:51 +08:00
mxs-dcp.c crypto: mxs-dcp - Only set OTP_KEY bit for OTP key 2025-05-29 11:02:26 +02:00
n2_asm.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
n2_core.c crypto: n2 - Set err to EINVAL if snprintf fails for hmac 2024-09-13 18:26:53 +08:00
n2_core.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
omap-aes-gcm.c crypto: omap - Use new crypto_engine_op interface 2023-08-18 17:01:11 +08:00
omap-aes.c crypto: omap-aes - Convert to platform remove callback returning void 2023-10-27 18:04:26 +08:00
omap-aes.h crypto: omap - Use new crypto_engine_op interface 2023-08-18 17:01:11 +08:00
omap-crypto.c crypto: omap - Avoid redundant copy when using truncated sg list 2021-08-21 15:44:53 +08:00
omap-crypto.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
omap-des.c crypto: omap-des - Convert to platform remove callback returning void 2023-10-27 18:04:26 +08:00
omap-sham.c crypto: omap-sham - stop setting alignmask for ahashes 2023-10-27 18:04:29 +08:00
padlock-aes.c crypto: algapi - Remove skbuff.h inclusion 2020-08-20 14:04:28 +10:00
padlock-sha.c crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
qcom-rng.c crypto: qcom-rng - rename *_of_data to *_match_data 2024-09-13 18:26:52 +08:00
s5p-sss.c crypto: s5p-sss - remove unnecessary alignmask for ahashes 2023-10-27 18:04:28 +08:00
sa2ul.c crypto: sa2ul - add missing MODULE_DESCRIPTION() macro 2024-06-07 19:47:58 +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: sahara - use 'time_left' variable with wait_for_completion_timeout() 2024-05-10 17:15:25 +08:00
talitos.c crypto: talitos - stop using crypto_ahash::init 2023-10-27 18:04:29 +08:00
talitos.h crypto: talitos - Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper 2022-10-21 19:05:24 +08:00