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

Commit f5a1a6ad authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: XHCI: Handle ZLP data properly in control transfers"

parents 3089976e 919f853c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2056,6 +2056,8 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td,
					/* Did we already see a short data
					 * stage? */
					*status = -EREMOTEIO;
			} else if (td->zlp_data) {
				td->zlp_data = false;
			} else {
				td->urb->actual_length =
					td->urb->transfer_buffer_length;
@@ -2065,6 +2067,10 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td,
			td->urb->actual_length =
				td->urb->transfer_buffer_length -
				EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));

			if (td->urb->actual_length == 0)
				td->zlp_data = true;

			xhci_dbg(xhci, "Waiting for status "
					"stage event\n");
			return 0;
+3 −0
Original line number Diff line number Diff line
@@ -1258,6 +1258,9 @@ struct xhci_td {
	struct xhci_segment	*start_seg;
	union xhci_trb		*first_trb;
	union xhci_trb		*last_trb;

	/* ZLP received in data stage of a control transfer */
	bool			zlp_data;
};

/* xHCI command default timeout value */