From: Peter Chen <peter.chen@freescale.com>
To: Jiada Wang <jiada_wang@mentor.com>
Cc: <gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: chipidea: udc: clear vbus_active flag in udc_stop
Date: Tue, 20 Oct 2015 14:01:08 +0800 [thread overview]
Message-ID: <20151020060107.GA27364@shlinux2> (raw)
In-Reply-To: <1445308158-23100-1-git-send-email-jiada_wang@mentor.com>
On Tue, Oct 20, 2015 at 11:29:18AM +0900, Jiada Wang wrote:
> Currently in udc_stop, if vbus_active flag is true, all USB activities
> will be stopped, but vbus_active flag is still left to be true,
> this causes issue, when afterwards driver tries to connect gadget
> device to host, But due to the uncleared vbus_active, some necessary
> setup steps are skipped.
>
> This patch clears vbus_active flag in udc_stop callback.
>
> Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
> ---
> drivers/usb/chipidea/udc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
> index 8223fe7..b9ac228 100644
> --- a/drivers/usb/chipidea/udc.c
> +++ b/drivers/usb/chipidea/udc.c
> @@ -1762,6 +1762,7 @@ static int ci_udc_stop(struct usb_gadget *gadget)
> spin_lock_irqsave(&ci->lock, flags);
>
> if (ci->vbus_active) {
> + ci->vbus_active = 0;
> hw_device_state(ci, 0);
> if (ci->platdata->notify_event)
> ci->platdata->notify_event(ci,
> --
> 2.4.5
>
This flag will be handled by vbus interrupt, would you please explain
more what problem you have met?
--
Best Regards,
Peter Chen
next prev parent reply other threads:[~2015-10-20 6:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-20 2:29 [PATCH] usb: chipidea: udc: clear vbus_active flag in udc_stop Jiada Wang
2015-10-20 6:01 ` Peter Chen [this message]
2015-10-20 6:09 ` Jiada Wang
2015-10-20 6:28 ` Peter Chen
2015-10-20 6:33 ` Jiada Wang
2015-10-20 6:34 ` Peter Chen
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=20151020060107.GA27364@shlinux2 \
--to=peter.chen@freescale.com \
--cc=gregkh@linuxfoundation.org \
--cc=jiada_wang@mentor.com \
--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.