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

Commit 56b1ee72 authored by Jack Pham's avatar Jack Pham
Browse files

usb: dwc3: Fix handling of ISOC start transfer



A transfer on an isochronous endpoint needs special handling if
it was queued after the interval has expired. This case is
checked by testing bit 13 when a START TRANSFER command fails,
and returning -EAGAIN to indicate to the caller to end the transfer
and try again on the next interval. However, the test itself is
obscured because the function will simply return -EINVAL if any
of bits 15:12 are set. Fix this by correctly reordering the checks.

This was caused by an incorrect merge conflict resolution between
commit 561ba0fe ("usb: dwc3: gadget: return error if command
sent to DEPCMD register fails") and commit ef1891fa ("USB:
dwc3: Fix issues in isochronous endpoint handling").

Change-Id: Id1ec2c030efb94bac435172d7f030e68c7e10535
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 7427cd00
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -350,9 +350,6 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
			dev_vdbg(dwc->dev, "Command Complete --> %d\n",
					DWC3_DEPCMD_STATUS(reg));

			if (DWC3_DEPCMD_STATUS(reg))
				return -EINVAL;

			/* SW issues START TRANSFER command to isochronous ep
			 * with future frame interval. If future interval time
			 * has already passed when core recieves command, core
@@ -361,7 +358,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
			 */
			if (reg & 0x2000)
				return -EAGAIN;
			else
			else if (DWC3_DEPCMD_STATUS(reg))
				return -EINVAL;
			return 0;
		}