* [PATCH] HID: intel-ish-hid: Increase ISHTP resume ack timeout to 300ms
@ 2025-07-23 1:31 Zhang Lixu
2025-08-12 12:49 ` Jiri Kosina
0 siblings, 1 reply; 2+ messages in thread
From: Zhang Lixu @ 2025-07-23 1:31 UTC (permalink / raw)
To: linux-input, srinivas.pandruvada, jikos, benjamin.tissoires
Cc: lixu.zhang, hua.he, wenji1.yang, juswin.hsueh, henry.yeh,
neo.wong
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 <lixu.zhang@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
drivers/hid/intel-ish-hid/ipc/pci-ish.c | 3 ---
drivers/hid/intel-ish-hid/ishtp-hid-client.c | 3 +++
drivers/hid/intel-ish-hid/ishtp/bus.c | 3 ---
drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h | 3 +++
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
index c57483224db6..9d150ce234f2 100644
--- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c
+++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c
@@ -264,9 +264,6 @@ static void ish_shutdown(struct pci_dev *pdev)
static struct device __maybe_unused *ish_resume_device;
-/* 50ms to get resume response */
-#define WAIT_FOR_RESUME_ACK_MS 50
-
/**
* ish_resume_handler() - Work function to complete resume
* @work: work struct
diff --git a/drivers/hid/intel-ish-hid/ishtp-hid-client.c b/drivers/hid/intel-ish-hid/ishtp-hid-client.c
index 6550ad5bfbb5..d8c3c54a8c0f 100644
--- a/drivers/hid/intel-ish-hid/ishtp-hid-client.c
+++ b/drivers/hid/intel-ish-hid/ishtp-hid-client.c
@@ -759,6 +759,9 @@ static void hid_ishtp_cl_resume_handler(struct work_struct *work)
if (ishtp_wait_resume(ishtp_get_ishtp_device(hid_ishtp_cl))) {
client_data->suspended = false;
wake_up_interruptible(&client_data->ishtp_resume_wait);
+ } else {
+ hid_ishtp_trace(client_data, "hid client: wait for resume timed out");
+ dev_err(cl_data_to_dev(client_data), "wait for resume timed out");
}
}
diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c
index 5ac7d70a7c84..93a0432e7058 100644
--- a/drivers/hid/intel-ish-hid/ishtp/bus.c
+++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
@@ -852,9 +852,6 @@ EXPORT_SYMBOL(ishtp_device);
*/
bool ishtp_wait_resume(struct ishtp_device *dev)
{
- /* 50ms to get resume response */
- #define WAIT_FOR_RESUME_ACK_MS 50
-
/* Waiting to get resume response */
if (dev->resume_flag)
wait_event_interruptible_timeout(dev->resume_wait,
diff --git a/drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h b/drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h
index ec9f6e87aaf2..23db97ecf21c 100644
--- a/drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h
+++ b/drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h
@@ -47,6 +47,9 @@
#define MAX_DMA_DELAY 20
+/* 300ms to get resume response */
+#define WAIT_FOR_RESUME_ACK_MS 300
+
/* ISHTP device states */
enum ishtp_dev_state {
ISHTP_DEV_INITIALIZING = 0,
base-commit: 05adbee3ad528100ab0285c15c91100e19e10138
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] HID: intel-ish-hid: Increase ISHTP resume ack timeout to 300ms
2025-07-23 1:31 [PATCH] HID: intel-ish-hid: Increase ISHTP resume ack timeout to 300ms Zhang Lixu
@ 2025-08-12 12:49 ` Jiri Kosina
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2025-08-12 12:49 UTC (permalink / raw)
To: Zhang Lixu
Cc: linux-input, srinivas.pandruvada, benjamin.tissoires, hua.he,
wenji1.yang, juswin.hsueh, henry.yeh, neo.wong
On Wed, 23 Jul 2025, Zhang Lixu wrote:
> 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 <lixu.zhang@intel.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Applied to hid.git#for-6.17/upstream-fixes, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-12 12:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-23 1:31 [PATCH] HID: intel-ish-hid: Increase ISHTP resume ack timeout to 300ms Zhang Lixu
2025-08-12 12:49 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).