From b95f93927b015a1ba59d2814a50d1cd80a8b283b Mon Sep 17 00:00:00 2001 From: Xiaoguang Wu Date: Wed, 18 Jul 2018 18:32:17 +0800 Subject: [PATCH] DM USB: temporary solution for corner case of control transfer In the process of implementation for USB isochronous transfer, the timeout (100ms) is not enough for Plantronics USB headset. So pass longer timeout (300ms) to function libusb_control_transfer will make USB headset of Plantronics work. This change only results a longer execution time in ENUMERATION process for few devices like Plantronics USB headset which need more time to do its internal operations. For most USB devices, time less than 100ms are enough to complete the execution of libusb_control_transfer. So basically it will not affect the whole system performance. In the long term, a better solution (eg: async control transfer) will be introduced to replace current implementation. Change-Id: I380e0cc337ec5741b1e4ce989abacce826b7dde4 Tracked-On: Signed-off-by: Xiaoguang Wu Reviewed-by: Liang Yang Acked-by: Yu Wang --- devicemodel/hw/platform/usb_pmapper.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/devicemodel/hw/platform/usb_pmapper.c b/devicemodel/hw/platform/usb_pmapper.c index cde6fb630..2ef72b8b3 100644 --- a/devicemodel/hw/platform/usb_pmapper.c +++ b/devicemodel/hw/platform/usb_pmapper.c @@ -772,9 +772,13 @@ usb_dev_request(void *pdata, struct usb_data_xfer *xfer) } /* send it to physical device */ - /* TODO: should this be async operation? */ + /* FIXME: In the process of implementation of USB isochronouse transfer, + * the timeout time is not enough for Plantronics headset. So this + * issue should be investigated detailly, and at worst situation, the + * control transfer should be also changed to async operation. + */ rc = libusb_control_transfer(udev->handle, request_type, request, - value, index, data, len, 100); + value, index, data, len, 300); if (rc >= 0 && blk) { blk->blen = len - rc;