Hi, On Sat, Dec 2, 2023 at 2:46 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote: > > 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@xxxxxxxxxx> > --- > Changes in v3: > - Use goto abort_reset instead of return on i2c_hid_start_hwreset() > failure, so that the mutex gets properly unlocked > > Changes in v2: > - Adjust commit message to note that moving the wait-for-reset > to after reading thr report-descriptor only partially fixes > the missing reset IRQ problem > - Adjust for the reset_lock now being taken in the callers of > i2c_hid_start_hwreset() / i2c_hid_finish_hwreset() > --- > drivers/hid/i2c-hid/i2c-hid-core.c | 29 +++++++++++++++++++---------- > 1 file changed, 19 insertions(+), 10 deletions(-) Reviewed-by: Douglas Anderson <dianders@xxxxxxxxxxxx>