Merge "usb: dwc3-msm: Don't allow dynamic speed change for host mode"

This commit is contained in:
qctecmdr 2022-09-27 16:06:10 -07:00 committed by Gerrit - the friendly Code Review server
commit 7622335450

View File

@ -4918,6 +4918,10 @@ static ssize_t speed_store(struct device *dev, struct device_attribute *attr,
struct dwc3_msm *mdwc = dev_get_drvdata(dev);
enum usb_device_speed req_speed = USB_SPEED_UNKNOWN;
/* no speed change in host mode */
if (!test_bit(ID, &mdwc->inputs))
return -EPERM;
/* DEVSPD can only have values SS(0x4), HS(0x0) and FS(0x1).
* per 3.20a data book. Allow only these settings. Note that,
* xhci does not support full-speed only mode.