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

Commit 046c10db authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: dwc3: gadget: Update chain bit correctly when using sg list"

parents c128dbdf aacc6165
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1260,7 +1260,14 @@ static void dwc3_prepare_one_trb_sg(struct dwc3_ep *dep,
		unsigned int rem = length % maxp;
		unsigned chain = true;

		if (sg_is_last(s))
		/*
		 * IOMMU driver is clubbing the list of sgs which shares a page
		 * boundary into one and giving it to USB driver. With this the
		 * number of sgs mapped it not equal to the the number of sgs
		 * passed. Mark the chain bit to false if it is the last mapped
		 * sg.
		 */
		if (sg_is_last(s) || (i == remaining - 1))
			chain = false;

		if (rem && usb_endpoint_dir_out(dep->endpoint.desc) && !chain) {