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


Groups > linux.kernel > #1501911

Re: [PATCH v4] usb: dwc3: Wait for control tranfer completed when stopping gadget

From Felipe Balbi <balbi@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v4] usb: dwc3: Wait for control tranfer completed when stopping gadget
Date 2016-10-17 14:00 +0200
Message-ID <steKe-2XK-29@gated-at.bofh.it> (permalink)
References <ss6OK-7Nf-17@gated-at.bofh.it> <stdbs-2aY-27@gated-at.bofh.it> <steAx-2Ua-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Hi,

Baolin Wang <baolin.wang@linaro.org> writes:
>> Baolin Wang <baolin.wang@linaro.org> writes:
>>> When we change the USB function with configfs dynamically, we possibly met this
>>> situation: one core is doing the control transfer, another core is trying to
>>> unregister the USB gadget from userspace, we must wait for completing this
>>> control tranfer, or it will hang the controller to set the DEVCTRLHLT flag.
>>>
>>> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
>>
>> Can you make sure this still works?
>
> With applying this patch, It can work well on my platform, but I have
> some worries about the risk of accessing 'dwc->ep0state' without lock
> protection in dwc3_gadget_pullup() function.

hmm, I might be missing something, but I think there's no risk here. If
anything, a wmb() is probably enough before reading ep0state. No?

-- 
balbi

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


Thread

[PATCH v4] usb: dwc3: Wait for control tranfer completed when stopping gadget Baolin Wang <baolin.wang@linaro.org> - 2016-10-14 11:20 +0200
  Re: [PATCH v4] usb: dwc3: Wait for control tranfer completed when stopping gadget Felipe Balbi <balbi@kernel.org> - 2016-10-17 12:20 +0200
    Re: [PATCH v4] usb: dwc3: Wait for control tranfer completed when  stopping gadget Baolin Wang <baolin.wang@linaro.org> - 2016-10-17 13:50 +0200
      Re: [PATCH v4] usb: dwc3: Wait for control tranfer completed when stopping gadget Felipe Balbi <balbi@kernel.org> - 2016-10-17 14:00 +0200
        Re: [PATCH v4] usb: dwc3: Wait for control tranfer completed when  stopping gadget Baolin Wang <baolin.wang@linaro.org> - 2016-10-18 04:50 +0200

csiph-web