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

Commit 9ce075b8 authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: gadget: mtp: reset string descriptor's index with unbind



When USB host is re-enumerating USB MTP device multiple time, it
has been observed that USB MTP enumeration fails. USB MTP host
side environment (i.e. libmtp) is looking for USB MTP device to
pass string descriptor as "MTP" for successful enumeration. Due
to iInterface ID conflict, USB device is passing next interface
related string descriptor instead of USB MTP interface related
string descriptor. This results into no enumeration with USB MTP
configuration. Fix this issue by resetting mtp_string_defs string
descriptor id to zero, so next mtp_function_bind() call re-allocates
string ID.

CRs-Fixed: 2024744
Change-Id: Iad290ad480ccf23bd514a67128541d7ff67de1a5
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 436b4a5f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1425,6 +1425,7 @@ mtp_function_unbind(struct usb_configuration *c, struct usb_function *f)
	struct usb_request *req;
	int i;

	mtp_string_defs[INTERFACE_STRING_INDEX].id = 0;
	while ((req = mtp_req_get(dev, &dev->tx_idle)))
		mtp_request_free(req, dev->ep_in);
	for (i = 0; i < RX_REQ_MAX; i++)