Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1364480 > unrolled thread

[PATCH] usb: gadget: fsl_udc_core: Fix pullup status

Started byDmitry Osipenko <digetx@gmail.com>
First post2016-03-25 00:20 +0100
Last post2016-03-25 14:10 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] usb: gadget: fsl_udc_core: Fix pullup status Dmitry Osipenko <digetx@gmail.com> - 2016-03-25 00:20 +0100
    Re: [PATCH] usb: gadget: fsl_udc_core: Fix pullup status Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-03-25 12:20 +0100
      Re: [PATCH] usb: gadget: fsl_udc_core: Fix pullup status Dmitry Osipenko <digetx@gmail.com> - 2016-03-25 14:10 +0100

#1364480 — [PATCH] usb: gadget: fsl_udc_core: Fix pullup status

FromDmitry Osipenko <digetx@gmail.com>
Date2016-03-25 00:20 +0100
Subject[PATCH] usb: gadget: fsl_udc_core: Fix pullup status
Message-ID<rgmHM-1kt-11@gated-at.bofh.it>
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)
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/usb/gadget/udc/fsl_udc_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c
index aab5221..118cf7a 100644
--- a/drivers/usb/gadget/udc/fsl_udc_core.c
+++ b/drivers/usb/gadget/udc/fsl_udc_core.c
@@ -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);
-- 
2.7.4

[toc] | [next] | [standalone]


#1364633

FromSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date2016-03-25 12:20 +0100
Message-ID<rgxWz-Rf-49@gated-at.bofh.it>
In reply to#1364480
Hello.

On 3/25/2016 2:14 AM, Dmitry Osipenko wrote:

> 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)
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
>   drivers/usb/gadget/udc/fsl_udc_core.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c
> index aab5221..118cf7a 100644
> --- a/drivers/usb/gadget/udc/fsl_udc_core.c
> +++ b/drivers/usb/gadget/udc/fsl_udc_core.c
> @@ -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.

> +
>   	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

[toc] | [prev] | [next] | [standalone]


#1364659

FromDmitry Osipenko <digetx@gmail.com>
Date2016-03-25 14:10 +0100
Message-ID<rgzF0-26I-15@gated-at.bofh.it>
In reply to#1364633
Hello Sergei,

25.03.2016 14:12, Sergei Shtylyov пишет:
[snip]
>>
>>       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]

-- 
Dmitry

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web