usb: dwc3: gadget: add missing wakeup link states
Subsystems (2)
PATCH 1/1 usb: dwc3: gadget: add missing wakeup link states
In dwc3_send_gadget_ep_cmd() a check is performed if the gadget needs waking up. The following condition is checked before calling the __dwc3_gadget_wakeup() function:
needs_wakeup = (dwc->link_state == DWC3_LINK_STATE_U1 ||
dwc->link_state == DWC3_LINK_STATE_U2 ||
dwc->link_state == DWC3_LINK_STATE_U3);Inside __dwc3_gadget_wakeup() only link_state DWC3_LINK_STATE_U3 is checked and link state DWC3_LINK_STATE_U1 and DWC3_LINK_STATE_U2 are considered invalid and generate a warning because of the call to:
dev_WARN_ONCE(dwc->dev, ret, "wakeup failed --> %d\n", ret);
because of ret being -EINVAL.
--- drivers/usb/dwc3/gadget.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/dwc3/gadget.c +2 -0
@@ -1972,6 +1972,8 @@ static int __dwc3_gadget_wakeup(struct dwc3 *dwc)switch (link_state) {case DWC3_LINK_STATE_RESET :case DWC3_LINK_STATE_RX_DET :/* in HS, means Early Suspend */ +case DWC3_LINK_STATE_U1 : +case DWC3_LINK_STATE_U2 :case DWC3_LINK_STATE_U3 :/* in HS, means SUSPEND */ case DWC3_LINK_STATE_RESUME :break ;
Signature · 1 line
2.25.1
Quoted 26 lines · Marcel Hamer
In
dwc3_send_gadget_ep_cmd()a check is performed if the gadget needs waking up. The following condition is checked before calling the__dwc3_gadget_wakeup()function:needs_wakeup = (dwc->link_state == DWC3_LINK_STATE_U1 || dwc->link_state == DWC3_LINK_STATE_U2 || dwc->link_state == DWC3_LINK_STATE_U3);Inside
__dwc3_gadget_wakeup()onlylink_stateDWC3_LINK_STATE_U3is checked and link stateDWC3_LINK_STATE_U1andDWC3_LINK_STATE_U2are considered invalid and generate a warning because of the call to:dev_WARN_ONCE(dwc->dev, ret, "wakeup failed --> %d\n", ret);because of ret being
-EINVAL.Signed-off-by Marcel Hamer <[email protected]>--- drivers/usb/dwc3/gadget.c | 2 ++ 1 file changed, 2 insertions(+)drivers/usb/dwc3/gadget.c +0
-0
drivers/usb/dwc3/gadget.c static int __dwc3_gadget_wakeup(struct dwc3 *dwc) · line 1976
Quoted 5 lines
drivers/usb/dwc3/gadget.c +2
-0@@ -1972,6 +1972,8 @@ static int __dwc3_gadget_wakeup(struct dwc3 *dwc)switch (link_state) {case DWC3_LINK_STATE_RESET :case DWC3_LINK_STATE_RX_DET :/* in HS, means Early Suspend */ +case DWC3_LINK_STATE_U1 : +case DWC3_LINK_STATE_U2 :
I think this was fixed recently by Thinh.
Signature · 1 line
balbi
Quoted 36 lines · Felipe Balbi
Quoted 26 lines · Marcel Hamer
In
dwc3_send_gadget_ep_cmd()a check is performed if the gadget needs waking up. The following condition is checked before calling the__dwc3_gadget_wakeup()function:needs_wakeup = (dwc->link_state == DWC3_LINK_STATE_U1 || dwc->link_state == DWC3_LINK_STATE_U2 || dwc->link_state == DWC3_LINK_STATE_U3);Inside
__dwc3_gadget_wakeup()onlylink_stateDWC3_LINK_STATE_U3is checked and link stateDWC3_LINK_STATE_U1andDWC3_LINK_STATE_U2are considered invalid and generate a warning because of the call to:dev_WARN_ONCE(dwc->dev, ret, "wakeup failed --> %d\n", ret);because of ret being
-EINVAL.Signed-off-by Marcel Hamer <[email protected]>--- drivers/usb/dwc3/gadget.c | 2 ++ 1 file changed, 2 insertions(+)drivers/usb/dwc3/gadget.c +0
-0drivers/usb/dwc3/gadget.c static int __dwc3_gadget_wakeup(struct dwc3 *dwc) · line 1976
Quoted 5 lines
drivers/usb/dwc3/gadget.c +2
-0@@ -1972,6 +1972,8 @@ static int __dwc3_gadget_wakeup(struct dwc3 *dwc)switch (link_state) {case DWC3_LINK_STATE_RESET :case DWC3_LINK_STATE_RX_DET :/* in HS, means Early Suspend */ +case DWC3_LINK_STATE_U1 : +case DWC3_LINK_STATE_U2 :I think this was fixed recently by Thinh.
Quoted 4 lines
Signature · 1 line
balbi
Great, I missed that. Thank you for clarifying this.
Kind regards,
Marcel