[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180614075752.GB32411@localhost>
Date: Thu, 14 Jun 2018 09:57:52 +0200
From: Johan Hovold <johan@...nel.org>
To: Roger Quadros <rogerq@...com>
Cc: Felipe Balbi <balbi@...nel.org>, Tero Kristo <t-kristo@...com>,
"Gerlach, Dave" <d-gerlach@...com>, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org, Nishanth Menon <nm@...com>,
"Nori, Sekhar" <nsekhar@...com>,
Alan Stern <stern@...land.harvard.edu>,
Johan Hovold <johan@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH 2/2] usb: dwc3: of_simple: don't call
pm_runtime_set_active()
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@...com> writes:
> >
> >> On 30/05/18 15:31, Felipe Balbi wrote:
> >>> Roger Quadros <rogerq@...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@...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
Powered by blists - more mailing lists