* [PATCH] cpufreq: Add Loongson machine dependencies
@ 2017-11-15 21:17 James Hogan
2017-11-16 2:41 ` Viresh Kumar
2017-11-17 4:37 ` Huacai Chen
0 siblings, 2 replies; 4+ messages in thread
From: James Hogan @ 2017-11-15 21:17 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar, linux-pm, Keguang Zhang
Cc: James Hogan, Ralf Baechle, linux-mips
From: James Hogan <jhogan@kernel.org>
The MIPS loongson cpufreq drivers don't build unless configured for the
correct machine type, due to dependency on machine specific architecture
headers and symbols in machine specific platform code.
More specifically loongson1-cpufreq.c uses RST_CPU_EN and RST_CPU,
neither of which is defined in asm/mach-loongson32/regs-clk.h unless
CONFIG_LOONGSON1_LS1B=y, and loongson2_cpufreq.c references
loongson2_clockmod_table[], which is only defined in
arch/mips/loongson64/lemote-2f/clock.c, i.e. when
CONFIG_LEMOTE_MACH2F=y.
Add these dependencies to Kconfig to avoid randconfig / allyesconfig
build failures (e.g. when based on BMIPS which also has a cpufreq
driver).
Signed-off-by: James Hogan <jhogan@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Keguang Zhang <keguang.zhang@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-pm@vger.kernel.org
Cc: linux-mips@linux-mips.org
---
drivers/cpufreq/Kconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index 4ebae43118ef..d8addbce40bc 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -275,6 +275,7 @@ config BMIPS_CPUFREQ
config LOONGSON2_CPUFREQ
tristate "Loongson2 CPUFreq Driver"
+ depends on LEMOTE_MACH2F
help
This option adds a CPUFreq driver for loongson processors which
support software configurable cpu frequency.
@@ -287,6 +288,7 @@ config LOONGSON2_CPUFREQ
config LOONGSON1_CPUFREQ
tristate "Loongson1 CPUFreq Driver"
+ depends on LOONGSON1_LS1B
help
This option adds a CPUFreq driver for loongson1 processors which
support software configurable cpu frequency.
--
2.14.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] cpufreq: Add Loongson machine dependencies
2017-11-15 21:17 [PATCH] cpufreq: Add Loongson machine dependencies James Hogan
@ 2017-11-16 2:41 ` Viresh Kumar
2017-11-17 4:37 ` Huacai Chen
1 sibling, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2017-11-16 2:41 UTC (permalink / raw)
To: James Hogan
Cc: Rafael J. Wysocki, linux-pm, Keguang Zhang, James Hogan,
Ralf Baechle, linux-mips
On 15-11-17, 21:17, James Hogan wrote:
> From: James Hogan <jhogan@kernel.org>
>
> The MIPS loongson cpufreq drivers don't build unless configured for the
> correct machine type, due to dependency on machine specific architecture
> headers and symbols in machine specific platform code.
>
> More specifically loongson1-cpufreq.c uses RST_CPU_EN and RST_CPU,
> neither of which is defined in asm/mach-loongson32/regs-clk.h unless
> CONFIG_LOONGSON1_LS1B=y, and loongson2_cpufreq.c references
> loongson2_clockmod_table[], which is only defined in
> arch/mips/loongson64/lemote-2f/clock.c, i.e. when
> CONFIG_LEMOTE_MACH2F=y.
>
> Add these dependencies to Kconfig to avoid randconfig / allyesconfig
> build failures (e.g. when based on BMIPS which also has a cpufreq
> driver).
>
> Signed-off-by: James Hogan <jhogan@kernel.org>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: Keguang Zhang <keguang.zhang@gmail.com>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: linux-pm@vger.kernel.org
> Cc: linux-mips@linux-mips.org
> ---
> drivers/cpufreq/Kconfig | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
> index 4ebae43118ef..d8addbce40bc 100644
> --- a/drivers/cpufreq/Kconfig
> +++ b/drivers/cpufreq/Kconfig
> @@ -275,6 +275,7 @@ config BMIPS_CPUFREQ
>
> config LOONGSON2_CPUFREQ
> tristate "Loongson2 CPUFreq Driver"
> + depends on LEMOTE_MACH2F
> help
> This option adds a CPUFreq driver for loongson processors which
> support software configurable cpu frequency.
> @@ -287,6 +288,7 @@ config LOONGSON2_CPUFREQ
>
> config LOONGSON1_CPUFREQ
> tristate "Loongson1 CPUFreq Driver"
> + depends on LOONGSON1_LS1B
> help
> This option adds a CPUFreq driver for loongson1 processors which
> support software configurable cpu frequency.
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
viresh
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cpufreq: Add Loongson machine dependencies
2017-11-15 21:17 [PATCH] cpufreq: Add Loongson machine dependencies James Hogan
2017-11-16 2:41 ` Viresh Kumar
@ 2017-11-17 4:37 ` Huacai Chen
2017-11-17 9:37 ` James Hogan
1 sibling, 1 reply; 4+ messages in thread
From: Huacai Chen @ 2017-11-17 4:37 UTC (permalink / raw)
To: James Hogan
Cc: Rafael J. Wysocki, Viresh Kumar, linux-pm, Keguang Zhang,
James Hogan, Ralf Baechle, Linux MIPS Mailing List
I think it is better to make LOONGSON1_CPUFREQ depends on
CPU_LOONGSON1, and LOONGSON2_CPUFREQ depends on CPU_LOONGSON2
On Thu, Nov 16, 2017 at 5:17 AM, James Hogan <james.hogan@mips.com> wrote:
> From: James Hogan <jhogan@kernel.org>
>
> The MIPS loongson cpufreq drivers don't build unless configured for the
> correct machine type, due to dependency on machine specific architecture
> headers and symbols in machine specific platform code.
>
> More specifically loongson1-cpufreq.c uses RST_CPU_EN and RST_CPU,
> neither of which is defined in asm/mach-loongson32/regs-clk.h unless
> CONFIG_LOONGSON1_LS1B=y, and loongson2_cpufreq.c references
> loongson2_clockmod_table[], which is only defined in
> arch/mips/loongson64/lemote-2f/clock.c, i.e. when
> CONFIG_LEMOTE_MACH2F=y.
>
> Add these dependencies to Kconfig to avoid randconfig / allyesconfig
> build failures (e.g. when based on BMIPS which also has a cpufreq
> driver).
>
> Signed-off-by: James Hogan <jhogan@kernel.org>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: Keguang Zhang <keguang.zhang@gmail.com>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: linux-pm@vger.kernel.org
> Cc: linux-mips@linux-mips.org
> ---
> drivers/cpufreq/Kconfig | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
> index 4ebae43118ef..d8addbce40bc 100644
> --- a/drivers/cpufreq/Kconfig
> +++ b/drivers/cpufreq/Kconfig
> @@ -275,6 +275,7 @@ config BMIPS_CPUFREQ
>
> config LOONGSON2_CPUFREQ
> tristate "Loongson2 CPUFreq Driver"
> + depends on LEMOTE_MACH2F
> help
> This option adds a CPUFreq driver for loongson processors which
> support software configurable cpu frequency.
> @@ -287,6 +288,7 @@ config LOONGSON2_CPUFREQ
>
> config LOONGSON1_CPUFREQ
> tristate "Loongson1 CPUFreq Driver"
> + depends on LOONGSON1_LS1B
> help
> This option adds a CPUFreq driver for loongson1 processors which
> support software configurable cpu frequency.
> --
> 2.14.1
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cpufreq: Add Loongson machine dependencies
2017-11-17 4:37 ` Huacai Chen
@ 2017-11-17 9:37 ` James Hogan
0 siblings, 0 replies; 4+ messages in thread
From: James Hogan @ 2017-11-17 9:37 UTC (permalink / raw)
To: Huacai Chen
Cc: Rafael J. Wysocki, Viresh Kumar, linux-pm, Keguang Zhang,
Ralf Baechle, Linux MIPS Mailing List
[-- Attachment #1: Type: text/plain, Size: 970 bytes --]
Hi Huacai
On Fri, Nov 17, 2017 at 12:37:30PM +0800, Huacai Chen wrote:
> I think it is better to make LOONGSON1_CPUFREQ depends on
> CPU_LOONGSON1, and LOONGSON2_CPUFREQ depends on CPU_LOONGSON2
Yes, that may well be preferable, however as stated below both drivers
have stricter dependencies than that which break the build for certain
configurations:
> On Thu, Nov 16, 2017 at 5:17 AM, James Hogan <james.hogan@mips.com> wrote:
> > More specifically loongson1-cpufreq.c uses RST_CPU_EN and RST_CPU,
> > neither of which is defined in asm/mach-loongson32/regs-clk.h unless
> > CONFIG_LOONGSON1_LS1B=y, and loongson2_cpufreq.c references
> > loongson2_clockmod_table[], which is only defined in
> > arch/mips/loongson64/lemote-2f/clock.c, i.e. when
> > CONFIG_LEMOTE_MACH2F=y.
If those issues are fixed such that the drivers build on any respective
loongson1 / loongson2 configuration then the dependencies can always be
updated again to reflect that.
Cheers
James
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-11-17 9:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-15 21:17 [PATCH] cpufreq: Add Loongson machine dependencies James Hogan
2017-11-16 2:41 ` Viresh Kumar
2017-11-17 4:37 ` Huacai Chen
2017-11-17 9:37 ` James Hogan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox