fix false disconnect due to a signal sent to the reading process
authorkeunyoung <keunyoung@google.com>
Wed, 29 Jan 2014 20:41:50 +0000 (12:41 -0800)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 16 Feb 2016 21:52:18 +0000 (13:52 -0800)
commitdaafe226f73674d5246a642c2399b8e81afac540
tree08b46bdc656d527377b6e8e94aa1d65765d07fd6
parenta6a18dc18a55798980383402051fabcca96754ee
fix false disconnect due to a signal sent to the reading process

- In the current implementation, when a signal is sent to the reading process,
  read is cancelled by calling usb_ep_dequeue, which lead into calling
  acc_complete_out with ECONNRESET, but the current logic treats it as
  disconnection, which makes the device inaccessible until cable is actually
  disconnected.
- The fix calls disconnect only when ESHUTDOWN error is passed.
- If data has already arrived while trying cancelling, the data is marked
  as available, and it will be read out on the next read. This is necessary
  as USB bulk is assumed to guarantee no data loss.

Signed-off-by: keunyoung <keunyoung@google.com>
drivers/usb/gadget/function/f_accessory.c