Skip to content

Commit bdab6c9

Browse files
EvenxfJiri Kosina
authored andcommitted
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 f645a90 ("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: f645a90 ("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>
1 parent 1741a82 commit bdab6c9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/hid/intel-ish-hid/ishtp/bus.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,8 @@ void ishtp_bus_remove_all_clients(struct ishtp_device *ishtp_dev,
722722
spin_lock_irqsave(&ishtp_dev->cl_list_lock, flags);
723723
list_for_each_entry(cl, &ishtp_dev->cl_list, link) {
724724
cl->state = ISHTP_CL_DISCONNECTED;
725+
if (warm_reset && cl->device->reference_count)
726+
continue;
725727

726728
/*
727729
* Wake any pending process. The waiter would check dev->state

drivers/hid/intel-ish-hid/ishtp/client.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ static void ishtp_read_list_flush(struct ishtp_cl *cl)
4949
list_for_each_entry_safe(rb, next, &cl->dev->read_list.list, list)
5050
if (rb->cl && ishtp_cl_cmp_id(cl, rb->cl)) {
5151
list_del(&rb->list);
52-
ishtp_io_rb_free(rb);
52+
spin_lock(&cl->free_list_spinlock);
53+
list_add_tail(&rb->list, &cl->free_rb_list.list);
54+
spin_unlock(&cl->free_list_spinlock);
5355
}
5456
spin_unlock_irqrestore(&cl->dev->read_list_spinlock, flags);
5557
}

0 commit comments

Comments
 (0)