linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: binmlist@gmail.com (Bin Liu)
To: linux-arm-kernel@lists.infradead.org
Subject: MUSB dual-role on AM335x behaving weirdly
Date: Thu, 14 May 2015 14:29:20 -0500	[thread overview]
Message-ID: <CADYTM3bbEAVefFZtivJf5Z+2Q+1zDZEvNhqE5ytsOxDX7hjbdA@mail.gmail.com> (raw)
In-Reply-To: <20150514192125.GU24269@saruman.tx.rr.com>

On Thu, May 14, 2015 at 2:21 PM, Felipe Balbi <balbi@ti.com> wrote:
> On Thu, May 14, 2015 at 02:19:28PM -0500, Bin Liu wrote:
>> Felipe,
>>
>> On Thu, May 14, 2015 at 2:04 PM, Felipe Balbi <balbi@ti.com> wrote:
>> > On Thu, May 14, 2015 at 12:49:07PM -0500, Felipe Balbi wrote:
>> >> On Thu, May 14, 2015 at 12:40:31PM -0500, Felipe Balbi wrote:
>> >> > On Thu, May 14, 2015 at 12:07:00PM -0500, Felipe Balbi wrote:
>> >> > > Hi,
>> >> > >
>> >> > > On Wed, Feb 25, 2015 at 01:11:22PM +0100, Yegor Yefremov wrote:
>> >> > > > On 25.02.2015 12:11, Maxime Ripard wrote:
>> >> > > > > On Tue, Feb 24, 2015 at 11:33:57AM -0600, Felipe Balbi wrote:
>> >> > > > >> Hi,
>> >> > > > >>
>> >> > > > >> On Tue, Feb 24, 2015 at 05:50:50PM +0100, Maxime Ripard wrote:
>> >> > > > >>> Hi Felipe,
>> >> > > > >>>
>> >> > > > >>> On Tue, Feb 24, 2015 at 08:54:01AM -0600, Felipe Balbi wrote:
>> >> > > > >>>> Hi,
>> >> > > > >>>>
>> >> > > > >>>> On Tue, Feb 24, 2015 at 11:39:11AM +0100, Maxime Ripard wrote:
>> >> > > > >>>>> On Thu, Feb 05, 2015 at 02:21:42PM +0100, Maxime Ripard wrote:
>> >> > > > >>>>>> Hi,
>> >> > > > >>>>>>
>> >> > > > >>>>>> On Thu, Jan 22, 2015 at 08:37:45AM +0100, Yegor Yefremov wrote:
>> >> > > > >>>>>>> I have the same experience with 3.15. The switching is working when
>> >> > > > >>>>>>> CONFIG_USB_MUSB_DUAL_ROLE is set and dr_mode = "otg". But since 3.16
>> >> > > > >>
>> >> > > > >> since 3.16 ?
>> >> > > > >
>> >> > > > > That's what Yegor said. I never saw it working with 3.15 either.
>> >> > > >
>> >> > > > I've used 3.15.1 and 3.15.2 with this set of patches:
>> >> > > > https://github.com/visionsystemsgmbh/onrisc_br_bsp/tree/master/board/vscom/kernel-patches/linux-3.15
>> >> > > >
>> >> > > > And it worked so far. The system:
>> >> > > > http://www.visionsystems.de/produkte/baltos-ir-5221.html
>> >> > >
>> >> > > I've had more time to look into this (thanks Yegor for sponsoring a
>> >> > > test/dev platform) what I noticed is that Connect IRQ takes seconds to
>> >> > > fire up.  Below a tiny log snippet after pluging USB OTG adapter cable
>> >> > > that came with IR5521:
>> >> > >
>> >> > > | [ 1227.200514] musb-hdrc musb-hdrc.1.auto: usbintr (100) epintr(0)
>> >> > >
>> >> > > Cable connected. ID is grounded. 0x100 == DRVVBUS IRQ
>> >> > >
>> >> > > | [ 1227.206788] musb-hdrc musb-hdrc.1.auto: VBUS on (a_wait_vrise), devctl 19
>> >> > >
>> >> > > MUSB starts to wait for VBUS to reach Session valid threshold
>> >> > >
>> >> > > | [ 1230.281159] musb-hdrc musb-hdrc.1.auto: usbintr (10) epintr(0)
>> >> > >
>> >> > > 3 seconds later connect interrupt happens. Looking at VBUS charge time
>> >> > > with a scope, it's quite ok. VBUS charges in about 1.77ms. I'll dig
>> >> > > further into this.
>> >> >
>> >> > even more weird. If I disconnect device from OTG adapter, rather than
>> >> > OTG adapter from IR5521, this leave ID pin grounded, which means DRVVBUS
>> >> > is still asserted and VBUS remains above session valid threshold.
>> >> >
>> >> > Even in this case, when I connect the device on the other end of the
>> >> > cable, I still see some 3 seconds delay from the time device is
>> >> > connected, to the time connect IRQ fires up.
>> >>
>> >> seems to be a problem with the USB stick I'm using. Tested two other
>> >> devices and they connect right away.
>> >
>> > ok, fixing DRD on AM335x will take longer than I originally expected,
>> > probably won't be ready for v4.2 :-(
>>
>> Are you able replicate the issue with TI AM335x GP EVM? I am wondering
>> if the is custom board design problem? have you checked the custom
>> board schematics?
>
> don't have either AM335x GP EVM nor schematics for this board. But it's
> certainly not a problem with the board. It's very easy to replicate the
> problem:
>
> Set dr-mode to otg, load g_zero, connect to PC and as quickly as you
> can, remove cable and attach otg cable with a mouse or whatever on the
> other end.
>
> First time, mouse won't enumerate (no IRQs fire) remove and connect
> again. You should see a Babble IRQ.

And this only happens with 3.16+, not older kernels? I have a GP EVM,
and can try to take a look.

/me just figured out the modem issue, and in a very good mood now ;)

>
> --
> balbi

  reply	other threads:[~2015-05-14 19:29 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 16:06 MUSB dual-role on AM335x behaving weirdly Maxime Ripard
2015-01-21 18:53 ` Bin Liu
2015-01-22  7:37   ` Yegor Yefremov
2015-01-22 10:43     ` Maxime Ripard
2015-01-22 11:01       ` Markus Pargmann
2015-01-22 14:00         ` Maxime Ripard
2015-01-22 14:52           ` Bin Liu
2015-02-05 13:21     ` Maxime Ripard
2015-02-24 10:39       ` Maxime Ripard
2015-02-24 14:54         ` Felipe Balbi
2015-02-24 16:50           ` Maxime Ripard
2015-02-24 17:33             ` Felipe Balbi
2015-02-25 11:11               ` Maxime Ripard
2015-02-25 12:11                 ` Yegor Yefremov
2015-05-14 17:07                   ` Felipe Balbi
2015-05-14 17:40                     ` Felipe Balbi
2015-05-14 17:49                       ` Felipe Balbi
2015-05-14 19:04                         ` Felipe Balbi
2015-05-14 19:19                           ` Bin Liu
2015-05-14 19:21                             ` Felipe Balbi
2015-05-14 19:29                               ` Bin Liu [this message]
2015-05-14 19:29                                 ` Felipe Balbi
2015-05-14 19:49                                   ` Felipe Balbi
2015-05-14 20:03                                     ` Bin Liu
2015-05-14 20:10                                       ` Felipe Balbi
2015-05-14 21:04                                   ` Bin Liu
2015-05-14 21:16                                     ` Bin Liu
2015-05-14 21:26                                       ` Alexandre Belloni
2015-05-14 21:36                                         ` Bin Liu
2015-05-26 14:51                                           ` Felipe Balbi
2015-05-27  9:42                                             ` Alexandre Belloni
2015-07-02  7:16                                               ` Gregory CLEMENT
2015-07-02 17:05                                                 ` Bin Liu
2015-08-04 13:08                                                   ` Gregory CLEMENT
2015-08-04 14:23                                                     ` Gregory CLEMENT
2015-08-04 19:32                                                       ` Felipe Balbi
2015-08-18 12:36                                                         ` Gregory CLEMENT
2015-08-18 14:13                                                           ` Felipe Balbi
2015-08-20 16:35                                                             ` Gregory CLEMENT
2015-08-20 16:46                                                               ` Felipe Balbi
2015-08-21 12:19                                                                 ` Gregory CLEMENT
2015-04-14 15:46       ` Maxime Ripard

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=CADYTM3bbEAVefFZtivJf5Z+2Q+1zDZEvNhqE5ytsOxDX7hjbdA@mail.gmail.com \
    --to=binmlist@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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 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).