[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250709162805.37e472ac@jic23-huawei>
Date: Wed, 9 Jul 2025 16:28:05 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...el.com>
Cc: Sakari Ailus <sakari.ailus@...ux.intel.com>, David Lechner
<dlechner@...libre.com>, Nuno Sá <nuno.sa@...log.com>, Andy
Shevchenko <andy@...nel.org>, Waqar Hameed <waqar.hameed@...s.com>, Greg KH
<gregkh@...uxfoundation.org>, Peter Zijlstra <peterz@...radead.org>, Julien
Stephan <jstephan@...libre.com>, Bo Liu <liubo03@...pur.com>, Al Viro
<viro@...iv.linux.org.uk>, Sean Nyekjaer <sean@...nix.com>, Haibo Chen
<haibo.chen@....com>, Han Xu <han.xu@....com>, Francisco Henriques
<franciscolealhenriques@....br>, Gustavo Vaz <gustavo.vaz@....br>, Matti
Vaittinen <mazziesaccount@...il.com>, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 01/12] iio: accel: Remove redundant
pm_runtime_mark_last_busy() calls
On Wed, 9 Jul 2025 11:46:30 +0300
Andy Shevchenko <andriy.shevchenko@...el.com> wrote:
> On Wed, Jul 09, 2025 at 02:11:51AM +0300, Sakari Ailus wrote:
> > pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
> > pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
> > to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
> > pm_runtime_mark_last_busy().
>
> ...
>
> > - if (on) {
> > + if (on)
> > ret = pm_runtime_resume_and_get(dev);
> > - } else {
> > - pm_runtime_mark_last_busy(dev);
> > + else
> > ret = pm_runtime_put_autosuspend(dev);
> > - }
>
> The following blank line can be removed as it's done in the other file.
>
> ...
>
> Side note: Looking at this, perhaps we can also have a helper to toggle state?
>
> ...
>
> > if (on)
> > ret = pm_runtime_resume_and_get(&data->client->dev);
> > - else {
> > - pm_runtime_mark_last_busy(&data->client->dev);
> > + else
> > ret = pm_runtime_put_autosuspend(&data->client->dev);
> > - }
>
> So, already two users of the potential new helper :-)
Maybe, but also worth a close look at whether, after this simplification
these little functions to set power state add anything over just
calling pm_runtime_resume_and_get() or *_put_autosuspend()
inline at the call sites. There are some cases in these drivers
where the state is not hard coded at the call site though so
a helper might be useful for those.
I'm not thinking of it as a job for this patch though which shouldn't
be making significant changes even if they are enabled by
the removals of the calls to pm_runtime_mark_last_busy()
So good idea, but probably get this in first.
>
> ...
>
> > - if (on) {
> > + if (on)
> > ret = pm_runtime_resume_and_get(&client->dev);
> > - } else {
> > - pm_runtime_mark_last_busy(&client->dev);
> > + else
> > ret = pm_runtime_put_autosuspend(&client->dev);
> > - }
> >
>
> No blank line?
>
> Three!
>
> > if (ret < 0) {
>
> ...
>
> > if (on)
> > ret = pm_runtime_resume_and_get(&client->dev);
> > - else {
> > - pm_runtime_mark_last_busy(&client->dev);
> > + else
> > ret = pm_runtime_put_autosuspend(&client->dev);
> > - }
> >
> > if (ret < 0) {
>
> As per above and counting...
>
Powered by blists - more mailing lists