* [PATCH] thermal: core: export the governor register related API
@ 2023-12-28 10:39 Di Shen
2023-12-28 20:23 ` Rafael J. Wysocki
0 siblings, 1 reply; 4+ messages in thread
From: Di Shen @ 2023-12-28 10:39 UTC (permalink / raw)
To: rafael, daniel.lezcano, rui.zhang, lukasz.luba
Cc: linux-pm, linux-kernel, xuewen.yan, zhanglyra, orsonzhai
To enable users to register their own thermal governor, this patch
exports thermal_register_governor() and thermal_unregister_governor().
This change would not affect the registration of the default governor.
Signed-off-by: Di Shen <di.shen@unisoc.com>
---
drivers/thermal/thermal_core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 9c17d35ccbbd..56695988e20f 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -167,6 +167,7 @@ int thermal_register_governor(struct thermal_governor *governor)
return err;
}
+EXPORT_SYMBOL_GPL(thermal_register_governor);
void thermal_unregister_governor(struct thermal_governor *governor)
{
@@ -193,6 +194,7 @@ void thermal_unregister_governor(struct thermal_governor *governor)
exit:
mutex_unlock(&thermal_governor_lock);
}
+EXPORT_SYMBOL_GPL(thermal_unregister_governor);
int thermal_zone_device_set_policy(struct thermal_zone_device *tz,
char *policy)
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] thermal: core: export the governor register related API
2023-12-28 10:39 [PATCH] thermal: core: export the governor register related API Di Shen
@ 2023-12-28 20:23 ` Rafael J. Wysocki
2023-12-29 4:30 ` Di Shen
0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2023-12-28 20:23 UTC (permalink / raw)
To: Di Shen
Cc: rafael, daniel.lezcano, rui.zhang, lukasz.luba, linux-pm,
linux-kernel, xuewen.yan, zhanglyra, orsonzhai
On Thu, Dec 28, 2023 at 11:39 AM Di Shen <di.shen@unisoc.com> wrote:
>
> To enable users to register their own thermal governor,
Why would anyone want to do that?
> this patch
> exports thermal_register_governor() and thermal_unregister_governor().
> This change would not affect the registration of the default governor.
>
> Signed-off-by: Di Shen <di.shen@unisoc.com>
> ---
> drivers/thermal/thermal_core.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 9c17d35ccbbd..56695988e20f 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -167,6 +167,7 @@ int thermal_register_governor(struct thermal_governor *governor)
>
> return err;
> }
> +EXPORT_SYMBOL_GPL(thermal_register_governor);
>
> void thermal_unregister_governor(struct thermal_governor *governor)
> {
> @@ -193,6 +194,7 @@ void thermal_unregister_governor(struct thermal_governor *governor)
> exit:
> mutex_unlock(&thermal_governor_lock);
> }
> +EXPORT_SYMBOL_GPL(thermal_unregister_governor);
>
> int thermal_zone_device_set_policy(struct thermal_zone_device *tz,
> char *policy)
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] thermal: core: export the governor register related API
2023-12-28 20:23 ` Rafael J. Wysocki
@ 2023-12-29 4:30 ` Di Shen
2023-12-29 8:46 ` gregkh
0 siblings, 1 reply; 4+ messages in thread
From: Di Shen @ 2023-12-29 4:30 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Di Shen, daniel.lezcano, rui.zhang, lukasz.luba, linux-pm,
linux-kernel, xuewen.yan, zhanglyra, orsonzhai,
gregkh@linuxfoundation.org
Hi Rafael,
On Fri, Dec 29, 2023 at 4:24 AM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Thu, Dec 28, 2023 at 11:39 AM Di Shen <di.shen@unisoc.com> wrote:
> >
> > To enable users to register their own thermal governor,
>
> Why would anyone want to do that?
>
On Android systems, due to GKI restrictions, vendors cannot modify the
kernel, and
vendor-specific changes must be loaded as modules, so export this symbol so that
vendors can load their own specific governor.
> > this patch
> > exports thermal_register_governor() and thermal_unregister_governor().
> > This change would not affect the registration of the default governor.
> >
> > Signed-off-by: Di Shen <di.shen@unisoc.com>
> > ---
> > drivers/thermal/thermal_core.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> > index 9c17d35ccbbd..56695988e20f 100644
> > --- a/drivers/thermal/thermal_core.c
> > +++ b/drivers/thermal/thermal_core.c
> > @@ -167,6 +167,7 @@ int thermal_register_governor(struct thermal_governor *governor)
> >
> > return err;
> > }
> > +EXPORT_SYMBOL_GPL(thermal_register_governor);
> >
> > void thermal_unregister_governor(struct thermal_governor *governor)
> > {
> > @@ -193,6 +194,7 @@ void thermal_unregister_governor(struct thermal_governor *governor)
> > exit:
> > mutex_unlock(&thermal_governor_lock);
> > }
> > +EXPORT_SYMBOL_GPL(thermal_unregister_governor);
> >
> > int thermal_zone_device_set_policy(struct thermal_zone_device *tz,
> > char *policy)
> > --
> > 2.17.1
> >
>
Best regards,
Di
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] thermal: core: export the governor register related API
2023-12-29 4:30 ` Di Shen
@ 2023-12-29 8:46 ` gregkh
0 siblings, 0 replies; 4+ messages in thread
From: gregkh @ 2023-12-29 8:46 UTC (permalink / raw)
To: Di Shen
Cc: Rafael J. Wysocki, Di Shen, daniel.lezcano, rui.zhang,
lukasz.luba, linux-pm, linux-kernel, xuewen.yan, zhanglyra,
orsonzhai
On Fri, Dec 29, 2023 at 12:30:10PM +0800, Di Shen wrote:
> Hi Rafael,
>
> On Fri, Dec 29, 2023 at 4:24 AM Rafael J. Wysocki <rafael@kernel.org> wrote:
> >
> > On Thu, Dec 28, 2023 at 11:39 AM Di Shen <di.shen@unisoc.com> wrote:
> > >
> > > To enable users to register their own thermal governor,
> >
> > Why would anyone want to do that?
> >
>
> On Android systems, due to GKI restrictions, vendors cannot modify the
> kernel, and
> vendor-specific changes must be loaded as modules, so export this symbol so that
> vendors can load their own specific governor.
Why not get the needed changes merged upstream properly instead? That's
why Android does not allow you to change the core kernel, they want you
to work upstream first.
Random symbol exports are not allowed without a user for obvious reasons
(and you don't want us to take these patches either.)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-12-29 8:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-28 10:39 [PATCH] thermal: core: export the governor register related API Di Shen
2023-12-28 20:23 ` Rafael J. Wysocki
2023-12-29 4:30 ` Di Shen
2023-12-29 8:46 ` gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox