Subject: Re: linux-next: manual merge of the tip tree with the pm tree

From: Stephen Rothwell <[email-masked]>
Date: Mon, 12 May 2025 15:23:26 +1000

Hi all,

On Mon, 12 May 2025 14:55:17 +1000 Stephen Rothwell <[email-masked]> wrote:
>
> Today's linux-next merge of the tip tree got a conflict in:
> 
>   drivers/cpufreq/amd-pstate.c
> 
> between commit:
> 
>   608a76b65288 ("cpufreq/amd-pstate: Add support for the "Requested CPU Min frequency" BIOS option")
> 
> from the pm tree and commit:
> 
>   d7484babd2c4 ("x86/msr: Rename 'rdmsrl_on_cpu()' to 'rdmsrq_on_cpu()'")
> 
> from the tip tree.
> 
> I fixed it up (the former removed a line updated by the latter) and can
> carry the fix as necessary. This is now fixed as far as linux-next is
> concerned, but any non trivial conflicts should be mentioned to your
> upstream maintainer when your tree is submitted for merging.  You may
> also want to consider cooperating with the maintainer of the conflicting
> tree to minimise any particularly complex conflicts.

Actually it needed the fix up below.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/cpufreq/amd-pstate.c
index d96bb3e202ee,66fdc74f13ef..0d4c0de89a00
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@@ -389,10 -389,9 +389,10 @@@ static inline int amd_pstate_cppc_enabl
  static int msr_init_perf(struct amd_cpudata *cpudata)
  {
  	union perf_cached perf = READ_ONCE(cpudata->perf);
 -	u64 cap1, numerator;
 +	u64 cap1, numerator, cppc_req;
 +	u8 min_perf;
  
- 	int ret = rdmsrl_safe_on_cpu(cpudata->cpu, MSR_AMD_CPPC_CAP1,
+ 	int ret = rdmsrq_safe_on_cpu(cpudata->cpu, MSR_AMD_CPPC_CAP1,
  				     &cap1);
  	if (ret)
  		return ret;
@@@ -401,22 -400,6 +401,22 @@@
  	if (ret)
  		return ret;
  
- 	ret = rdmsrl_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &cppc_req);
++	ret = rdmsrq_on_cpu(cpudata->cpu, MSR_AMD_CPPC_REQ, &cppc_req);
 +	if (ret)
 +		return ret;
 +
 +	WRITE_ONCE(cpudata->cppc_req_cached, cppc_req);
 +	min_perf = FIELD_GET(AMD_CPPC_MIN_PERF_MASK, cppc_req);
 +
 +	/*
 +	 * Clear out the min_perf part to check if the rest of the MSR is 0, if yes, this is an
 +	 * indication that the min_perf value is the one specified through the BIOS option
 +	 */
 +	cppc_req &= ~(AMD_CPPC_MIN_PERF_MASK);
 +
 +	if (!cppc_req)
 +		perf.bios_min_perf = min_perf;
 +
  	perf.highest_perf = numerator;
  	perf.max_limit_perf = numerator;
  	perf.min_limit_perf = FIELD_GET(AMD_CPPC_LOWEST_PERF_MASK, cap1);