* pm_runtime_early_init() defined but not used, except on SuperH which has its own definition ?
@ 2024-03-03 19:53 Hans de Goede
2024-03-04 10:34 ` Geert Uytterhoeven
0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2024-03-03 19:53 UTC (permalink / raw)
To: Yoshinori Sato, Rich Felker, John Paul Adrian Glaubitz,
Rafael J. Wysocki, Pavel Machek, Greg Kroah-Hartman
Cc: linux-sh, Linux Kernel Mailing List, Linux PM
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: pm_runtime_early_init() defined but not used, except on SuperH which has its own definition ?
2024-03-03 19:53 pm_runtime_early_init() defined but not used, except on SuperH which has its own definition ? Hans de Goede
@ 2024-03-04 10:34 ` Geert Uytterhoeven
0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2024-03-04 10:34 UTC (permalink / raw)
To: Hans de Goede
Cc: Yoshinori Sato, Rich Felker, John Paul Adrian Glaubitz,
Rafael J. Wysocki, Pavel Machek, Greg Kroah-Hartman, linux-sh,
Linux Kernel Mailing List, Linux PM, Bartosz Golaszewski
CC Bartosz
On Sun, Mar 3, 2024 at 8:53 PM Hans de Goede <hdegoede@redhat.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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-04 10:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-03 19:53 pm_runtime_early_init() defined but not used, except on SuperH which has its own definition ? Hans de Goede
2024-03-04 10:34 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox