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

Commit 6463ba2b authored by Jiebing Li's avatar Jiebing Li Committed by Amit Pundir
Browse files

ANDROID: usb: gadget: fix MTP enumeration issue under super speed mode



MTP function doesn't show as a drive in Windows when the device
is connected to PC's USB3 port, because device fails to respond
ACK to BULK OUT transfer request.

This patch modifies MTP OUT request length as multiple of MaxPacketSize
per databook requirement in order to fix this issue.

Patchset: mtp

Change-Id: I090d7880ff00c499dc5ba7fd644b1fe7cd87fcb5
Signed-off-by: default avatarJiebing Li <jiebing.li@intel.com>
Signed-off-by: default avatarWang, Yu <yu.y.wang@intel.com>
Signed-off-by: default avatarRuss Weight <russell.h.weight@intel.com>
parent 38174da9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -540,10 +540,12 @@ static ssize_t mtp_read(struct file *fp, char __user *buf,
	ssize_t r = count;
	unsigned xfer;
	int ret = 0;
	size_t len;

	DBG(cdev, "mtp_read(%zu)\n", count);

	if (count > MTP_BULK_BUFFER_SIZE)
	len = usb_ep_align_maybe(cdev->gadget, dev->ep_out, count);
	if (len > MTP_BULK_BUFFER_SIZE)
		return -EINVAL;

	/* we will block until we're online */
@@ -567,7 +569,7 @@ static ssize_t mtp_read(struct file *fp, char __user *buf,
requeue_req:
	/* queue a request */
	req = dev->rx_req[0];
	req->length = count;
	req->length = len;
	dev->rx_done = 0;
	ret = usb_ep_queue(dev->ep_out, req, GFP_KERNEL);
	if (ret < 0) {