linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
	dri-devel@lists.freedesktop.org,  linux-kernel@vger.kernel.org,
	linux-bluetooth@vger.kernel.org,  linux-clk@vger.kernel.org,
	linux-crypto@vger.kernel.org,  dmaengine@vger.kernel.org,
	linux-gpio@vger.kernel.org,  amd-gfx@lists.freedesktop.org,
	nouveau@lists.freedesktop.org,
	 linux-stm32@st-md-mailman.stormreply.com,
	 linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org,
	 linux-i3c@lists.infradead.org, linux-iio@vger.kernel.org,
	 linux-input@vger.kernel.org, patches@opensource.cirrus.com,
	 iommu@lists.linux.dev, imx@lists.linux.dev,
	 linux-mediatek@lists.infradead.org, linux-media@vger.kernel.org,
	 linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org,
	 netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	 linux-pci@vger.kernel.org, linux-phy@lists.infradead.org,
	 linux-pwm@vger.kernel.org, linux-remoteproc@vger.kernel.org,
	 linux-sound@vger.kernel.org, linux-spi@vger.kernel.org,
	 linux-staging@lists.linux.dev, linux-usb@vger.kernel.org,
	 linux-serial@vger.kernel.org, greybus-dev@lists.linaro.org,
	 asahi@lists.linux.dev, rafael@kernel.org,
	 Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend()
Date: Tue, 8 Oct 2024 00:08:24 +0200	[thread overview]
Message-ID: <CAPDyKFpQVnF7eQv3dup8k-3EijnMjuveCG9sZ=Rpey1Y6MBJEg@mail.gmail.com> (raw)
In-Reply-To: <20241007184924.GH14766@pendragon.ideasonboard.com>

On Mon, 7 Oct 2024 at 20:49, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Ulf,
>
> On Fri, Oct 04, 2024 at 04:38:36PM +0200, Ulf Hansson wrote:
> > On Fri, 4 Oct 2024 at 11:41, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> > >
> > > Hello everyone,
> > >
> > > This set will switch the users of pm_runtime_put_autosuspend() to
> > > __pm_runtime_put_autosuspend() while the former will soon be re-purposed
> > > to include a call to pm_runtime_mark_last_busy(). The two are almost
> > > always used together, apart from bugs which are likely common. Going
> > > forward, most new users should be using pm_runtime_put_autosuspend().
> > >
> > > Once this conversion is done and pm_runtime_put_autosuspend() re-purposed,
> > > I'll post another set to merge the calls to __pm_runtime_put_autosuspend()
> > > and pm_runtime_mark_last_busy().
> >
> > That sounds like it could cause a lot of churns.
> >
> > Why not add a new helper function that does the
> > pm_runtime_put_autosuspend() and the pm_runtime_mark_last_busy()
> > things? Then we can start moving users over to this new interface,
> > rather than having this intermediate step?
>
> I think the API would be nicer if we used the shortest and simplest
> function names for the most common use cases. Following
> pm_runtime_put_autosuspend() with pm_runtime_mark_last_busy() is that
> most common use case. That's why I like Sakari's approach of repurposing
> pm_runtime_put_autosuspend(), and introducing
> __pm_runtime_put_autosuspend() for the odd cases where
> pm_runtime_mark_last_busy() shouldn't be called.

Okay, so the reason for this approach is because we couldn't find a
short and descriptive name that could be used in favor of
pm_runtime_put_autosuspend(). Let me throw some ideas at it and maybe
you like it - or not. :-)

I don't know what options you guys discussed, but to me the entire
"autosuspend"-suffix isn't really that necessary in my opinion. There
are more ways than calling pm_runtime_put_autosuspend() that triggers
us to use the RPM_AUTO flag for rpm_suspend(). For example, just
calling pm_runtime_put() has the similar effect.

Moreover, it's similar for pm_runtime_mark_last_busy(), it's called
during rpm_resume() too, for example. So why bother about having
"mark_last_busy" in the new name too.

That said, my suggestion is simply "pm_runtime_put_suspend".

If you don't like it, I will certainly not object to your current
approach, even if I think it leads to unnecessary churns.

[...]

Kind regards
Uffe

  reply	other threads:[~2024-10-07 22:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04  9:41 [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend() Sakari Ailus
2024-10-04  9:41 ` [PATCH 08/51] gpio: " Sakari Ailus
2024-10-04  9:55   ` Bartosz Golaszewski
2024-10-04 10:08     ` Sakari Ailus
2024-10-04 14:38 ` [PATCH 00/51] treewide: " Ulf Hansson
2024-10-07 18:49   ` Laurent Pinchart
2024-10-07 22:08     ` Ulf Hansson [this message]
2024-10-07 22:25       ` Laurent Pinchart
2024-10-07 22:34         ` Ulf Hansson
2024-10-08 18:24           ` Rafael J. Wysocki
2024-10-09 10:20             ` Rafael J. Wysocki
2024-10-09 10:27             ` Ulf Hansson
2024-10-09 12:48             ` Richard Fitzgerald
2024-10-09 13:34               ` Rafael J. Wysocki
2024-10-08 20:38     ` Uwe Kleine-König

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='CAPDyKFpQVnF7eQv3dup8k-3EijnMjuveCG9sZ=Rpey1Y6MBJEg@mail.gmail.com' \
    --to=ulf.hansson@linaro.org \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=asahi@lists.linux.dev \
    --cc=dmaengine@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=imx@lists.linux.dev \
    --cc=iommu@lists.linux.dev \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=patches@opensource.cirrus.com \
    --cc=rafael@kernel.org \
    --cc=sakari.ailus@linux.intel.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).