linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: wanghui <Hui.Wang@windriver.com>
To: Wang Hui <Hui.Wang@windriver.com>
Cc: tony@atomide.com, felipe.balbi@nokia.com,
	linux-omap@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2] USB: musb: add two states to handle vbus error
Date: Tue, 16 Mar 2010 18:49:33 +0800	[thread overview]
Message-ID: <4B9F623D.6060406@windriver.com> (raw)
In-Reply-To: <1268648622-28529-1-git-send-email-Hui.Wang@windriver.com>

On omap platforms, when configuring the kernel, if we choose the musb 
work as host or OTG mode and we plug
a mini-A cable into the socket, after the kernel boot up in host mode or 
insmod gadget driver in OTG mode,
the state of musb's xceiv is A_IDLE or B_IDLE correspondingly because id 
change can't trigger ISR. Under this
condition, if we hotplug a usb device(without self-powered) at the other 
side of the cable, the musb will suffer a vbus error,
This patch can handle this vbus error.

Wang Hui wrote:
> When the MUSB is configured as host mode or OTG mode, the xceiv->state
> will be set to OTG_STATE_A_IDLE or OTG_STATE_B_IDLE unconditionally
> during init process. These init states can change to other
> states When the MUSB module detects id pin change, devices connect or
> disconnect.
> But on some platforms(omap2, omap3), the id pin change
> can't raise IRQ request to the MUSB module, so on these platforms,
> the init xceiv->state will be A_IDLE or B_IDLE. Under this condition,
> when we want the MUSB to act as a host and hotplug a usb device in
> mini-B side of the cable, the MUSB will have a possibility to suffer
> power underrun under A_IDLE or B_IDLE state, So here adding these
> two states under which we can handle VBUSERROR IRQ.
>
> Signed-off-by: Wang Hui <Hui.Wang@windriver.com>
> ---
>  drivers/usb/musb/musb_core.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index b4bbf8f..655413c 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -516,6 +516,8 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
>  			 * another reset is due (at least for high speed,
>  			 * to redo the chirp etc), it might work OK...
>  			 */
> +		case OTG_STATE_A_IDLE:
> +		case OTG_STATE_B_IDLE:
>  		case OTG_STATE_A_WAIT_BCON:
>  		case OTG_STATE_A_WAIT_VRISE:
>  			if (musb->vbuserr_retry) {
>   


      parent reply	other threads:[~2010-03-16 10:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-15 10:23 [PATCH 1/2] USB: musb: add two states to handle vbus error Wang Hui
     [not found] ` <1268648622-28529-1-git-send-email-Hui.Wang-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
2010-03-15 10:23   ` [PATCH 2/2] USB: musb: omap2430: add mode change from A to B Wang Hui
     [not found]     ` <1268648622-28529-2-git-send-email-Hui.Wang-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
2010-03-15 11:22       ` Sergei Shtylyov
     [not found]         ` <4B9E187E.6090802-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
2010-03-15 16:10           ` Felipe Balbi
2010-03-16 10:13             ` wanghui
     [not found]               ` <4B9F59DE.4070807-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
2010-03-16 14:46                 ` Felipe Balbi
2010-07-22 15:16     ` Kan-Ru Chen
     [not found]       ` <877hknwnrb.fsf-ONHucydYG54+Yz5RL6G0bA@public.gmane.org>
2010-07-22 16:40         ` Felipe Balbi
2010-07-23  4:38           ` Kan-Ru Chen
2010-03-16 10:49 ` wanghui [this message]

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=4B9F623D.6060406@windriver.com \
    --to=hui.wang@windriver.com \
    --cc=felipe.balbi@nokia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=tony@atomide.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).