• Hans de Goede's avatar
    HID: i2c-hid: Move i2c_hid_finish_hwreset() to after reading the report-descriptor · af93a167
    Hans de Goede authored
    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=2247751Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
    Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
    Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
    af93a167
i2c-hid-core.c 34 KB