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

Commit 996ff52f authored by Sreelakshmi Gownipalli's avatar Sreelakshmi Gownipalli Committed by Gerrit - the friendly Code Review server
Browse files

diag: Reset the usb read buffer in case of error



Reset the usb read buffer in case of error and don't queue
read work if error is EIO.

Change-Id: I633c850445818c4f94a9300a4b3939233b4cd076
Signed-off-by: default avatarSreelakshmi Gownipalli <sgownipa@codeaurora.org>
parent 159dc458
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -286,10 +286,11 @@ static void usb_read_work_fn(struct work_struct *work)
		req->buf = ch->read_buf;
		req->buf = ch->read_buf;
		req->length = USB_MAX_OUT_BUF;
		req->length = USB_MAX_OUT_BUF;
		err = usb_diag_read(ch->hdl, req);
		err = usb_diag_read(ch->hdl, req);
		if (err && err != -EIO) {
		if (err) {
			pr_debug("diag: In %s, error in reading from USB %s, err: %d\n",
			pr_debug("diag: In %s, error in reading from USB %s, err: %d\n",
				 __func__, ch->name, err);
				 __func__, ch->name, err);
			atomic_set(&ch->read_pending, 0);
			atomic_set(&ch->read_pending, 0);
			if (err != -EIO)
				queue_work(ch->usb_wq, &(ch->read_work));
				queue_work(ch->usb_wq, &(ch->read_work));
		}
		}
	} else {
	} else {