mirror-linux/drivers/base/regmap
Cheng-Yu Lee 4b58aac989
regmap: Fix race condition in hwspinlock irqsave routine
Previously, the address of the shared member '&map->spinlock_flags' was
passed directly to 'hwspin_lock_timeout_irqsave'. This creates a race
condition where multiple contexts contending for the lock could overwrite
the shared flags variable, potentially corrupting the state for the
current lock owner.

Fix this by using a local stack variable 'flags' to store the IRQ state
temporarily.

Fixes: 8698b93647 ("regmap: Add hardware spinlock support")
Signed-off-by: Cheng-Yu Lee <cylee12@realtek.com>
Co-developed-by: Yu-Chun Lin <eleanor.lin@realtek.com>
Signed-off-by: Yu-Chun Lin <eleanor.lin@realtek.com>
Link: https://patch.msgid.link/20260109032633.8732-1-eleanor.lin@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-01-12 12:25:29 +00:00
..
Kconfig regmap: Move selecting for REGMAP_MDIO and REGMAP_IRQ 2025-05-20 10:25:08 +01:00
Makefile
internal.h regcache: Add ->populate() callback to separate from ->init() 2025-10-31 12:01:51 +00:00
regcache-flat.c regcache: flat: Split ->populate() from ->init() 2025-10-31 12:01:54 +00:00
regcache-maple.c regmap: maple: free entry on mas_store_gfp() failure 2026-01-05 13:14:50 +00:00
regcache-rbtree.c regcache: rbtree: Split ->populate() from ->init() 2025-10-31 12:01:52 +00:00
regcache.c regcache: Add ->populate() callback to separate from ->init() 2025-10-31 12:01:51 +00:00
regmap-ac97.c regmap: add missing MODULE_DESCRIPTION() macros 2024-06-24 13:38:40 +01:00
regmap-debugfs.c regmap: get rid of redundant debugfs_file_{get,put}() 2025-07-04 13:18:13 +01:00
regmap-fsi.c
regmap-i2c.c regmap-i2c: add missing MODULE_DESCRIPTION() macro 2024-06-14 15:23:14 +01:00
regmap-i3c.c I3C for 6.19 2025-12-08 11:25:14 +09:00
regmap-irq.c regmap: irq: Avoid lockdep warnings with nested regmap-irq chips 2025-08-01 13:37:07 +01:00
regmap-kunit.c regmap: add flat cache with sparse validity 2025-10-29 12:54:04 +00:00
regmap-mdio.c regmap: Drop capitalisation in MODULE_DESCRIPTION() 2024-04-10 22:45:52 +01:00
regmap-mmio.c regmap: mmio: Add missing MODULE_DESCRIPTION() 2025-08-10 21:09:27 +01:00
regmap-ram.c regmap: add missing MODULE_DESCRIPTION() macros 2024-06-24 13:38:40 +01:00
regmap-raw-ram.c regmap: add missing MODULE_DESCRIPTION() macros 2024-06-24 13:38:40 +01:00
regmap-sccb.c regmap: add missing MODULE_DESCRIPTION() macros 2024-06-24 13:38:40 +01:00
regmap-sdw-mbq.c regmap: Updates for v6.19 2025-12-04 11:16:44 -08:00
regmap-sdw.c regmap: Drop capitalisation in MODULE_DESCRIPTION() 2024-04-10 22:45:52 +01:00
regmap-slimbus.c regmap: slimbus: fix bus_context pointer in regmap init calls 2025-10-23 15:19:58 +01:00
regmap-spi-avmm.c regmap: add missing MODULE_DESCRIPTION() macros 2024-06-24 13:38:40 +01:00
regmap-spi.c regmap: spi: Fix potential off-by-one when calculating reserved size 2024-06-05 22:23:52 +01:00
regmap-spmi.c regmap: add missing MODULE_DESCRIPTION() macros 2024-06-24 13:38:40 +01:00
regmap-w1.c regmap: add missing MODULE_DESCRIPTION() macros 2024-06-24 13:38:40 +01:00
regmap.c regmap: Fix race condition in hwspinlock irqsave routine 2026-01-12 12:25:29 +00:00
trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00