[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aFoCaKrOcf-yIard@pie.lan>
Date: Tue, 24 Jun 2025 01:42:00 +0000
From: Yao Zi <ziyao@...root.org>
To: Xi Ruoyao <xry111@...111.site>, Huacai Chen <chenhuacai@...nel.org>,
WANG Xuerui <kernel@...0n.name>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Viresh Kumar <viresh.kumar@...aro.org>
Cc: Jiaxun Yang <jiaxun.yang@...goat.com>, Mingcong Bai <jeffbai@...c.io>,
Kexy Biscuit <kexybiscuit@...c.io>, loongarch@...ts.linux.dev,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cpufreq: loongson3: Support older SMC firmware
On Mon, Jun 23, 2025 at 10:59:50PM +0800, Xi Ruoyao wrote:
> 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?
I don't have a strong opinion on the name since it could be considered
in both ways,
- SMCv0 and SMCv1 provide similar functions and are implemented in the
same driver. The firmware version is already printed in the probe
callback, which should be enough for debugging purpose.
- Meanwhile, loongson3_cpufreq_smc0_driver and
loongson3_cpufreq_smc1_driver ARE different sets of callbacks,
different names may avoid future confusion.
I'm willing to provide different names in v2 unless you change your mind
or there're further objections, thanks.
> > .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@...111.site>
>
> --
> Xi Ruoyao <xry111@...111.site>
>
Regards,
Yao Zi
Powered by blists - more mailing lists