Skip to content

Commit dfbd535

Browse files
lixuzhaJiri Kosina
authored andcommitted
HID: intel-ish-hid: Increase ISHTP resume ack timeout to 300ms
During s2idle suspend/resume testing on some systems, occasional several tens of seconds delays were observed in HID sensor resume handling. Trace analysis revealed repeated "link not ready" timeout errors during set/get_report operations, which were traced to the hid_ishtp_cl_resume_handler() timing out while waiting for the ISHTP resume acknowledgment. The previous timeout was set to 50ms, which proved insufficient on affected machines. Empirical measurements on failing systems showed that the time from ISH resume initiation to receiving the ISHTP resume ack could be as long as 180ms. As a result, the 50ms timeout caused failures. To address this, increase the wait timeout for ISHTP resume ack from 50ms to 300ms, providing a safer margin for slower hardware. Additionally, add error logging when a timeout occurs to aid future debugging and issue triage. No functional changes are made beyond the timeout adjustment and improved error reporting. Signed-off-by: Zhang Lixu <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent a7fc15e commit dfbd535

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/hid/intel-ish-hid/ipc/pci-ish.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,6 @@ static void ish_shutdown(struct pci_dev *pdev)
264264

265265
static struct device __maybe_unused *ish_resume_device;
266266

267-
/* 50ms to get resume response */
268-
#define WAIT_FOR_RESUME_ACK_MS 50
269-
270267
/**
271268
* ish_resume_handler() - Work function to complete resume
272269
* @work: work struct

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,9 @@ static void hid_ishtp_cl_resume_handler(struct work_struct *work)
759759
if (ishtp_wait_resume(ishtp_get_ishtp_device(hid_ishtp_cl))) {
760760
client_data->suspended = false;
761761
wake_up_interruptible(&client_data->ishtp_resume_wait);
762+
} else {
763+
hid_ishtp_trace(client_data, "hid client: wait for resume timed out");
764+
dev_err(cl_data_to_dev(client_data), "wait for resume timed out");
762765
}
763766
}
764767

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -852,9 +852,6 @@ EXPORT_SYMBOL(ishtp_device);
852852
*/
853853
bool ishtp_wait_resume(struct ishtp_device *dev)
854854
{
855-
/* 50ms to get resume response */
856-
#define WAIT_FOR_RESUME_ACK_MS 50
857-
858855
/* Waiting to get resume response */
859856
if (dev->resume_flag)
860857
wait_event_interruptible_timeout(dev->resume_wait,

drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747

4848
#define MAX_DMA_DELAY 20
4949

50+
/* 300ms to get resume response */
51+
#define WAIT_FOR_RESUME_ACK_MS 300
52+
5053
/* ISHTP device states */
5154
enum ishtp_dev_state {
5255
ISHTP_DEV_INITIALIZING = 0,

0 commit comments

Comments
 (0)