All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yao Zi <ziyao@disroot.org>
To: Xi Ruoyao <xry111@xry111.site>,
	Huacai Chen <chenhuacai@kernel.org>,
	WANG Xuerui <kernel@xen0n.name>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Viresh Kumar	 <viresh.kumar@linaro.org>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Mingcong Bai <jeffbai@aosc.io>,
	Kexy Biscuit <kexybiscuit@aosc.io>,
	loongarch@lists.linux.dev, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq: loongson3: Support older SMC firmware
Date: Tue, 24 Jun 2025 01:42:00 +0000	[thread overview]
Message-ID: <aFoCaKrOcf-yIard@pie.lan> (raw)
In-Reply-To: <9246b226e356ea0db044a592fed8853dd593f7f7.camel@xry111.site>

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@xry111.site>
> 
> -- 
> Xi Ruoyao <xry111@xry111.site>
> 

Regards,
Yao Zi

  reply	other threads:[~2025-06-24  1:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-23 12:33 [PATCH] cpufreq: loongson3: Support older SMC firmware Yao Zi
2025-06-23 14:59 ` Xi Ruoyao
2025-06-24  1:42   ` Yao Zi [this message]
2025-06-24  2:43 ` Mingcong Bai
2025-06-25  3:47 ` Yao Zi

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=aFoCaKrOcf-yIard@pie.lan \
    --to=ziyao@disroot.org \
    --cc=chenhuacai@kernel.org \
    --cc=jeffbai@aosc.io \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kernel@xen0n.name \
    --cc=kexybiscuit@aosc.io \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=rafael@kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=xry111@xry111.site \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.