HID: intel-thc-hid: intel-thc: raw spinlocks for registers
Subsystems (2)
PATCH 1/1 HID: intel-thc-hid: intel-thc: raw spinlocks for registers
The primary interrupt handlers of intel-quickspi, intel-quicki2c and intel-ipts reach the registers from hardirq context. The map is a fast_io one, so its lock is a spinlock_t, which on PREEMPT_RT is a sleeping lock:
taking it there is an invalid wait context.
Ask for a raw spinlock instead. The accessors only touch MMIO, and the map is fast_io precisely because it is used where sleeping is not possible, so nothing else changes.
--- drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c | 1 + 1 file changed, 1 insertion(+)
drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c +1 -0
@@ -49,6 +49,7 @@ static const struct regmap_config thc_regmap_cfg = { .reg_write = thc_regmap_write, .cache_type = REGCACHE_NONE, .fast_io = true, + .use_raw_spinlock = true, .rd_table = &thc_rw_table, .wr_table = &thc_rw_table, .volatile_table = &thc_rw_table,
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] HID: intel-thc-hid: missing Fixes trailer for thc_regmap_cfg raw spinlock fix --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] HID: intel-thc-hid: missing Fixes trailer for thc_regmap_cfg raw spinlock fix
--
commit 68e15b8b74f173320164f31790193df2ee43dccc
Author: Emfox Zhou <[email protected]>
Quoted 7 lines
HID: intel-thc-hid: intel-thc: raw spinlocks for registers
The primary interrupt handlers of intel-quickspi, intel-quicki2c and intel-ipts reach the registers from hardirq context. The map is a
fast_ioone, so its lock is aspinlock_t, which onPREEMPT_RTis a sleeping lock:
taking it there is an invalid wait context.
Quoted 5 lines
Ask for a raw spinlock instead. The accessors only touch MMIO, and the map is
fast_ioprecisely because it is used where sleeping is not possible, so nothing else changes.Signed-off-by Emfox Zhou <[email protected]>
[Severity: Low]
Since this fixes an invalid wait context when accessing thc_regmap_cfg from hardirq handlers, should this include a Fixes tag?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 10 lines
-----Original Message-----
From: Emfox Zhou <[email protected]>
Sent: Wednesday, November 18, 2026 2:57 PM
To: Xu, Even <[email protected]>; Sun, Xinpeng <[email protected]>; Jiri Kosina <[email protected]>; Benjamin Tissoires <[email protected]>
Cc: [email protected]; [email protected]
Subject: [PATCH] HID: intel-thc-hid: intel-thc: raw spinlocks for registers
Quoted 8 lines
The primary interrupt handlers of intel-quickspi, intel-quicki2c and intel-ipts reach the registers from hardirq context. The map is a
fast_ioone, so its lock is aspinlock_t, which onPREEMPT_RTis a sleeping lock:
taking it there is an invalid wait context.Ask for a raw spinlock instead. The accessors only touch MMIO, and the map is
fast_ioprecisely because it is used where sleeping is not possible, so nothing else changes.
Make sense.
Thanks for the patch!
Quoted 21 lines
Signed-off-by Emfox Zhou <[email protected]>--- drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c | 1 + 1 file changed, 1 insertion(+)drivers/hid/intel- renamed from drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c +0
-0
thc-hid/intel-thc/intel-thc-dev.c
index7feda4160..e318f26ad100644drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c +1
-0@@ -49,6 +49,7 @@ static const struct regmap_config thc_regmap_cfg = { .reg_write = thc_regmap_write, .cache_type = REGCACHE_NONE, .fast_io = true, + .use_raw_spinlock = true, .rd_table = &thc_rw_table, .wr_table = &thc_rw_table, .volatile_table = &thc_rw_table,base-commit:
aebb7274476403040d582c61478df8f4a7bf9cd3