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] [day] [month] [year] [list]
Message-ID: <CAMuHMdX2CtKuY5GS=sJL2rYhixzgtXBQQpef-h=2GKRX-cNOjg@mail.gmail.com>
Date: Mon, 4 Mar 2024 11:34:09 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Hans de Goede <hdegoede@...hat.com>
Cc: Yoshinori Sato <ysato@...rs.sourceforge.jp>, Rich Felker <dalias@...c.org>, 
	John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>, "Rafael J. Wysocki" <rafael@...nel.org>, 
	Pavel Machek <pavel@....cz>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, linux-sh@...r.kernel.org, 
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>, Linux PM <linux-pm@...r.kernel.org>, 
	Bartosz Golaszewski <brgl@...ev.pl>
Subject: Re: pm_runtime_early_init() defined but not used, except on SuperH
 which has its own definition ?

CC Bartosz

On Sun, Mar 3, 2024 at 8:53 PM Hans de Goede <hdegoede@...hat.com> wrote:
>
> Hi All,
>
> I noticed that drivers/base/power/power.h defines pm_runtime_early_init()
> but nothing under drivers/base uses this.
>
> A grep over the entire tree shows that arch/sh/drivers/platform_early.c
> does use pm_runtime_early_init() but rather then including
> drivers/base/power/power.h it has its own definition / private copy
> of both device_pm_init_common() and pm_runtime_early_init() from
> drivers/base/power/power.h ???
>
> Also the private copy of pm_runtime_early_init() in
> arch/sh/drivers/platform_early.c differs from the unused one
> in drivers/base/power/power.h, but only when CONFIG_PM is not set.
>
> When CONFIG_PM is not set then the pm_runtime_early_init() in
> arch/sh/drivers/platform_early.c is a no-op, where as the one in
> drivers/base/power/power.h still calls device_pm_init_common()
> in this case ...
>
> I also wonder if given that pm_runtime_early_init() is not
> used with the exception of arch/sh/drivers/platform_early.c
> if the dev->power.early_init flag check in
> device_pm_init_common() is really necessary ?
>
> On non SuperH the only (1) caller of device_pm_init_common()
> is device_pm_init(), so it seems to me that the code to
> avoid doing device_pm_init_common() twice is unnecessary.
>
> Actually it seems to me that the entire contents of
> device_pm_init_common() can be moved inside device_pm_init()
> and the dev->power.early_init can be completely dropped (2).
>
> Regards,
>
> Hans
>
>
> 1) Well pm_runtime_early_init() calls it too, but that itself
> is unused and can be removed, removing it is even ok-ish
> for SuperH since that has its own copy anyways.
>
> 2) With the exception that all of this is still necessary
> for SuperH I guess.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ