Message ID | 20231228103921.23839-1-di.shen@unisoc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-12570-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1913436dyb; Thu, 28 Dec 2023 02:40:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNFeZMQFitAlitRHQSYz5rzrwvQ77EQw1YNgvI8MYiOYSke4osvAEImirp5e0Vn24iSBSu X-Received: by 2002:a17:903:25cb:b0:1d3:c730:f0a2 with SMTP id jc11-20020a17090325cb00b001d3c730f0a2mr10289545plb.118.1703760027940; Thu, 28 Dec 2023 02:40:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703760027; cv=none; d=google.com; s=arc-20160816; b=puH5KO7bEo3+E/zi3R7HgAzuj2aoRB+9vUlcWtdPqe8ZnmWMFA+QYwI3yuVNHXc3xd Ak0d92EXQWSmFI/4pG6qXLKcDkW026FVFS9onj5lv5IKXOcfQ2ewk8dKdGuDfZA/NHKq IKZhd8ZyRERIpisMFohUQBkie/wG1k9L4OUfreIr962uXf5lndCmeIzXAyZB6401nRqf wa4cZuPCZPN8z6izsuQE7hAFt2/szaN8H73Ma9jJtTCobCxtXtJP5mNu2Mmqbf+RDtYh 6t+zuQSB8iUJRAVTeBmarJIErsz32tvZczA7P4kkyBJ4kvanom9DKf6C9K+BGtmX/3cI K0xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from; bh=bktDUG/D07vuuL173ONeqQ1B/PpklyLbzY/K1skPWcE=; fh=aLPzjPdwYyWFtLpSmpveeA1GBNZusoJdpdlWIU9M4kY=; b=y6bsbujB++ovgllPitRf2ufo1WZysNRpBDpcyDXxgIwgTTFBdykcfAdppIWrAOYKRC G5XwXIsg89FxEil+xOKAJ5qFs7RvfINDcrA7zJ+SICsRKWiZHX1GjdgBchGIXMImK5hU wKFfRBrIeKkpewarahvKHyaDq/sJxw0eZY/x4xsOnmVzIm51eRCjwNAqrrNw+UKkjvK4 aBQYPtAdPbNqRq8K3yUaU+Qm7W1pXQ44uv+lZc6uF6kBqmDlDgGMLQzOh6gl9trWhh/P D64sAytTIso7jMkNaxaQ/0y8PX+sATuDYfEu+33tGLuKOftldUzLDp2ROAqGYWReBptX Xf5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12570-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12570-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id az1-20020a170902a58100b001d46b53d0b8si4820373plb.585.2023.12.28.02.40.27 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 02:40:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12570-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12570-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12570-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1A52028200C for <ouuuleilei@gmail.com>; Thu, 28 Dec 2023 10:40:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E189A6FB4; Thu, 28 Dec 2023 10:39:55 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7F3D6AA2; Thu, 28 Dec 2023 10:39:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unisoc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unisoc.com Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 3BSAdRon039450; Thu, 28 Dec 2023 18:39:27 +0800 (+08) (envelope-from Di.Shen@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx01.spreadtrum.com [10.0.64.7]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4T14bD0bQHz2QnGWT; Thu, 28 Dec 2023 18:32:56 +0800 (CST) Received: from bj10906pcu1.spreadtrum.com (10.0.73.72) by BJMBX01.spreadtrum.com (10.0.64.7) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Thu, 28 Dec 2023 18:39:25 +0800 From: Di Shen <di.shen@unisoc.com> To: <rafael@kernel.org>, <daniel.lezcano@linaro.org>, <rui.zhang@intel.com>, <lukasz.luba@arm.com> CC: <linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <xuewen.yan@unisoc.com>, <zhanglyra@gmail.com>, <orsonzhai@gmail.com> Subject: [PATCH] thermal: core: export the governor register related API Date: Thu, 28 Dec 2023 18:39:21 +0800 Message-ID: <20231228103921.23839-1-di.shen@unisoc.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX01.spreadtrum.com (10.0.64.7) X-MAIL: SHSQR01.spreadtrum.com 3BSAdRon039450 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786521874834916512 X-GMAIL-MSGID: 1786521874834916512 |
Series |
thermal: core: export the governor register related API
|
|
Commit Message
Di Shen
Dec. 28, 2023, 10:39 a.m. UTC
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(+)
Comments
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 >
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
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
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)