Skip to content

Commit

Permalink
usb: dwc3-msm: Fix maximum_speed determination
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Pratham Pratap authored and Gerrit - the friendly Code Review server committed Aug 1, 2019
1 parent b225efc commit 43f5ff9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/dwc3/dwc3-msm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

1 comment on commit 43f5ff9

@stefanhh0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already cherry-picked: 159d17b

Please sign in to comment.