From: Felipe Balbi <balbi@kernel.org>
To: Baolin Wang <baolin.wang@linaro.org>
Cc: Greg KH <gregkh@linuxfoundation.org>,
Mark Brown <broonie@kernel.org>, USB <linux-usb@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] usb: dwc3: Wait for control tranfer completed when stopping gadget
Date: Mon, 17 Oct 2016 14:53:58 +0300 [thread overview]
Message-ID: <87d1izry21.fsf@linux.intel.com> (raw)
In-Reply-To: <CAMz4kuLpeocJxktHm2NthwWg5LSiNkPByeis555P_Xddb71k3Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 891 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]
next prev parent reply other threads:[~2016-10-17 11:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-14 9:11 [PATCH v4] usb: dwc3: Wait for control tranfer completed when stopping gadget Baolin Wang
2016-10-17 10:10 ` Felipe Balbi
2016-10-17 11:47 ` Baolin Wang
2016-10-17 11:53 ` Felipe Balbi [this message]
2016-10-18 2:40 ` Baolin Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d1izry21.fsf@linux.intel.com \
--to=balbi@kernel.org \
--cc=baolin.wang@linaro.org \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.