public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: wangyouwan@126.com
To: rafael@kernel.org, viresh.kumar@linaro.org
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	youwan Wang <wangyouwan@126.com>
Subject: [PATCH] cpufreq: create cooling device based on ACPI
Date: Fri, 28 Apr 2023 15:03:14 +0800	[thread overview]
Message-ID: <20230428070314.225560-1-wangyouwan@126.com> (raw)

From: youwan Wang <wangyouwan@126.com>

When using the "scpi_cpufreq" driver, an error
occurs:cpufreq_cooling: OF node not available for cpu*.
The current computer motherboard is using ACPI firmware.
Go to see that the error is caused by calling the
"of_cpufreq_cooling_register" interface.
comment:create cpufreq cooling device based on DT.

Signed-off-by: youwan Wang <wangyouwan@126.com>
---
 drivers/cpufreq/cpufreq.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 6b52ebe5a890..3418c68959d5 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1528,8 +1528,13 @@ static int cpufreq_online(unsigned int cpu)
 	if (cpufreq_driver->ready)
 		cpufreq_driver->ready(policy);
 
-	if (cpufreq_thermal_control_enabled(cpufreq_driver))
+	if (cpufreq_thermal_control_enabled(cpufreq_driver)) {
+#ifdef CONFIG_ACPI
+		policy->cdev = cpufreq_cooling_register(policy);
+#else
 		policy->cdev = of_cpufreq_cooling_register(policy);
+#endif
+	}
 
 	pr_debug("initialization complete\n");
 
-- 
2.25.1


             reply	other threads:[~2023-04-28  7:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-28  7:03 wangyouwan [this message]
2023-04-28  9:56 ` [PATCH] cpufreq: create cooling device based on ACPI Dhruva Gole
2023-05-10  8:48   ` wangyouwan
2023-04-28 11:37 ` Rafael J. Wysocki
2023-05-10  7:51   ` wangyouwan
2023-05-08  7:12 ` 回复: " Xinglong Yang
     [not found]   ` <205f534.5815.18804b3dd08.Coremail.wangyouwan@126.com>
     [not found]     ` <PUZPR06MB5498536FCB73BD6D5BD928ECF0779@PUZPR06MB5498.apcprd06.prod.outlook.com>
2023-05-10  8:45       ` Re:回复: " wangyouwan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230428070314.225560-1-wangyouwan@126.com \
    --to=wangyouwan@126.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox