]> git.ipfire.org Git - thirdparty/linux.git/commit
HID: Intel-ish-hid: Ishtp: Fix sensor reads after ACPI S3 suspend
authorEven Xu <even.xu@intel.com>
Fri, 9 Feb 2024 06:52:32 +0000 (14:52 +0800)
committerJiri Kosina <jkosina@suse.com>
Tue, 13 Feb 2024 10:31:08 +0000 (11:31 +0100)
commitbdab6c94bb24758081625e619330b04cfd56570a
tree5066daaecce7a3393c4524844eb87c4fa96d82c1
parent1741a8269e1c51fa08d4bfdf34667387a6eb10ec
HID: Intel-ish-hid: Ishtp: Fix sensor reads after ACPI S3 suspend

After legacy suspend/resume via ACPI S3, sensor read operation fails
with timeout. Also, it will cause delay in resume operation as there
will be retries on failure.

This is caused by commit f645a90e8ff7 ("HID: intel-ish-hid:
ishtp-hid-client: use helper functions for connection"), which used
helper functions to simplify connect, reset and disconnect process.
Also avoid freeing and allocating client buffers again during reconnect
process.

But there is a case, when ISH firmware resets after ACPI S3 suspend,
ishtp bus driver frees client buffers. Since there is no realloc again
during reconnect, there are no client buffers available to send connection
requests to the firmware. Without successful connection to the firmware,
subsequent sensor reads will timeout.

To address this issue, ishtp bus driver does not free client buffers on
warm reset after S3 resume. Simply add the buffers from the read list
to free list of buffers.

Fixes: f645a90e8ff7 ("HID: intel-ish-hid: ishtp-hid-client: use helper functions for connection")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218442
Signed-off-by: Even Xu <even.xu@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/intel-ish-hid/ishtp/bus.c
drivers/hid/intel-ish-hid/ishtp/client.c