linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bin Liu <b-liu-l0cyMroinI0@public.gmane.org>
To: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>,
	Andreas Kemnade <andreas-cLv4Z9ELZ06ZuzBka8ofvg@public.gmane.org>,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Laurent Pinchart
	<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
Subject: Re: [PATCHv2] usb: musb: Fix unbalanced platform_disable
Date: Mon, 12 Sep 2016 12:34:32 -0500	[thread overview]
Message-ID: <20160912173432.GI18340@uda0271908> (raw)
In-Reply-To: <20160912173242.GH18340@uda0271908>

On Mon, Sep 12, 2016 at 12:32:42PM -0500, Bin Liu wrote:
> On Mon, Sep 12, 2016 at 10:19:40AM -0700, Tony Lindgren wrote:
> > * Bin Liu <b-liu-l0cyMroinI0@public.gmane.org> [160912 09:55]:
> > > Hi Tony,
> > > 
> > > On Mon, Sep 12, 2016 at 08:39:49AM -0700, Tony Lindgren wrote:
> > > > Commit a83e17d0f73b ("usb: musb: Improve PM runtime and phy handling
> > > > for 2430 glue layer") moved PHY enable/disable calls to happen from
> > > > omap2430_musb_enable/disable(). That broke enumeration for several
> > > > devices as PM runtime in the PHY will never enable it.
> > > > 
> > > > The root cause of the problem is unpaired calls from musb_core.c to
> > > > musb_platform_enable/disable in musb_core.c as reported by
> > > > Andreas Kemnade <andreas-cLv4Z9ELZ06ZuzBka8ofvg@public.gmane.org>.
> > > > 
> > > > As musb_platform_enable/disable are being called from various functions,
> > > > let's not attempt to make them paiered immediately. This would require
> > > > fixing all the callers like musb_remove.
> > > > 
> > > > Instead, let's first fix the regression in a minimal way by removing
> > > > the initial call to musb_platform_disable.
> > > > 
> > > > AFAIK the initial musb_platform_disable call has always been just an
> > > > attempted workaround for the 2430 glue layer announcing itself too
> > > > early before the gadgets are configured. And that issue finally
> > > 
> > > Many glue layers rely on musb_platform_diable to disable interrupts in
> > > musb_init_controller() before registering ISR, is it safe to assume the
> > > interrupts will be masked when musb is out-of-reset so that we don't
> > > have to call musb_platform_disable() in musb_init_controller()?
> > 
> > It should be, we do request_irq only later on after this in musb_core.c.
> > And the glue layers don't do request_irq except for the separate DMA
> > interrupts in two cases.
> 
> Yeah, the glue layer does not do request_irq, core does it after called
> musb_platform_disable(), in which some glues mask interrupts.
> 
> If musb_init_controller() no longer calls musb_platform_disable(), it
> kinda worries me. I have asked around, no one says that it is a safe
> assumption that interrupt will be masked when out-of-reset, though it is
> common sense.
> 
> This change should not break any glue layer which relies on
> musb_platform_disable() to disable interrupts.
> 
> So Kishon, if you take this patch in your tree, here is my 
> 
> Signed-off-by: Bin Liu <b-liu-l0cyMroinI0@public.gmane.org>

Ahh, should be

Acked-by: Bin Liu <b-liu-l0cyMroinI0@public.gmane.org>

> 
> Regards,
> -Bin.
> 
> > 
> > And as the platform glue layer are the ones doing the probing, they
> > should initialize things into sane state :)
> > 
> > We could add a call irq_set_status_flags(irq, IRQ_NOAUTOEN) before
> > request_irq. But I'm guessing there's no need to.. Do you have some
> > example in mind that should be tested?
> > 
> > Regards,
> > 
> > Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-09-12 17:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 15:39 [PATCHv2] usb: musb: Fix unbalanced platform_disable Tony Lindgren
     [not found] ` <20160912153947.k4gnggur6usyujii-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-09-12 16:54   ` Bin Liu
2016-09-12 17:19     ` Tony Lindgren
     [not found]       ` <20160912171938.5fmx2qi6xtzsohpy-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-09-12 17:32         ` Bin Liu
2016-09-12 17:34           ` Bin Liu [this message]
2016-09-12 17:34         ` Tony Lindgren
     [not found]           ` <20160912173406.6qalsmolsylc2suq-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-09-12 18:05             ` Andreas Kemnade
2016-09-12 18:12               ` Tony Lindgren
     [not found]                 ` <20160912181229.nl56kapwcfok352b-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-09-12 18:33                   ` Tony Lindgren
2016-09-12 18:35               ` Bin Liu
2016-09-13  3:18                 ` Tony Lindgren
     [not found]                   ` <20160913031805.m5nzyqyclh4pyj6k-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-09-13 14:14                     ` Bin Liu
2016-09-13 14:32                       ` Laurent Pinchart
2016-09-13 14:40                         ` Bin Liu
2016-09-13 14:53                           ` Tony Lindgren
2016-09-18 12:14   ` Laurent Pinchart
2016-09-18 15:19     ` Tony Lindgren
     [not found]       ` <20160918151901.k7go65s4jauldxcl-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-09-19  5:59         ` Andreas Kemnade
2016-09-19 16:02           ` Tony Lindgren
     [not found]             ` <20160919160250.itstpdk2rqw3zhzi-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-09-20  5:04               ` Andreas Kemnade
2016-09-20 14:35                 ` Tony Lindgren
2016-09-19 20:35         ` Laurent Pinchart
2016-09-19 22:41           ` Tony Lindgren
     [not found]             ` <20160919224149.3msqxiv24ofwjz4c-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-09-20  6:36               ` Laurent Pinchart
2016-09-20 17:10                 ` Tony Lindgren
     [not found]                   ` <20160920171024.mnfjelzxjgv7s7dv-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-09-20 18:37                     ` Tony Lindgren
     [not found]                       ` <20160920183701.nxme7yxgc6jpmgio-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-09-28 18:42                         ` Tony Lindgren
     [not found]                           ` <20160928184234.zoleas3mvpxso36r-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2016-09-29  9:38                             ` Laurent Pinchart
2016-09-30 17: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=20160912173432.GI18340@uda0271908 \
    --to=b-liu-l0cymroini0@public.gmane.org \
    --cc=andreas-cLv4Z9ELZ06ZuzBka8ofvg@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=kishon-l0cyMroinI0@public.gmane.org \
    --cc=laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.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).