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


Groups > linux.kernel > #1366138

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

From Felipe Balbi <balbi@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2] usb: gadget: fsl_udc_core: Fix pullup status
Date 2016-03-29 12:40 +0200
Message-ID <rhZe3-4MC-51@gated-at.bofh.it> (permalink)
References <rgBGO-3tb-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Dmitry Osipenko <digetx@gmail.com> writes:
> 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 and the UDC won't be enabled.
>
> Fixes: 252455c40316 (usb: gadget: fsl driver pullup fix)
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
> Changelog:
> V2: "(is_on != 0)" changed to "!!is_on" as per Sergei Shtylyov comment,
>     cleaned up commit message.
>
>  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..4309b4f 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;
> +
>  	if (!udc->vbus_active)
>  		return -EOPNOTSUPP;
>  
> -	udc->softconnect = (is_on != 0);

if we're suspended and VBUS was cut off, why would we keep softconnect
set to true ? That would also cause a discrepancy between SW state and
HW state.

I don't have this HW to test, but this patch seems wrong to me.

-- 
balbi

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2] usb: gadget: fsl_udc_core: Fix pullup status Dmitry Osipenko <digetx@gmail.com> - 2016-03-25 16:20 +0100
  Re: [PATCH v2] usb: gadget: fsl_udc_core: Fix pullup status Felipe Balbi <balbi@kernel.org> - 2016-03-29 12:40 +0200
    Re: [PATCH v2] usb: gadget: fsl_udc_core: Fix pullup status Dmitry Osipenko <digetx@gmail.com> - 2016-03-29 13:20 +0200
      Re: [PATCH v2] usb: gadget: fsl_udc_core: Fix pullup status Felipe Balbi <balbi@kernel.org> - 2016-03-29 13:30 +0200

csiph-web