From 43f5ff91dafac8225cee8257c0d1ee5a4f31781c Mon Sep 17 00:00:00 2001 From: Pratham Pratap Date: Wed, 24 Jul 2019 18:15:34 +0530 Subject: [PATCH] usb: dwc3-msm: Fix maximum_speed determination Currently driver is setting the user override speed to maximum speed by checking if override speed is less than the maximum speed. But this check will fail if the maximum speed supported by the controller is super-speed and user is trying to set it to super-speed from a lower speed. Fix this by checking if override speed is equal to or less than maximum speed. Change-Id: Id71cf163548e213ec0180d7f3107395feed2f483 Signed-off-by: Pratham Pratap --- drivers/usb/dwc3/dwc3-msm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c index 5e25046e74ff6..80b88e0e13277 100644 --- a/drivers/usb/dwc3/dwc3-msm.c +++ b/drivers/usb/dwc3/dwc3-msm.c @@ -2854,7 +2854,7 @@ static void dwc3_resume_work(struct work_struct *w) dwc->maximum_speed = USB_SPEED_HIGH; if (mdwc->override_usb_speed && - mdwc->override_usb_speed < dwc->maximum_speed) { + mdwc->override_usb_speed <= dwc->maximum_speed) { dwc->maximum_speed = mdwc->override_usb_speed; dwc->gadget.max_speed = dwc->maximum_speed; dbg_event(0xFF, "override_speed",