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


Groups > linux.kernel > #1502665

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

From Baolin Wang <baolin.wang@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH v4] usb: dwc3: Wait for control tranfer completed when stopping gadget
Date 2016-10-18 04:50 +0200
Message-ID <stsDw-4bd-5@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> <steKe-2XK-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

On 17 October 2016 at 19:53, Felipe Balbi <balbi@kernel.org> wrote:
>
> 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?

OK, I agree with you and I think a wmb() is not useful here.

-- 
Baolin.wang
Best Regards

Back to linux.kernel | Previous | NextPrevious 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