]> git.itanic.dy.fi Git - linux-stable/commit
HID: i2c-hid: Move i2c_hid_finish_hwreset() to after reading the report-descriptor
authorHans de Goede <hdegoede@redhat.com>
Sat, 2 Dec 2023 22:46:11 +0000 (23:46 +0100)
committerJiri Kosina <jkosina@suse.com>
Wed, 6 Dec 2023 10:48:40 +0000 (11:48 +0100)
commitaf93a167eda90192563bce64c4bb989836afac1f
treef2dc47136d5b1851ba341eb23fdec3bbbb09505f
parentaa69d6974185e9f7a552ba982540a38e34f69690
HID: i2c-hid: Move i2c_hid_finish_hwreset() to after reading the report-descriptor

A recent bug made me look at Microsoft's i2c-hid docs again
and I noticed the following:

"""
4. Issue a RESET (Host Initiated Reset) to the Device.
5. Retrieve report descriptor from the device.

Note: Steps 4 and 5 may be done in parallel to optimize for time on I²C.
Since report descriptors are (a) static and (b) quite long, Windows 8 may
issue a request for 5 while it is waiting for a response from the device
on 4.
"""

Which made me think that maybe on some touchpads the reset ack is delayed
till after the report descriptor is read ?

Testing a T-BAO Tbook Air 12.5 with a 0911:5288 (SIPODEV SP1064?) touchpad,
for which the I2C_HID_QUIRK_NO_IRQ_AFTER_RESET quirk was first introduced,
shows that reading the report descriptor before waiting for the reset
helps with the missing reset IRQ. Now the reset does get acked properly,
but the ack sometimes still does not happen unfortunately.

Still moving the wait for ack to after reading the report-descriptor,
is probably a good idea, both to make i2c-hid's behavior closer to
Windows as well as to speed up probing i2c-hid devices.

While at it drop the dbg_hid() for a malloc failure, malloc failures
already get logged extensively by malloc itself.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2247751
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/i2c-hid/i2c-hid-core.c