From: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
To: Michael Nazzareno Trimarchi
<michael-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
Cc: Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Eyal Reizer <eyalr-l0cyMroinI0@public.gmane.org>,
Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>,
Guy Mishol <guym-l0cyMroinI0@public.gmane.org>,
Luca Coelho
<luciano.coelho-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Maital Hahn <maitalm-l0cyMroinI0@public.gmane.org>,
Maxim Altshul <maxim.altshul-l0cyMroinI0@public.gmane.org>,
Shahar Patury <shaharp-l0cyMroinI0@public.gmane.org>,
linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Linux OMAP Mailing List
<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 2/2] wlcore: Add support runtime PM
Date: Tue, 15 May 2018 09:25:46 -0700 [thread overview]
Message-ID: <20180515162546.GO98604@atomide.com> (raw)
In-Reply-To: <CAOf5uwkT4Vg1kQn5k=_z9XjXOLWbA0vioqH6KSdikZbCwyaYbA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
* Michael Nazzareno Trimarchi <michael-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org> [180515 16:19]:
> On Tue, May 15, 2018 at 6:13 PM, Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org> wrote:
> > @@ -315,15 +319,17 @@ static ssize_t dynamic_fw_traces_write(struct file *file,
> > if (unlikely(wl->state != WLCORE_STATE_ON))
> > goto out;
> >
> > - ret = wl1271_ps_elp_wakeup(wl);
> > - if (ret < 0)
> > + ret = pm_runtime_get_sync(wl->dev);
> > + if (ret < 0) {
> > + pm_runtime_put_noidle(wl->dev);
> > goto out;
> > + }
> >
>
> Can you just change ps_elp_wakeup with
> ret = pm_runtime_get_sync(wl->dev);
> if (ret < 0) {
> pm_runtime_put_noidle(wl->dev);
> goto out;
> }
>
> > ret = wl18xx_acx_dynamic_fw_traces(wl);
> > if (ret < 0)
> > count = ret;
> >
> > - wl1271_ps_elp_sleep(wl);
> > + pm_runtime_put(wl->dev);
>
> and elp_sleep with this one
That's what I started with, but they really behave in a different way. And
there is no usage count. It's really best to just get rid of the custom PM
calls in favor of generic calls. That's because then we have much better
control for future changes in the driver with pm_runtime_use_autosuspend()
and pm_runtime_put_sync() for example.
Regards,
Tony
next prev parent reply other threads:[~2018-05-15 16:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-15 16:13 [PATCH 0/2] Runtime PM support for wlcore Tony Lindgren
[not found] ` <20180515161315.1997-1-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2018-05-15 16:13 ` [PATCH 1/2] wlcore: Make sure PM calls are paired Tony Lindgren
[not found] ` <20180515161315.1997-2-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2018-05-16 15:43 ` Tony Lindgren
2018-05-16 16:17 ` Tony Lindgren
2018-05-15 16:13 ` [PATCH 2/2] wlcore: Add support runtime PM Tony Lindgren
[not found] ` <20180515161315.1997-3-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2018-05-15 16:17 ` Michael Nazzareno Trimarchi
[not found] ` <CAOf5uwkT4Vg1kQn5k=_z9XjXOLWbA0vioqH6KSdikZbCwyaYbA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-05-15 16:25 ` Tony Lindgren [this message]
2018-05-16 9:27 ` Kalle Valo
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=20180515162546.GO98604@atomide.com \
--to=tony-4v6ys6ai5vpbdgjk7y7tuq@public.gmane.org \
--cc=eyalr-l0cyMroinI0@public.gmane.org \
--cc=guym-l0cyMroinI0@public.gmane.org \
--cc=kishon-l0cyMroinI0@public.gmane.org \
--cc=kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=luciano.coelho-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=maitalm-l0cyMroinI0@public.gmane.org \
--cc=maxim.altshul-l0cyMroinI0@public.gmane.org \
--cc=michael-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org \
--cc=shaharp-l0cyMroinI0@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).