Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Bin Liu <b-liu@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
	Jacopo Mondi <jacopo@jmondi.org>, Marcel Partap <mpartap@gmx.net>,
	Merlijn Wajer <merlijn@wizzup.org>,
	Michael Scott <hashcode0f@gmail.com>, NeKit <nekit1000@gmail.com>,
	Pavel Machek <pavel@ucw.cz>, Sebastian Reichel <sre@kernel.org>
Subject: [PATCH 2/7] usb: musb: omap2430: Wait on enable to avoid babble
Date: Wed,  9 Oct 2019 14:21:39 -0700
Message-ID: <20191009212145.28495-3-tony@atomide.com> (raw)
In-Reply-To: <20191009212145.28495-1-tony@atomide.com>

We can babble interrupt if we attempt to switch to USB host mode too
soon after enabling musb. Let's fix the issue by waiting a bit in
runtime_resume.

Cc: Jacopo Mondi <jacopo@jmondi.org>
Cc: Marcel Partap <mpartap@gmx.net>
Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Michael Scott <hashcode0f@gmail.com>
Cc: NeKit <nekit1000@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/usb/musb/omap2430.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -550,6 +550,9 @@ static int omap2430_runtime_resume(struct device *dev)
 	musb_writel(musb->mregs, OTG_INTERFSEL,
 		    musb->context.otg_interfsel);
 
+	/* Wait for musb to get oriented. Otherwise we can get babble */
+	usleep_range(200000, 250000);
+
 	return 0;
 }
 
-- 
2.23.0

  parent reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09 21:21 [PATCHv2 0/7] musb host improvments mostly for omap2430 glue Tony Lindgren
2019-10-09 21:21 ` [PATCH 1/7] usb: musb: omap2430: Get rid of musb .set_vbus " Tony Lindgren
2019-10-09 21:21 ` Tony Lindgren [this message]
2019-10-10  9:46   ` [PATCH 2/7] usb: musb: omap2430: Wait on enable to avoid babble Sergei Shtylyov
2019-10-16 15:39     ` Tony Lindgren
2019-10-09 21:21 ` [PATCH 3/7] usb: musb: omap2430: Handle multiple ID ground interrupts Tony Lindgren
2019-10-13 11:32   ` Pavel Machek
2019-10-09 21:21 ` [PATCH 4/7] usb: musb: Add musb_set_host and peripheral and use them for omap2430 Tony Lindgren
2019-10-09 21:21 ` [PATCH 5/7] usb: musb: omap2430: Clean up enable and remove devctl tinkering Tony Lindgren
2019-10-09 21:21 ` [PATCH 6/7] usb: musb: omap2430: Idle musb on init Tony Lindgren
2019-10-09 21:21 ` [PATCH 7/7] usb: musb: Get rid of omap2430_musb_set_vbus() Tony Lindgren
2019-10-13 14:34   ` Pavel Machek

Reply instructions:

You may reply publically 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=20191009212145.28495-3-tony@atomide.com \
    --to=tony@atomide.com \
    --cc=b-liu@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hashcode0f@gmail.com \
    --cc=jacopo@jmondi.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=merlijn@wizzup.org \
    --cc=mpartap@gmx.net \
    --cc=nekit1000@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=sre@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

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git