From: Felipe Balbi <balbi@ti.com>
To: ian coolidge <iancoolidge@gmail.com>
Cc: balbi@ti.com, Tony Lindgren <tony@atomide.com>,
Grazvydas Ignotas <notasas@gmail.com>,
linux-usb@vger.kernel.org,
linux-omap <linux-omap@vger.kernel.org>,
felipe.contreras@gmail.com, icoolidge@trellisware.com
Subject: Re: MUSB-HDRC Gadget driving VBUS inappropriately
Date: Mon, 17 Dec 2012 18:13:03 +0200 [thread overview]
Message-ID: <20121217161302.GD22943@arwen.pp.htv.fi> (raw)
In-Reply-To: <CACqpBg54RfyyLA-seGegLX0uGpfDDX3GueyFhe12C0OU8N_6oQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2869 bytes --]
On Fri, Dec 14, 2012 at 05:38:10PM -0800, ian coolidge wrote:
> Felipe, Tony, Grazvydas, Thanks for the responses,
>
> On Fri, Dec 14, 2012 at 4:13 AM, Felipe Balbi <balbi@ti.com> wrote:
>
> > Hi,
> >
> > On Fri, Dec 14, 2012 at 02:13:07PM +0200, Grazvydas Ignotas wrote:
> > > On Fri, Dec 14, 2012 at 11:53 AM, Ian Coolidge <iancoolidge@gmail.com>
> > wrote:
> > > > we find that with about a 2% chance, the gadget comes up in some kind
> > of firmware failed state, driving VBUS.
> > > > In this condition, we found that MUSB_DEVCTL_SESSION bit was set.
> > > > I understand this to be indicative of MUSB thinking it is in host
> > mode, which agrees with the driven VBUS.
> > > > Further, in this state, I found that usually, there was one interrupt
> > from twl4030_usb, but NO interrupts from musb-hdrc.
> > >
> > > I'm also also often seeing this and don't know any workaround except
> > > powercycling the board :(
> > > This was kind or relieved for me after I changed it to deinit musb on
> > > shutdown/reset (3.3 should have that patch merged), however if you
> > > randomly reset the board, there is still something like 30-50% chance
> > > musb will come up dead, and on proper reset it's still something like
> > > 5% chance like you reported.
> >
> > hehe, then you should've reported earlier :-)
> >
> > Anyway, I really think this has something to do with some bogus
> > set_vbus() calls.
> >
> > Likely that looking at probe() path for checks for MUSB_DEVCTL_VBUS will
> > probably show you something which is wrong. Maybe the driver is assuming
> > that if VBUS bitfield is zero, then it kicks host side, or something.
> >
> > Go over that part of the code and you probably will find something.
> >
> > --
> > balbi
> >
>
> So, I did some more testing, just printing out MUSB_DEVCTL each time. At
> omap2430.c "init",
> musb_probe()->musb_init_controller()->omap2430_musb_init(),
> I always saw 0x80. This corresponds to MUSB_DEVCTL_BDEVICE.
> It appears, then, that the MUSB is initialized correctly, but becomes bad
> somehow. I'll continue to dig into this, but it would be nice to have some
> simple abstract description of what the SESSION bit actually does here.
> It's used as both an input and an output throughout the MUSB Linux driver,
> and judging by comments, appears to have different behavior in different
> configurations. Felipe?
Session bit, really means a session, a USB session. It has different
meanings (to some extent) when working with Host or Gadget. For Gadget
mode, the session bit also triggers SRP, on host mode, maybe it's used
to start sourcing VBUS, who knows.
Also look at the usage of musb->is_active. That's a flag use for host
mode. IIRC, it tells other parts of the driver to connect the vbus
charge pump, but my memory fails now :-s
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-12-17 16:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-14 9:53 MUSB-HDRC Gadget driving VBUS inappropriately Ian Coolidge
[not found] ` <C3E8C797-AE49-4638-B41B-B3AE180D3426-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-14 10:00 ` Felipe Balbi
2012-12-14 12:13 ` Grazvydas Ignotas
2012-12-14 12:13 ` Felipe Balbi
[not found] ` <CACqpBg54RfyyLA-seGegLX0uGpfDDX3GueyFhe12C0OU8N_6oQ@mail.gmail.com>
2012-12-17 16:13 ` Felipe Balbi [this message]
2012-12-14 18:43 ` Tony Lindgren
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=20121217161302.GD22943@arwen.pp.htv.fi \
--to=balbi@ti.com \
--cc=felipe.contreras@gmail.com \
--cc=iancoolidge@gmail.com \
--cc=icoolidge@trellisware.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=notasas@gmail.com \
--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 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.