summaryrefslogtreecommitdiff
path: root/lib/lru_cache.c
diff options
context:
space:
mode:
authorNam Cao <namcao@linutronix.de>2024-03-18 13:59:02 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-05-02 17:17:14 +0300
commit21bfca822cfc1e71796124e93b46e0d9fa584401 (patch)
treec1b83fbf42955e32c179bc0daaca7f231c10cddb /lib/lru_cache.c
parent40f1d79f07b49c8a64a861706e5163f2db4bd95d (diff)
downloadlinux-21bfca822cfc1e71796124e93b46e0d9fa584401.tar.xz
HID: i2c-hid: remove I2C_HID_READ_PENDING flag to prevent lock-up
commit 9c0f59e47a90c54d0153f8ddc0f80d7a36207d0e upstream. The flag I2C_HID_READ_PENDING is used to serialize I2C operations. However, this is not necessary, because I2C core already has its own locking for that. More importantly, this flag can cause a lock-up: if the flag is set in i2c_hid_xfer() and an interrupt happens, the interrupt handler (i2c_hid_irq) will check this flag and return immediately without doing anything, then the interrupt handler will be invoked again in an infinite loop. Since interrupt handler is an RT task, it takes over the CPU and the flag-clearing task never gets scheduled, thus we have a lock-up. Delete this unnecessary flag. Reported-and-tested-by: Eva Kurchatova <nyandarknessgirl@gmail.com> Closes: https://lore.kernel.org/r/CA+eeCSPUDpUg76ZO8dszSbAGn+UHjcyv8F1J-CUPVARAzEtW9w@mail.gmail.com Fixes: 4a200c3b9a40 ("HID: i2c-hid: introduce HID over i2c specification implementation") Cc: <stable@vger.kernel.org> Signed-off-by: Nam Cao <namcao@linutronix.de> Signed-off-by: Jiri Kosina <jkosina@suse.com> [apply to v4.19 -> v5.15] Signed-off-by: Nam Cao <namcao@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/lru_cache.c')
0 files changed, 0 insertions, 0 deletions