public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Perry Yuan <Perry.Yuan@amd.com>
To: <rafael.j.wysocki@intel.com>, <ray.huang@amd.com>,
	<viresh.kumar@linaro.org>, <Mario.Limonciello@amd.com>
Cc: <Nathan.Fontenot@amd.com>, <Alexander.Deucher@amd.com>,
	<Deepak.Sharma@amd.com>, <Shimmer.Huang@amd.com>,
	<Li.Meng@amd.com>, <Xiaojian.Du@amd.com>, <wyes.karny@amd.com>,
	<gautham.shenoy@amd.com>, <ananth.narayan@amd.com>,
	<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Perry Yuan <Perry.Yuan@amd.com>
Subject: [PATCH 2/5] cpufreq: amd-pstate: change amd-pstate driver to be built-in type
Date: Thu, 17 Nov 2022 10:49:52 +0800	[thread overview]
Message-ID: <20221117024955.3319484-3-Perry.Yuan@amd.com> (raw)
In-Reply-To: <20221117024955.3319484-1-Perry.Yuan@amd.com>

Currently when the amd-pstate and acpi_cpufreq are both built into
kernel as module driver, amd-pstate will not be loaded by default
in this case.

Change amd-pstate driver as built-in type, it will resolve the loading
sequence problem to allow user to make amd-pstate driver as the default
cpufreq scaling driver.

Fixes: ec437d71db77 ("cpufreq: amd-pstate: Introduce a new AMD P-State driver to support future processors")
Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
---
 drivers/cpufreq/Kconfig.x86  |  2 +-
 drivers/cpufreq/amd-pstate.c | 11 +----------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/cpufreq/Kconfig.x86 b/drivers/cpufreq/Kconfig.x86
index 310779b07daf..00476e94db90 100644
--- a/drivers/cpufreq/Kconfig.x86
+++ b/drivers/cpufreq/Kconfig.x86
@@ -35,7 +35,7 @@ config X86_PCC_CPUFREQ
 	  If in doubt, say N.
 
 config X86_AMD_PSTATE
-	tristate "AMD Processor P-State driver"
+	bool "AMD Processor P-State driver"
 	depends on X86 && ACPI
 	select ACPI_PROCESSOR
 	select ACPI_CPPC_LIB if X86_64
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index d844c6f97caf..701f49d6d240 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -663,16 +663,7 @@ static int __init amd_pstate_init(void)
 
 	return ret;
 }
-
-static void __exit amd_pstate_exit(void)
-{
-	cpufreq_unregister_driver(&amd_pstate_driver);
-
-	amd_pstate_enable(false);
-}
-
-module_init(amd_pstate_init);
-module_exit(amd_pstate_exit);
+device_initcall(amd_pstate_init);
 
 MODULE_AUTHOR("Huang Rui <ray.huang@amd.com>");
 MODULE_DESCRIPTION("AMD Processor P-state Frequency Driver");
-- 
2.25.1


  parent reply	other threads:[~2022-11-17  2:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17  2:49 [PATCH 0/5] AMD Pstate driver Urgent Change Perry Yuan
2022-11-17  2:49 ` [PATCH 1/5] cpufreq: amd-pstate: cpufreq: amd-pstate: reset MSR_AMD_PERF_CTL register at init Perry Yuan
2022-11-17  4:08   ` Gautham R. Shenoy
2022-11-17  5:03   ` Wyes Karny
2022-11-17  2:49 ` Perry Yuan [this message]
2022-11-17  4:09   ` [PATCH 2/5] cpufreq: amd-pstate: change amd-pstate driver to be built-in type Gautham R. Shenoy
2022-11-17  5:04   ` Wyes Karny
2022-11-17  2:49 ` [PATCH 3/5] cpufreq: amd-pstate: add amd-pstate driver parameter for mode selection Perry Yuan
2022-11-17  4:13   ` Gautham R. Shenoy
2022-11-17  5:06   ` Wyes Karny
2022-11-17  2:49 ` [PATCH 4/5] Documentation: amd-pstate: add driver working mode introduction Perry Yuan
2022-11-17  4:15   ` Gautham R. Shenoy
2022-11-17  4:17     ` Yuan, Perry
2022-11-17  5:06   ` Wyes Karny
2022-11-17  2:49 ` [PATCH 5/5] Documentation: add amd-pstate kernel command line options Perry Yuan
2022-11-17  4:16   ` Gautham R. Shenoy
2022-11-17  5:08   ` Wyes Karny
2022-11-17  5:35 ` [PATCH 0/5] AMD Pstate driver Urgent Change Huang Rui

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=20221117024955.3319484-3-Perry.Yuan@amd.com \
    --to=perry.yuan@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Deepak.Sharma@amd.com \
    --cc=Li.Meng@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=Nathan.Fontenot@amd.com \
    --cc=Shimmer.Huang@amd.com \
    --cc=Xiaojian.Du@amd.com \
    --cc=ananth.narayan@amd.com \
    --cc=gautham.shenoy@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=ray.huang@amd.com \
    --cc=viresh.kumar@linaro.org \
    --cc=wyes.karny@amd.com \
    /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