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: Mayank Rana <mrana@codeaurora.org>
This commit is contained in:
parent
664cdd33f9
commit
eae2d6033f
1 changed files with 1 additions and 0 deletions
|
@ -1504,6 +1504,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;
|
||||
mutex_lock(&dev->read_mutex);
|
||||
while ((req = mtp_req_get(dev, &dev->tx_idle)))
|
||||
mtp_request_free(req, dev->ep_in);
|
||||
|
|
Loading…
Add table
Reference in a new issue