Re: [PATCH] cpufreq: loongson3: Support older SMC firmware

From: Xi Ruoyao
Date: Mon Jun 23 2025 - 11:13:08 EST


On Mon, 2025-06-23 at 12:33 +0000, Yao Zi wrote:

/* snip */

> -static struct cpufreq_driver loongson3_cpufreq_driver = {
> +static struct cpufreq_driver loongson3_cpufreq_smc0_driver = {
>   .name = "loongson3",

How about using different names for the drivers?

>   .flags = CPUFREQ_CONST_LOOPS,
> - .init = loongson3_cpufreq_cpu_init,
> + .init = loongson3_cpufreq_cpu_smc0_init,
>   .exit = loongson3_cpufreq_cpu_exit,
>   .online = loongson3_cpufreq_cpu_online,
>   .offline = loongson3_cpufreq_cpu_offline,
> - .get = loongson3_cpufreq_get,
> - .target_index = loongson3_cpufreq_target,
> + .target_index = loongson3_cpufreq_smc0_target,
> + .verify = cpufreq_generic_frequency_table_verify,
> + .suspend = cpufreq_generic_suspend,
> +};
> +
> +static struct cpufreq_driver loongson3_cpufreq_smc1_driver = {
> + .name = "loongson3",

Tested on a 3A6000 laptop with the schedutil policy. On idle one core
is at 2000MHz and other cores are at 250MHz, when building the kernel
all cores are at 2000MHz.

Tested-by: Xi Ruoyao <xry111@xxxxxxxxxxx>

--
Xi Ruoyao <xry111@xxxxxxxxxxx>