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

Commit 474866eb authored by Dov Levenglick's avatar Dov Levenglick
Browse files

usb: dwc3: enforce hardware restriction on TRB size



Perform sanity check on the TRB size, to ensure
that it complies with the hardware restriction
of 8KB for dbm TRB.

Change-Id: Idb4081dfa54ea884773fbb4011345aae19f7e133
CRs-Fixed: 565661
Signed-off-by: default avatarDov Levenglick <dovl@codeaurora.org>
parent 360013b1
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -569,6 +569,12 @@ static int dwc3_msm_ep_queue(struct usb_ep *ep,
		dep->free_slot = 0;
		dep->free_slot = 0;
	}
	}


	/* HW restriction regarding TRB size (8KB) */
	if (req->request.length < 0x2000) {
		dev_err(mdwc->dev, "%s: Min TRB size is 8KB\n", __func__);
		return -EINVAL;
	}

	/*
	/*
	 * Override req->complete function, but before doing that,
	 * Override req->complete function, but before doing that,
	 * store it's original pointer in the req_complete_list.
	 * store it's original pointer in the req_complete_list.