lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ttmnzgsdyng5vab63pvj7csrotbsmwnultjelvdotrvyg2snac@iv7afgect5f3>
Date: Tue, 8 Oct 2024 22:38:02 +0200
From: Uwe Kleine-König <u.kleine-koenig@...libre.com>
To: Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc: Ulf Hansson <ulf.hansson@...aro.org>, 
	Sakari Ailus <sakari.ailus@...ux.intel.com>, dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org, 
	linux-bluetooth@...r.kernel.org, linux-clk@...r.kernel.org, linux-crypto@...r.kernel.org, 
	dmaengine@...r.kernel.org, linux-gpio@...r.kernel.org, amd-gfx@...ts.freedesktop.org, 
	nouveau@...ts.freedesktop.org, linux-stm32@...md-mailman.stormreply.com, 
	linux-arm-kernel@...ts.infradead.org, linux-i2c@...r.kernel.org, linux-i3c@...ts.infradead.org, 
	linux-iio@...r.kernel.org, linux-input@...r.kernel.org, patches@...nsource.cirrus.com, 
	iommu@...ts.linux.dev, imx@...ts.linux.dev, linux-mediatek@...ts.infradead.org, 
	linux-media@...r.kernel.org, linux-mmc@...r.kernel.org, linux-mtd@...ts.infradead.org, 
	netdev@...r.kernel.org, linux-wireless@...r.kernel.org, linux-pci@...r.kernel.org, 
	linux-phy@...ts.infradead.org, linux-pwm@...r.kernel.org, linux-remoteproc@...r.kernel.org, 
	linux-sound@...r.kernel.org, linux-spi@...r.kernel.org, linux-staging@...ts.linux.dev, 
	linux-usb@...r.kernel.org, linux-serial@...r.kernel.org, greybus-dev@...ts.linaro.org, 
	asahi@...ts.linux.dev, rafael@...nel.org, Andy Shevchenko <andy.shevchenko@...il.com>
Subject: Re: [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend()

Hello,

On Mon, Oct 07, 2024 at 09:49:24PM +0300, Laurent Pinchart wrote:
> 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@...ux.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.

That's ok for me. However this patch series isn't the optimal path to
there because most drivers (i.e. those that already today do
pm_runtime_mark_last_busy() in combination with
pm_runtime_put_autosuspend()) have to be patched twice.

The saner route is: Only convert the drivers with a sole
pm_runtime_put_autosuspend() (i.e. without pm_runtime_mark_last_busy())
to __pm_runtime_put_autosuspend(). Then add the mark_last_busy() bits to
pm_runtime_put_autosuspend() and then drop the explicit calls to
pm_runtime_mark_last_busy() before pm_runtime_put_autosuspend().

(Note this doesn't take into account Rafael's position that
pm_runtime_put() might be the saner option. My argument applies for that
conversion analogously.)

Best regards
Uwe

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ