Linux Input/HID development
 help / color / mirror / Atom feed
* Re: [BUG] HID: i2c-hid: ELAN 04F3:30FD touchpad reset race causes -EREMOTEIO on HP Pavilion Gaming 15-ec1xxx
@ 2026-11-16 12:54 A Kishki
  2026-11-16 14:25 ` Andy Shevchenko
  0 siblings, 1 reply; 13+ messages in thread
From: A Kishki @ 2026-11-16 12:54 UTC (permalink / raw)
  To: testyiprywatnosc
  Cc: benjamin.tissoires, jikos, linux-input, lovekeshsolanki00,
	linux-i2c, mika.westerberg, andriy.shevchenko

Hi,

I found the cause on the same laptop. It is the SDA hold time of the
touchpad's I2C controller, not a reset race in i2c-hid.

Machine: HP Pavilion Gaming Laptop 15-ec1xxx, board 87B1, BIOS F.25
(08/18/2021), Ubuntu kernel 7.0.0-43-generic.

IC_SDA_HOLD of AMDI0010:03 (0xfedc5000 + 0x7c):

  normal boot, touchpad dead:         0x00010001
  boot via HP startup menu, works:    0x00010048

The ACPI tables give no hold time for this controller, so
i2c_dw_set_sda_hold() keeps the value it finds ("Keep previous hold
time setting if no one set it"). After a normal boot that is the reset
value, a TX hold of one clock, so the touchpad NACKs its address. The
startup-menu path leaves 0x48, which is why the F9 and UEFI-setup
workarounds help, and probably why the live ISOs worked, if they were
booted from the F9 menu.

To confirm, in a failed boot I unbound AMDI0010:03 from i2c_designware,
wrote 0x00010048 to the register through /dev/mem and bound it again.
The touchpad probed at once and works with hid-multitouch. A rebind
without the write changes nothing, because the driver reads the same
value back.

I run this as a boot-time workaround:
https://github.com/AhmedKishki/hp-pavilion-15-ec1-touchpad-fix

A real fix probably belongs in i2c-designware, for example a DMI quirk
that sets the hold time for this model. I'm happy to test patches.

Thanks,
Ahmed Alkishki

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [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; 13+ 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] 13+ messages in thread

end of thread, other threads:[~2026-11-16 14:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 12:54 [BUG] HID: i2c-hid: ELAN 04F3:30FD touchpad reset race causes -EREMOTEIO on HP Pavilion Gaming 15-ec1xxx A Kishki
2026-11-16 14:25 ` Andy Shevchenko
  -- strict thread matches above, loose matches on Subject: below --
2026-08-10 17:31 Adam
2026-08-14 10:38 ` Adam
2026-08-15 19:33 ` Lovekesh Solanki
2026-08-16 17:52   ` Adam
2026-08-16 19:57     ` Adam
2026-08-23 16:02       ` Adam
2026-08-24 18:58         ` Lovekesh Solanki
2026-08-27 21:44           ` Adam
2026-09-06 16:13             ` Adam
     [not found]             ` <CAEru=6+AJAJDw4uCi0=HFXH8XrOQhixHFk2e__o+hdd1m1ju5A@mail.gmail.com>
2026-09-07 20:50               ` Lovekesh Solanki
2026-09-13 21:16                 ` Adam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox