Commit 65d6c17
HID: ft260: missed NACK from busy device
[ Upstream commit 5afac72 ]
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>
Stable-dep-of: bf3e39d ("HID: ft260: fix stack-use-after-return write in I2C read race")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 1236373 commit 65d6c17
1 file changed
Lines changed: 22 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
| 337 | + | |
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
382 | 383 | | |
383 | 384 | | |
| 385 | + | |
| 386 | + | |
384 | 387 | | |
385 | 388 | | |
386 | 389 | | |
| |||
398 | 401 | | |
399 | 402 | | |
400 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
401 | 414 | | |
402 | | - | |
| 415 | + | |
403 | 416 | | |
404 | 417 | | |
405 | 418 | | |
| |||
487 | 500 | | |
488 | 501 | | |
489 | 502 | | |
| 503 | + | |
490 | 504 | | |
491 | 505 | | |
492 | 506 | | |
| |||
525 | 539 | | |
526 | 540 | | |
527 | 541 | | |
528 | | - | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
529 | 546 | | |
530 | 547 | | |
531 | 548 | | |
| |||
1004 | 1021 | | |
1005 | 1022 | | |
1006 | 1023 | | |
1007 | | - | |
| 1024 | + | |
1008 | 1025 | | |
1009 | 1026 | | |
1010 | 1027 | | |
| |||
0 commit comments