linux-stable/drivers/hid
Nam Cao 5095b93021 HID: i2c-hid: remove I2C_HID_READ_PENDING flag to prevent lock-up
commit 9c0f59e47a 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: 4a200c3b9a ("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>
2024-05-02 16:23:46 +02:00
..
i2c-hid HID: i2c-hid: remove I2C_HID_READ_PENDING flag to prevent lock-up 2024-05-02 16:23:46 +02:00
intel-ish-hid
usbhid
Kconfig
Makefile
hid-a4tech.c
hid-accutouch.c
hid-alps.c
hid-apple.c HID: apple: Add 2021 magic keyboard FN key mapping 2024-02-23 08:42:17 +01:00
hid-appleir.c
hid-asus.c
hid-aureal.c
hid-axff.c
hid-belkin.c
hid-betopff.c
hid-bigbenff.c
hid-cherry.c
hid-chicony.c
hid-cmedia.c
hid-core.c
hid-corsair.c
hid-cougar.c
hid-cp2112.c
hid-creative-sb0540.c
hid-cypress.c
hid-debug.c
hid-dr.c
hid-elan.c
hid-elecom.c
hid-elo.c
hid-emsff.c
hid-ezkey.c
hid-gaff.c
hid-gembird.c
hid-generic.c
hid-gfrm.c
hid-glorious.c
hid-google-hammer.c
hid-gt683r.c
hid-gyration.c
hid-holtek-kbd.c
hid-holtek-mouse.c
hid-holtekff.c
hid-hyperv.c
hid-icade.c
hid-ids.h
hid-input.c
hid-ite.c
hid-jabra.c
hid-kensington.c
hid-keytouch.c
hid-kye.c
hid-lcpower.c
hid-led.c
hid-lenovo.c HID: lenovo: Add middleclick_workaround sysfs knob for cptkbd 2024-03-26 18:21:55 -04:00
hid-lg-g15.c
hid-lg.c
hid-lg.h
hid-lg2ff.c
hid-lg3ff.c
hid-lg4ff.c
hid-lg4ff.h
hid-lgff.c
hid-logitech-dj.c
hid-logitech-hidpp.c
hid-macally.c
hid-magicmouse.c
hid-maltron.c
hid-mcp2221.c
hid-mf.c
hid-microsoft.c
hid-monterey.c
hid-multitouch.c HID: multitouch: Add required quirk for Synaptics 0xcddc device 2024-03-26 18:21:46 -04:00
hid-nti.c
hid-ntrig.c
hid-ortek.c
hid-penmount.c
hid-petalynx.c
hid-picolcd.h
hid-picolcd_backlight.c
hid-picolcd_cir.c
hid-picolcd_core.c
hid-picolcd_debugfs.c
hid-picolcd_fb.c
hid-picolcd_lcd.c
hid-picolcd_leds.c
hid-pl.c
hid-plantronics.c
hid-primax.c
hid-prodikeys.c
hid-quirks.c
hid-redragon.c
hid-retrode.c
hid-rmi.c
hid-roccat-arvo.c
hid-roccat-arvo.h
hid-roccat-common.c
hid-roccat-common.h
hid-roccat-isku.c
hid-roccat-isku.h
hid-roccat-kone.c
hid-roccat-kone.h
hid-roccat-koneplus.c
hid-roccat-koneplus.h
hid-roccat-konepure.c
hid-roccat-kovaplus.c
hid-roccat-kovaplus.h
hid-roccat-lua.c
hid-roccat-lua.h
hid-roccat-pyra.c
hid-roccat-pyra.h
hid-roccat-ryos.c
hid-roccat-savu.c
hid-roccat-savu.h
hid-roccat.c
hid-saitek.c
hid-samsung.c
hid-sensor-custom.c
hid-sensor-hub.c
hid-sjoy.c
hid-sony.c
hid-speedlink.c
hid-steam.c
hid-steelseries.c
hid-sunplus.c
hid-tivo.c
hid-tmff.c
hid-topseed.c
hid-twinhan.c
hid-u2fzero.c
hid-uclogic-core.c
hid-uclogic-params.c
hid-uclogic-params.h
hid-uclogic-rdesc.c
hid-uclogic-rdesc.h
hid-udraw-ps3.c
hid-viewsonic.c
hid-vivaldi.c
hid-waltop.c
hid-wiimote-core.c
hid-wiimote-debug.c
hid-wiimote-modules.c
hid-wiimote.h
hid-xinmo.c
hid-zpff.c
hid-zydacron.c
hidraw.c
uhid.c
wacom.h
wacom_sys.c HID: wacom: Do not register input devices until after hid_hw_start 2024-02-23 08:42:24 +01:00
wacom_wac.c HID: wacom: generic: Avoid reporting a serial of '0' to userspace 2024-02-23 08:42:24 +01:00
wacom_wac.h