summaryrefslogtreecommitdiff
path: root/include/linux/flex_array.h
diff options
context:
space:
mode:
authorSujeet Kumar <ksujeet@codeaurora.org>2016-01-28 10:42:06 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:10:01 -0700
commit55a6f12e78ba2ee1eb3be9f12cc840085f1ea9fc (patch)
treedbc646ae27c517a05a07e6e58606fd31ad6e3920 /include/linux/flex_array.h
parent8b5f119fba94e61fdc271fc555a7357e34192704 (diff)
USB: f_fs: Fail stale read IOs after disconnect
After a USB disconnect, endpoints for adb are disabled. After this no IO is allowed on the endpoints. Since, adbd is not aware of this disconnect, it may still perform read/writes IO. For adb writes, IOs are failed, but for adb reads kernel waits untill endpoints are enabled. When a USB disconnect and adb read still queued a buffer to kernel, ffs_epfile_io simply waits for endpoint to be enabled. A next connect happens and endpoints are enabled after set_alt, the adb read stale buffer from previous session continues and queues to endpoint. All this time, adb did not close the epfile because it did not get return status on the IOs which it queued. This is an issue, because a new session is not established and both userspace and kernel goes out of sync. To fix this issue, when endpoints are disbled set epfile error. This epfile error is only cleared in epfile open. This will ensure that after a USB disconnect and connect, new session is established. Also, return ENODEV if endpoints not enabled rather than EINTR as EINTR case, and simply retries the request. Incase usb_ep_queue failed, return -EIO inspite of depend on return status from usb_ep_queue. Change-Id: I6e677e98ec28e5462b372ed290acdde251286f48 Signed-off-by: Sujeet Kumar <ksujeet@codeaurora.org> Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Diffstat (limited to 'include/linux/flex_array.h')
0 files changed, 0 insertions, 0 deletions