OSDN Git Service

HID: ft260: missed NACK from busy device
authorMichael Zaidman <michael.zaidman@gmail.com>
Sat, 5 Nov 2022 21:11:50 +0000 (23:11 +0200)
committerJiri Kosina <jkosina@suse.cz>
Fri, 11 Nov 2022 10:09:36 +0000 (11:09 +0100)
commit5afac727defa0b2a3dffb2abd5fb5f594b98d217
treef69ddad27d83bda7c327e0a2952bd73909908efa
parentc2500bdffe5a95fbd0aecdd5be3d2f175ad22f92
HID: ft260: missed NACK from busy device

When writing into a slow device like an EEPROM chip, the
controller may exit the busy state before the device releases
the bus. In this case, the ft260_xfer_status returns success
before the data transfer completion.

The patch fixes it by returning from the ft260_xfer_status()
with the "-EAGAIN" on both controller and bus busy status when
appropriate.

It does not apply to the i2c combined transactions when after
the write IO, the controller keeps the bus busy until the read
IO and then between reading IOs to ensure an atomic operation.

Co-developed-by: Germain Hebert <germain.hebert@ca.abb.com>
Signed-off-by: Germain Hebert <germain.hebert@ca.abb.com>
Signed-off-by: Michael Zaidman <michael.zaidman@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-ft260.c