linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Roger Quadros <rogerq@ti.com>
Cc: Felipe Balbi <balbi@kernel.org>, Tero Kristo <t-kristo@ti.com>,
	"Gerlach, Dave" <d-gerlach@ti.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nishanth Menon <nm@ti.com>, "Nori, Sekhar" <nsekhar@ti.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	Johan Hovold <johan@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [2/2] usb: dwc3: of_simple: don't call pm_runtime_set_active()
Date: Thu, 14 Jun 2018 09:57:52 +0200	[thread overview]
Message-ID: <20180614075752.GB32411@localhost> (raw)

On Wed, Jun 13, 2018 at 02:15:11PM +0300, Roger Quadros wrote:
> On 31/05/18 10:59, Felipe Balbi wrote:
> > 
> > Hi,
> > 
> > Roger Quadros <rogerq@ti.com> writes:
> > 
> >> On 30/05/18 15:31, Felipe Balbi wrote:
> >>> Roger Quadros <rogerq@ti.com> writes:
> >>>
> >>>> Don't call pm_runtime_set_active() as it will prevent the device
> >>>> from being activated in the next pm_runtime_get_sync() call.
> >>>>
> >>>> Also call pm_runtime_get_sync() before of_platform_populate().
> >>>>
> >>>> Signed-off-by: Roger Quadros <rogerq@ti.com>
> >>>
> >>> This patch is wrong.
> >>>
> >>>> ---
> >>>>  drivers/usb/dwc3/dwc3-of-simple.c | 7 +++----
> >>>>  1 file changed, 3 insertions(+), 4 deletions(-)
> >>>>
> >>>> diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c
> >>>> index e98d221..2cbb5c0 100644
> >>>> --- a/drivers/usb/dwc3/dwc3-of-simple.c
> >>>> +++ b/drivers/usb/dwc3/dwc3-of-simple.c
> >>>> @@ -121,6 +121,9 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
> >>>>  	if (ret)
> >>>>  		goto err_resetc_assert;
> >>>>  
> >>>> +	pm_runtime_enable(dev);
> >>>> +	pm_runtime_get_sync(dev);
> >>>
> >>> No, this is the wrong way to do things. My device should be enabled
> >>> already from probe, specially since I have already enabled clocks.
> >>
> >> As far as I understood just enabling clocks (which might not
> >> include bus clock) doesn't ensure device is enabled.

In general, that cannot be assumed no. Specifically, this cannot
currently be assumed for OMAP due to how its power domain has been
implemented.

> >> Did you mean that I don't need to do a pm_runtime_get_sync() to
> >> enable my device in probe?
> >> Who is enabling by device for me then? Is device core supposed to
> >> do it?

Driver core calls the power domain activate() callback before probe, but
OMAP does not implement that callback. So you're right that you
currently need a pm_runtime_get_sync() in probe instead of setting
status active explicitly as the OMAP pm domain will not enable the bus
clock otherwise.

You still need to deal with the current driver explicit clock enable if
you want to change this, though.

Johan
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2018-06-14  7:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14  7:57 Johan Hovold [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-06-13 11:15 [2/2] usb: dwc3: of_simple: don't call pm_runtime_set_active() Roger Quadros
2018-05-31 14:37 Johan Hovold
2018-05-31 14:07 Alan Stern
2018-05-31 13:25 Johan Hovold
2018-05-31  7:59 Felipe Balbi
2018-05-31  7:23 Roger Quadros
2018-05-30 12:31 Felipe Balbi
2018-05-28 15:41 Johan Hovold
2018-05-28 14:36 Roger Quadros

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=20180614075752.GB32411@localhost \
    --to=johan@kernel.org \
    --cc=balbi@kernel.org \
    --cc=d-gerlach@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=nsekhar@ti.com \
    --cc=rogerq@ti.com \
    --cc=stern@rowland.harvard.edu \
    --cc=t-kristo@ti.com \
    /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).