summaryrefslogtreecommitdiff
path: root/fastboot/device/usb.cpp
diff options
context:
space:
mode:
authoralk3pInjection <webmaster@raspii.tech>2023-07-04 20:04:45 +0800
committeralk3pInjection <webmaster@raspii.tech>2023-07-04 20:04:45 +0800
commit050df1f8efda06e4bd9f3a4136d9bcfbf249ae67 (patch)
tree4f2e7a57b6578c1f1ecebd9931652d18f47ba218 /fastboot/device/usb.cpp
parenta7dd355e8fe8ad0c579a4f0acd06b2e3b52dfc3a (diff)
parentdc927ba1caf8f06a6c42b2b133e5140f5d20736e (diff)
Merge tag 'LA.QSSI.13.0.r1-10700-qssi.0' into tachibana-mr1tachibana-mr1
"LA.QSSI.13.0.r1-10700-qssi.0" Change-Id: I4a5b27ee1ec595b5d3d0d26215468dbe89947340
Diffstat (limited to 'fastboot/device/usb.cpp')
-rw-r--r--fastboot/device/usb.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/fastboot/device/usb.cpp b/fastboot/device/usb.cpp
index 4115a6d28..1257055de 100644
--- a/fastboot/device/usb.cpp
+++ b/fastboot/device/usb.cpp
@@ -171,6 +171,16 @@ static int usb_ffs_do_aio(usb_handle* h, const void* data, int len, bool read) {
if (num_bufs == 1 && aiob->events[0].res == -EINTR) {
continue;
}
+ if (read && aiob->events[0].res == -EPIPE) {
+ // On initial connection, some clients will send a ClearFeature(HALT) to
+ // attempt to resynchronize host and device after the fastboot server is killed.
+ // On newer device kernels, the reads we've already dispatched will be cancelled.
+ // Instead of treating this as a failure, which will tear down the interface and
+ // lead to the client doing the same thing again, just resubmit if this happens
+ // before we've actually read anything.
+ PLOG(ERROR) << "aio: got -EPIPE on first read attempt. Re-submitting read... ";
+ continue;
+ }
int ret = 0;
for (int i = 0; i < num_bufs; i++) {
if (aiob->events[i].res < 0) {