Files
Dmitry Torokhov 8164e5fd1b HID: i2c-hid: ensure various commands do not interfere with each other
[ Upstream commit b4ed18a3d5 ]

i2c-hid uses 2 shared buffers: command and "raw" input buffer for
sending requests to peripherals and read data from peripherals when
executing variety of commands. Such commands include reading of HID
registers, requesting particular power mode, getting and setting
reports and so on. Because all such requests use the same 2 buffers
they should not execute simultaneously.

Fix this by introducing "cmd_lock" mutex and acquire it whenever
we needs to access ihid->cmdbuf or idid->rawbuf.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-10-10 12:00:39 +02:00
..
2024-09-12 11:13:10 +02:00
2023-10-25 18:33:42 +02:00
2022-02-02 15:12:22 +01:00