All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] HID: i2c-hid: ELAN 04F3:30FD touchpad reset race causes -EREMOTEIO on HP Pavilion Gaming 15-ec1xxx
@ 2026-08-10 17:31 Adam
  2026-08-14 10:38 ` Adam
  2026-08-15 19:33 ` Lovekesh Solanki
  0 siblings, 2 replies; 3+ messages in thread
From: Adam @ 2026-08-10 17:31 UTC (permalink / raw)
  To: benjamin.tissoires, jikos, linux-input


[-- Attachment #1.1: Type: text/plain, Size: 3054 bytes --]

Hello,

I'm reporting a reproducible probe failure for an ELAN i2c-hid touchpad
(ACPI ELAN0718:00, VID:PID 04F3:30FD) on an HP Pavilion Gaming 15-ec1033nw
(AMD platform, i2c bus under AMDI0010:03). The touchpad fails to
initialize on nearly every boot on Linux, while the same hardware works
reliably every time under Windows 11 on the same machine (dual context,
same BIOS F.35 rev.A).

Kernel: 7.1.6-arch1-1 (Arch Linux)
Also reported by other users with the same touchpad ID on different
kernels/distros (Arch, Ubuntu, Linux Mint) going back to at least 2022:
- https://bbs.archlinux.org/viewtopic.php?id=277393
- https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2031061
- https://forums.linuxmint.com/viewtopic.php?t=329212

Symptom (default logging):

  i2c_hid_acpi i2c-ELAN0718:00: failed to fetch HID descriptor: -121
  i2c_hid_acpi i2c-ELAN0718:00: Failed to fetch the HID Descriptor
  i2c_hid_acpi i2c-ELAN0718:00: probe with driver i2c_hid_acpi failed with
error -121

With dynamic_debug enabled for i2c_hid and i2c_hid_acpi:

  i2c_hid_start_hwreset
  i2c_hid_set_power: cmd=05 00 00 08
  i2c_hid_xfer: cmd=05 00 00 01
  i2c_hid_finish_hwreset: waiting...
  i2c_hid_finish_hwreset: finished.
  asking HID report descriptor
  i2c_hid_xfer: cmd=02 00
  reading report descriptor failed
  can't add hid device: -121
  probe with driver i2c_hid_acpi failed with error -121

Note the device is already tagged with I2C_HID_QUIRK_BOGUS_IRQ and
I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET via the USB_VENDOR_ID_ELAN,
HID_ANY_ID entry in i2c_hid_quirks[], but this specific chip still
appears to need additional settle time between the reset-complete IRQ
and the immediately following descriptor read - the two happen back to
back (sub-millisecond apart in the trace) with zero delay.

The i2c bus and controller are not at fault: an ACPI-level PCI
remove/rescan of the SMBus controller (0000:00:14.0, piix4_smbus)
successfully re-enumerates the bus, and once probe *does* succeed
(intermittently - roughly 1 in 10-15 boots in my testing), the touchpad
works completely normally for the rest of the session. This points to a
narrow timing race rather than a persistent hardware/firmware fault.
Windows never exhibits this behavior on the same machine.

I tested a draft workaround patch (attached) attempting to add msleep()
delays after i2c_hid_finish_hwreset() and before descriptor fetch for
devices with I2C_HID_QUIRK_BOGUS_IRQ, but the issue still persists on my
machine. I am attaching the patch and debug logs in hopes that maintainers
can pinpoint the exact timing, sequence, or quirk needed for this ELAN
revision.

Happy to test alternate patches, adjust delay values, or gather any
additional traces (i2cdump, further dynamic_debug, ACPI tables via
acpidump) if useful.

Hardware:
- HP Pavilion Gaming 15-ec1033nw
- AMD Ryzen 5 4600H
- BIOS F.35 rev.A (latest per HP support site)
- Touchpad: ACPI ELAN0718:00, USB VID:PID 04F3:30FD, on i2c-3 /
  AMDI0010:03

Let me know if you'd like the full dmesg, acpidump, or anything else.

Thanks,
Adam

[-- Attachment #1.2: Type: text/html, Size: 3520 bytes --]

[-- Attachment #2: elan-touchpad-bogus-irq-reset-delay.patch --]
[-- Type: text/x-patch, Size: 1418 bytes --]

--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -520,6 +520,18 @@
 	if (!(ihid->quirks & I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET))
 		ret = i2c_hid_set_power(ihid, I2C_HID_PWR_ON);
 
+	/*
+	 * Some ELAN i2c-hid touchpads (e.g. 04F3:30FD, seen on HP Pavilion
+	 * Gaming 15-ec1xxx) signal reset-complete via IRQ before they are
+	 * actually ready to answer the immediately following HID/report
+	 * descriptor read, causing a spurious -EREMOTEIO (-121). The
+	 * Windows driver is known to insert a delay after PWR_ON/RESET
+	 * (see comment in i2c_hid_set_power above); give this quirky class
+	 * of ELAN devices the same grace period.
+	 */
+	if (ihid->quirks & I2C_HID_QUIRK_BOGUS_IRQ)
+		msleep(100);
+
 	return ret;
 }
 
@@ -1052,6 +1064,18 @@
 		return -ENXIO;
 	}
 
+	/*
+	 * Some ELAN i2c-hid touchpads (e.g. 04F3:30FD, seen on HP Pavilion
+	 * Gaming 15-ec1xxx) are not yet ready to answer the very first HID
+	 * descriptor read on cold boot / power-on, before any reset has
+	 * even been issued, causing an intermittent -EREMOTEIO (-121) here.
+	 * Give this quirky class of ELAN devices a short grace period,
+	 * mirroring the delay already applied after hwreset for the same
+	 * quirk further down in this file.
+	 */
+	if (ihid->quirks & I2C_HID_QUIRK_BOGUS_IRQ)
+		msleep(200);
+
 	ret = i2c_hid_fetch_hid_descriptor(ihid);
 	if (ret < 0) {
 		dev_err(&client->dev,

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG] HID: i2c-hid: ELAN 04F3:30FD touchpad reset race causes -EREMOTEIO on HP Pavilion Gaming 15-ec1xxx
  2026-08-10 17:31 [BUG] HID: i2c-hid: ELAN 04F3:30FD touchpad reset race causes -EREMOTEIO on HP Pavilion Gaming 15-ec1xxx Adam
@ 2026-08-14 10:38 ` Adam
  2026-08-15 19:33 ` Lovekesh Solanki
  1 sibling, 0 replies; 3+ messages in thread
From: Adam @ 2026-08-14 10:38 UTC (permalink / raw)
  To: benjamin.tissoires, jikos, linux-input


[-- Attachment #1.1: Type: text/plain, Size: 4385 bytes --]

Quick correction to my previous message - I found a logic bug in the patch
I attached.

The second hunk (delay before the very first HID descriptor fetch in
probe()) checked `ihid->quirks & I2C_HID_QUIRK_BOGUS_IRQ`, but at that
point in probe() the USB vendor/product ID hasn't been read yet - it's
only populated a few lines later, from the very descriptor fetch the
delay was supposed to precede. So the quirk lookup hadn't happened yet,
the condition was always false, and that delay never actually ran. That
explains why the timing in dmesg was unchanged with the patch applied.

I've fixed this by keying off the ACPI/i2c device name instead
(`dev_name(&client->dev)`, e.g. "i2c-ELAN0718:00"), which is available
from the very start for ACPI-enumerated devices. Updated patch attached
(v2). I haven't been able to fully verify this version end-to-end yet
(ran into some build/test issues on my end), so please treat it as a
starting point rather than a confirmed fix - happy to test further if
useful.

Thanks,
Adam

On Mon, Aug 10, 2026 at 7:31 PM Adam <testyiprywatnosc@gmail.com> wrote:

> Hello,
>
> I'm reporting a reproducible probe failure for an ELAN i2c-hid touchpad
> (ACPI ELAN0718:00, VID:PID 04F3:30FD) on an HP Pavilion Gaming 15-ec1033nw
> (AMD platform, i2c bus under AMDI0010:03). The touchpad fails to
> initialize on nearly every boot on Linux, while the same hardware works
> reliably every time under Windows 11 on the same machine (dual context,
> same BIOS F.35 rev.A).
>
> Kernel: 7.1.6-arch1-1 (Arch Linux)
> Also reported by other users with the same touchpad ID on different
> kernels/distros (Arch, Ubuntu, Linux Mint) going back to at least 2022:
> - https://bbs.archlinux.org/viewtopic.php?id=277393
> - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2031061
> - https://forums.linuxmint.com/viewtopic.php?t=329212
>
> Symptom (default logging):
>
>   i2c_hid_acpi i2c-ELAN0718:00: failed to fetch HID descriptor: -121
>   i2c_hid_acpi i2c-ELAN0718:00: Failed to fetch the HID Descriptor
>   i2c_hid_acpi i2c-ELAN0718:00: probe with driver i2c_hid_acpi failed with
> error -121
>
> With dynamic_debug enabled for i2c_hid and i2c_hid_acpi:
>
>   i2c_hid_start_hwreset
>   i2c_hid_set_power: cmd=05 00 00 08
>   i2c_hid_xfer: cmd=05 00 00 01
>   i2c_hid_finish_hwreset: waiting...
>   i2c_hid_finish_hwreset: finished.
>   asking HID report descriptor
>   i2c_hid_xfer: cmd=02 00
>   reading report descriptor failed
>   can't add hid device: -121
>   probe with driver i2c_hid_acpi failed with error -121
>
> Note the device is already tagged with I2C_HID_QUIRK_BOGUS_IRQ and
> I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET via the USB_VENDOR_ID_ELAN,
> HID_ANY_ID entry in i2c_hid_quirks[], but this specific chip still
> appears to need additional settle time between the reset-complete IRQ
> and the immediately following descriptor read - the two happen back to
> back (sub-millisecond apart in the trace) with zero delay.
>
> The i2c bus and controller are not at fault: an ACPI-level PCI
> remove/rescan of the SMBus controller (0000:00:14.0, piix4_smbus)
> successfully re-enumerates the bus, and once probe *does* succeed
> (intermittently - roughly 1 in 10-15 boots in my testing), the touchpad
> works completely normally for the rest of the session. This points to a
> narrow timing race rather than a persistent hardware/firmware fault.
> Windows never exhibits this behavior on the same machine.
>
> I tested a draft workaround patch (attached) attempting to add msleep()
> delays after i2c_hid_finish_hwreset() and before descriptor fetch for
> devices with I2C_HID_QUIRK_BOGUS_IRQ, but the issue still persists on my
> machine. I am attaching the patch and debug logs in hopes that maintainers
> can pinpoint the exact timing, sequence, or quirk needed for this ELAN
> revision.
>
> Happy to test alternate patches, adjust delay values, or gather any
> additional traces (i2cdump, further dynamic_debug, ACPI tables via
> acpidump) if useful.
>
> Hardware:
> - HP Pavilion Gaming 15-ec1033nw
> - AMD Ryzen 5 4600H
> - BIOS F.35 rev.A (latest per HP support site)
> - Touchpad: ACPI ELAN0718:00, USB VID:PID 04F3:30FD, on i2c-3 /
>   AMDI0010:03
>
> Let me know if you'd like the full dmesg, acpidump, or anything else.
>
> Thanks,
> Adam
>

[-- Attachment #1.2: Type: text/html, Size: 5078 bytes --]

[-- Attachment #2: elan-touchpad-bogus-irq-reset-delay-v2.patch --]
[-- Type: text/x-patch, Size: 1618 bytes --]

--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -520,6 +520,18 @@
 	if (!(ihid->quirks & I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET))
 		ret = i2c_hid_set_power(ihid, I2C_HID_PWR_ON);
 
+	/*
+	 * Some ELAN i2c-hid touchpads (e.g. 04F3:30FD, seen on HP Pavilion
+	 * Gaming 15-ec1xxx) signal reset-complete via IRQ before they are
+	 * actually ready to answer the immediately following HID/report
+	 * descriptor read, causing a spurious -EREMOTEIO (-121). The
+	 * Windows driver is known to insert a delay after PWR_ON/RESET
+	 * (see comment in i2c_hid_set_power above); give this quirky class
+	 * of ELAN devices the same grace period.
+	 */
+	if (ihid->quirks & I2C_HID_QUIRK_BOGUS_IRQ)
+		msleep(100);
+
 	return ret;
 }
 
@@ -1052,6 +1064,21 @@
 		return -ENXIO;
 	}
 
+	/*
+	 * Some ELAN i2c-hid touchpads (e.g. 04F3:30FD, seen on HP Pavilion
+	 * Gaming 15-ec1xxx) are not yet ready to answer the very first HID
+	 * descriptor read on cold boot / power-on, before any reset has
+	 * even been issued, causing an intermittent -EREMOTEIO (-121) here.
+	 * At this point in probe() the USB vendor/product ID (and thus
+	 * ihid->quirks, looked up from it) is not known yet - it is only
+	 * populated a few lines below, from the descriptor we are about to
+	 * fetch. So key off the ACPI/i2c device name instead, which is
+	 * available from the start for ACPI-enumerated devices such as
+	 * this one (ELAN0718:00).
+	 */
+	if (strstarts(dev_name(&client->dev), "i2c-ELAN"))
+		msleep(200);
+
 	ret = i2c_hid_fetch_hid_descriptor(ihid);
 	if (ret < 0) {
 		dev_err(&client->dev,

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG] HID: i2c-hid: ELAN 04F3:30FD touchpad reset race causes -EREMOTEIO on HP Pavilion Gaming 15-ec1xxx
  2026-08-10 17:31 [BUG] HID: i2c-hid: ELAN 04F3:30FD touchpad reset race causes -EREMOTEIO on HP Pavilion Gaming 15-ec1xxx Adam
  2026-08-14 10:38 ` Adam
@ 2026-08-15 19:33 ` Lovekesh Solanki
  1 sibling, 0 replies; 3+ messages in thread
From: Lovekesh Solanki @ 2026-08-15 19:33 UTC (permalink / raw)
  To: Adam; +Cc: benjamin.tissoires, jikos, linux-input

On Mon, Aug 10, 2026 at 07:31:32PM +0200, Adam wrote:
> Hello,
> 
> I'm reporting a reproducible probe failure for an ELAN i2c-hid touchpad
> (ACPI ELAN0718:00, VID:PID 04F3:30FD) on an HP Pavilion Gaming 15-ec1033nw
> (AMD platform, i2c bus under AMDI0010:03). The touchpad fails to
> initialize on nearly every boot on Linux, while the same hardware works
> reliably every time under Windows 11 on the same machine (dual context,
> same BIOS F.35 rev.A).
> 
> Kernel: 7.1.6-arch1-1 (Arch Linux)
> Also reported by other users with the same touchpad ID on different
> kernels/distros (Arch, Ubuntu, Linux Mint) going back to at least 2022:
> - https://bbs.archlinux.org/viewtopic.php?id=277393
> - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2031061
> - https://forums.linuxmint.com/viewtopic.php?t=329212
> 
> Symptom (default logging):
> 
>   i2c_hid_acpi i2c-ELAN0718:00: failed to fetch HID descriptor: -121
>   i2c_hid_acpi i2c-ELAN0718:00: Failed to fetch the HID Descriptor
>   i2c_hid_acpi i2c-ELAN0718:00: probe with driver i2c_hid_acpi failed with
> error -121
> 
> With dynamic_debug enabled for i2c_hid and i2c_hid_acpi:
> 
>   i2c_hid_start_hwreset
>   i2c_hid_set_power: cmd=05 00 00 08
>   i2c_hid_xfer: cmd=05 00 00 01
>   i2c_hid_finish_hwreset: waiting...
>   i2c_hid_finish_hwreset: finished.
>   asking HID report descriptor
>   i2c_hid_xfer: cmd=02 00
>   reading report descriptor failed
>   can't add hid device: -121
>   probe with driver i2c_hid_acpi failed with error -121

Could you attach full dmesg with debug enabled, of failing boot and
successfull boot? And also acpidump?

Thanks,
Lovekesh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-15 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-10 17:31 [BUG] HID: i2c-hid: ELAN 04F3:30FD touchpad reset race causes -EREMOTEIO on HP Pavilion Gaming 15-ec1xxx Adam
2026-08-14 10:38 ` Adam
2026-08-15 19:33 ` Lovekesh Solanki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.