linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Pavel Machek <pavel@denx.de>, Bin Liu <b-liu@ti.com>,
	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>,
	Sebastian Reichel <sre@kernel.org>
Subject: Re: [PATCH 0/4] musb host improvments mostly for omap2430 glue
Date: Sun, 15 Sep 2019 18:20:23 -0700	[thread overview]
Message-ID: <20190916012023.GX52127@atomide.com> (raw)
In-Reply-To: <20190903080725.GA26076@amd>

Hi,

* Pavel Machek <pavel@ucw.cz> [190903 08:08]:
> On Mon 2019-09-02 09:06:51, Tony Lindgren wrote:
> #2 definitely has _something_, because it does work in original
>  android. But not even original android provides VBUS (5V on USB) in
>  that configuration. It also looks like hardware _can_ provide at
>  least VBAT on VBUS, because I seen that during some of the crashes.

I started seeing the musb hang issue you reported today
on one droid4 but not on an other one :) Turns out we have
racy .set_vbus still around that might get called.

The following patch is needed in preparation for this $subject
series as otherwise patch "[PATCH 3/4] usb: musb: Add
musb_set_host and peripheral and use them for omap2430" can
cause a hang with "scheduling while atomic" if .set_vbus
gets called from musb_stage0_irq() path.

Regards,

Tony

8< -----------------
From tony Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@atomide.com>
Date: Sun, 15 Sep 2019 17:16:58 -0700
Subject: [PATCH] usb: musb: Get rid of musb_set_vbus()

We currently have musb_set_vbus() called from two different paths. Mostly
it gets called from the USB PHY via omap_musb_set_mailbox(), but in some
cases it can get also called from musb_stage0_irq() rather via .set_vbus:

(musb_set_host [musb_hdrc])
(omap2430_musb_set_vbus [omap2430])
(musb_stage0_irq [musb_hdrc])
(musb_interrupt [musb_hdrc])
(omap2430_musb_interrupt [omap2430])

This is racy and will not work with introducing generic helper functions
for musb_set_host() and musb_set_peripheral(). We want to get rid of the
busy loops in favor of usleep_range().

Let's just get rid of .set_vbus for omap2430 glue layer and let the PHY
code handle VBUS with musb_set_vbus(). Note that in the follow-up patch
we can completely remove omap2430_musb_set_vbus(), but let's do it in a
separate patch as this change may actually turn out to be needed as a
fix.

Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/usb/musb/omap2430.c | 2 --
 1 file changed, 2 deletions(-)

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
@@ -312,8 +312,6 @@ static const struct musb_platform_ops omap2430_ops = {
 	.init		= omap2430_musb_init,
 	.exit		= omap2430_musb_exit,
 
-	.set_vbus	= omap2430_musb_set_vbus,
-
 	.enable		= omap2430_musb_enable,
 	.disable	= omap2430_musb_disable,
 
-- 
2.23.0

  reply	other threads:[~2019-09-16  1:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-30 23:20 [PATCH 0/4] musb host improvments mostly for omap2430 glue Tony Lindgren
2019-08-30 23:20 ` [PATCH 1/4] usb: musb: omap2430: Wait on enable to avoid babble Tony Lindgren
2019-08-30 23:20 ` [PATCH 2/4] usb: musb: omap2430: Handle multiple ID ground interrupts Tony Lindgren
2019-08-30 23:20 ` [PATCH 3/4] usb: musb: Add musb_set_host and peripheral and use them for omap2430 Tony Lindgren
2019-08-30 23:20 ` [PATCH 4/4] usb: musb: omap2430: Clean up enable and remove devctl tinkering Tony Lindgren
2019-09-01 19:39 ` next-20190830 on Droid 4 was Re: [PATCH 0/4] musb host improvments mostly for omap2430 glue Pavel Machek
2019-09-01 19:49   ` Pavel Machek
2019-09-02  9:23 ` Pavel Machek
2019-09-02  9:44   ` Pavel Machek
2019-09-02 16:06     ` Tony Lindgren
2019-09-03  8:07       ` Pavel Machek
2019-09-16  1:20         ` Tony Lindgren [this message]
2019-09-16  1:26           ` 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=20190916012023.GX52127@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@denx.de \
    --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
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).