Skip to contentSkip to conversation

usb: gadget: fsl_udc_core: Fix pullup status

PATCH Superseded Dmitry Osipenko 2 participants 3 messages Mar 24, 2016 – Mar 25, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: gadget: fsl_udc_core: Fix pullup status

udc->softconnect should be set regardless of the VBUS state, otherwise the USB peripheral device, connected during suspend, won't be detected since can_pullup() would return false the UDC controller won't be enabled.

Fixes 252455c40316 (usb: gadget: fsl driver pullup fix)
---
 drivers/usb/gadget/udc/fsl_udc_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/gadget/udc/fsl_udc_core.c +2 -1
index aab5221..118cf7a 100644
@@ -1220,10 +1220,11 @@ static int fsl_pullup(struct usb_gadget *gadget, int is_on)
 
 	udc = container_of(gadget, struct fsl_udc, gadget);
 
+	udc->softconnect = (is_on != 0);
+
 	if (!udc->vbus_active)
 		return -EOPNOTSUPP;
 
-	udc->softconnect = (is_on != 0);
 	if (can_pullup(udc))
 		fsl_writel((fsl_readl(&dr_regs->usbcmd) | USB_CMD_RUN_STOP),
 				&dr_regs->usbcmd);
Signature · 1 line
2.7.4
#1 lore raw

Hello.

Quoted 15 lines · Dmitry Osipenko

udc->softconnect should be set regardless of the VBUS state, otherwise the USB peripheral device, connected during suspend, won't be detected since can_pullup() would return false the UDC controller won't be enabled.

Fixes 252455c40316 (usb: gadget: fsl driver pullup fix)
---
  drivers/usb/gadget/udc/fsl_udc_core.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/gadget/udc/fsl_udc_core.c +0 -0
index aab5221..118cf7a 100644

drivers/usb/gadget/udc/fsl_udc_core.c static int fsl_pullup(struct usb_gadget *gadget, int is_on) · line 1223

Quoted 4 lines
drivers/usb/gadget/udc/fsl_udc_core.c +1 -0
@@ -1220,10 +1220,11 @@ static int fsl_pullup(struct usb_gadget *gadget, int is_on)
 
  	udc = container_of(gadget, struct fsl_udc, gadget);
 
+	udc->softconnect = (is_on != 0);

!!is_on? Parens not needed anyway though.

drivers/usb/gadget/udc/fsl_udc_core.c static int fsl_pullup(struct usb_gadget *gadget, int is_on) · line 1230

Quoted 8 lines
drivers/usb/gadget/udc/fsl_udc_core.c +1 -1
+
  	if (!udc->vbus_active)
  		return -EOPNOTSUPP;
 
-	udc->softconnect = (is_on != 0);
  	if (can_pullup(udc))
  		fsl_writel((fsl_readl(&dr_regs->usbcmd) | USB_CMD_RUN_STOP),
  				&dr_regs->usbcmd);

MBR, Sergei

#2 lore raw

Hello Sergei,

25.03.2016 14:12, Sergei Shtylyov пишет:
[snip]

Quoted 7 lines
Quoted 4 lines
      udc = container_of(gadget, struct fsl_udc, gadget);

+ udc->softconnect = (is_on != 0);

!!is_on? Parens not needed anyway though.

Okay :) I'll change to it in V2 as well as a bit messed up commit message. Thanks for the comment!

[snip]

Signature · 1 line
Dmitry