RE: [PATCH] HID: intel-thc-hid: intel-thc: raw spinlocks for registers
From: Xu, Even
Date: Thu Nov 19 2026 - 19:12:40 EST
> -----Original Message-----
> From: Emfox Zhou <emfox@xxxxxxxxxx>
> Sent: Wednesday, November 18, 2026 2:57 PM
> To: Xu, Even <even.xu@xxxxxxxxx>; Sun, Xinpeng <xinpeng.sun@xxxxxxxxx>; Jiri
> Kosina <jikos@xxxxxxxxxx>; Benjamin Tissoires <bentiss@xxxxxxxxxx>
> Cc: linux-input@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Subject: [PATCH] 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.
Make sense.
Thanks for the patch!
Reviewed-by: Even Xu <even.xu@xxxxxxxxx>
>
> Signed-off-by: Emfox Zhou <emfox@xxxxxxxxxx>
> ---
> drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c b/drivers/hid/intel-
> thc-hid/intel-thc/intel-thc-dev.c
> index 7feda4160..e318f26ad 100644
> --- a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c
> +++ b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c
> @@ -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