Closed MichaelZaidman closed 1 year ago
This commit breaks big reads and needs to be revised.
@GermainHebert, please review the commit before I merge this PR. Thanks.
Fix NACK issue, didn't find any regression
@GermainHebert, thanks for testing!
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.
Signed-off-by: Germain Hebert germain.hebert@ca.abb.com Signed-off-by: Michael Zaidman michael.zaidman@gmail.com
Tested with 24LC32A EEPROM by writing 2K in 32-byte chunks of data.
400KHz clock
Before:
After:
100KHz clock
Before:
After:
SMBus one byte at a time writes into 24LC32A EEPROM
100KHz clock
$ sudo ./i2cperf -f 3 -o 2 -s 32 -r 0-0x7f 13 0x51 -S
400KHz clock