Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3083b75 authored by Nicolas Gagnon's avatar Nicolas Gagnon Committed by Automerger Merge Worker
Browse files

Merge "Port ADB's new handling of the USB packet ClearFeature(HALT) to...

Merge "Port ADB's new handling of the USB packet ClearFeature(HALT) to Fastboot." am: 57ea923f am: 57fd8bef am: 98f63e3f am: 7ab140d5

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2185010



Change-Id: I98603a6069066ee9e79961c19ed283613a40252f
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 403f670b 7ab140d5
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -161,6 +161,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) {