linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: yegor.yefremov@visionsystems.de (Yegor Yefremov)
To: linux-arm-kernel@lists.infradead.org
Subject: MUSB dual-role on AM335x behaving weirdly
Date: Thu, 22 Jan 2015 08:37:45 +0100	[thread overview]
Message-ID: <54C0A8C9.3040201@visionsystems.de> (raw)
In-Reply-To: <CADYTM3b40_u4Twt27PBVH4dC9ErDnFEi0AUzs_aJRM3mMHaBCQ@mail.gmail.com>

On 21.01.2015 19:53, Bin Liu wrote:
> Hi,
> 
> On Wed, Jan 21, 2015 at 10:06 AM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
>> Hi Felipe,
>>
>> I'm currently working on a custom AM335x-based board, that has a OTG
>> connector wired to one of the musb controlers, and Linux 3.17
>>
>> This OTG connector seems to behave in a weird way when it comes to
>> switching from one role to another:
>>
>>   - The host mode works with CONFIG_USB_MUSB_DUAL_ROLE set, only if
>>     the dr_mode is set to host in the DT, and only if we plug the USB
>>     device after the kernel has booted. Otherwise, even though the
>>     controller seems to be set up as host in the kernel logs, it
>>     doesn't work. When DR-mode is set to otg, DRVVBUS is not high
>>     which surely doesn't help, but there might be some other issues.
>>
>>   - The gadget mode works with CONFIG_USB_MUSB_DUAL_ROLE, if dr_mode
>>     is set to otg and not host (obviously), and only if we plug the
>>     USB cable after the kernel has booted.
>>
>>   - The gadget mode works with CONFIG_USB_MUSB_GADGET, and with
>>     dr_mode set to otg, even if we cold plug the device.
>>
>>   - As you might expect from the two first items, the runtime
>>     switching from gadget to host when CONFIG_USB_MUSB_DUAL_ROLE is
>>     set and dr_mode is set in otg doesn't work either.
>>
>> It looks like it's only waiting for an interrupt to occur to read the
>> ID pin state, without reading its initial value, which would explain
>> why both the host and gadget enumerate only when a device/cable is
>> hotplugged, and that there's some configuration bits that differ
>> whenever dr_mode changes, but I couldn't really see anything standing
>> out in the driver nor the datasheet.
>>
>> Have you already experienced something alike with that driver?
> 
> I don't use vanilla mainline kernel very often, but I don't have such
> hotplug issues with TI 3.12/14 kernels [1]. I only use
> CONFIG_USB_MUSB_DUAL_ROLE though.
> 
> [1] git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git, branch
> remote/origin/linux-3.14.y

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 it seems to be broken. Still had no time to bisect this.

Yegor

  reply	other threads:[~2015-01-22  7:37 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 [this message]
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
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=54C0A8C9.3040201@visionsystems.de \
    --to=yegor.yefremov@visionsystems.de \
    --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).