lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z4kYq7JChZ+6ZKpx@BLRRASHENOY1.amd.com>
Date: Thu, 16 Jan 2025 20:03:15 +0530
From: "Gautham R. Shenoy" <gautham.shenoy@....com>
To: "zhenglifeng (A)" <zhenglifeng1@...wei.com>
Cc: rafael@...nel.org, lenb@...nel.org, robert.moore@...el.com,
	viresh.kumar@...aro.org, mario.limonciello@....com,
	ray.huang@....com, pierre.gondois@....com,
	acpica-devel@...ts.linux.dev, linux-acpi@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
	linuxarm@...wei.com, jonathan.cameron@...wei.com,
	zhanjie9@...ilicon.com, lihuisong@...wei.com, hepeng68@...wei.com,
	fanghao11@...wei.com
Subject: Re: [PATCH v4 6/6] cpufreq: CPPC: Support for autonomous selection
 in cppc_cpufreq

On Thu, Jan 16, 2025 at 04:01:08PM +0800, zhenglifeng (A) wrote:

> > @@ -399,6 +399,7 @@ static int shmem_init_perf(struct amd_cpudata *cpudata)
> >  {
> >  	struct cppc_perf_caps cppc_perf;
> >  	u64 numerator;
> > +	bool auto_sel; <--- Not needed.
> >  
> >  	int ret = cppc_get_perf_caps(cpudata->cpu, &cppc_perf);
> >  	if (ret)
> > @@ -420,7 +421,7 @@ static int shmem_init_perf(struct amd_cpudata *cpudata)
> >  	if (cppc_state == AMD_PSTATE_ACTIVE)
> >  		return 0;
> >  
> > -	ret = cppc_get_auto_sel_caps(cpudata->cpu, &cppc_perf);   <--- Not needed.
> > +	ret = cppc_get_auto_sel(cpudata->cpu, &auto_sel);         <--- Not needed.
> >  	if (ret) {                                                <--- Not needed.
> >  		pr_warn("failed to get auto_sel, ret: %d\n", ret); <--- Not needed.
> > 
> 
> If auto_sel is not supported, this function will return 0 after getting
> fail. But after removing cppc_get_auto_sel(), this function will return
> -EOPNOTSUPP by setting. Is this alright?

This is not ok. The shmem_init_perf() function shouldn't error out if
the auto-selection register is not supported.

Also, looking at the function, there may be a few additional cleanups
required in that one. For now, let us just retain the
cppc_get_auto_sel() and cppc_set_auto_sel() functions as you have done
in this patchset.

--
Thanks and Regards
gautham.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ