public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] cpupower update for Linux 6.10-rc2
@ 2024-05-28 15:34 Shuah Khan
  2024-05-28 20:09 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Shuah Khan @ 2024-05-28 15:34 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: shuah, Shuah Khan, Thomas Renninger, linux-kernel, linux-pm

[-- Attachment #1: Type: text/plain, Size: 1477 bytes --]

Hi Rafael,

Please pull the following cpupower fixes update for Linux 6.10-rc2.

This cpupower fixes update for Linux 6.10-rc2 consists of one single
fix to cpupower's P-State frequency calculation and reporting with
AMD Family 1Ah+ processors, when using the acpi-cpufreq driver.

diff is attached.

thanks,
-- Shuah

----------------------------------------------------------------

The following changes since commit 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0:

   Linux 6.10-rc1 (2024-05-26 15:20:12 -0700)

are available in the Git repository at:

   git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux tags/linux-cpupower-6.10-rc2

for you to fetch changes up to 43cad521c6d228ea0c51e248f8e5b3a6295a2849:

   tools/power/cpupower: Fix Pstate frequency reporting on AMD Family 1Ah CPUs (2024-05-28 09:22:57 -0600)

----------------------------------------------------------------
linux-cpupower-6.10-rc2

This cpupower fixes update for Linux 6.10-rc2 consists of one single
fix to cpupower's P-State frequency calculation and reporting with
AMD Family 1Ah+ processors, when using the acpi-cpufreq driver.

----------------------------------------------------------------
Dhananjay Ugwekar (1):
       tools/power/cpupower: Fix Pstate frequency reporting on AMD Family 1Ah CPUs

  tools/power/cpupower/utils/helpers/amd.c | 26 +++++++++++++++++++++++---
  1 file changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------

[-- Attachment #2: linux-cpupower-6.10-rc2.diff --]
[-- Type: text/x-patch, Size: 1412 bytes --]

diff --git a/tools/power/cpupower/utils/helpers/amd.c b/tools/power/cpupower/utils/helpers/amd.c
index c519cc89c97f..0a56e22240fc 100644
--- a/tools/power/cpupower/utils/helpers/amd.c
+++ b/tools/power/cpupower/utils/helpers/amd.c
@@ -41,6 +41,16 @@ union core_pstate {
 		unsigned res1:31;
 		unsigned en:1;
 	} pstatedef;
+	/* since fam 1Ah: */
+	struct {
+		unsigned fid:12;
+		unsigned res1:2;
+		unsigned vid:8;
+		unsigned iddval:8;
+		unsigned idddiv:2;
+		unsigned res2:31;
+		unsigned en:1;
+	} pstatedef2;
 	unsigned long long val;
 };
 
@@ -48,6 +58,10 @@ static int get_did(union core_pstate pstate)
 {
 	int t;
 
+	/* Fam 1Ah onward do not use did */
+	if (cpupower_cpu_info.family >= 0x1A)
+		return 0;
+
 	if (cpupower_cpu_info.caps & CPUPOWER_CAP_AMD_PSTATEDEF)
 		t = pstate.pstatedef.did;
 	else if (cpupower_cpu_info.family == 0x12)
@@ -61,12 +75,18 @@ static int get_did(union core_pstate pstate)
 static int get_cof(union core_pstate pstate)
 {
 	int t;
-	int fid, did, cof;
+	int fid, did, cof = 0;
 
 	did = get_did(pstate);
 	if (cpupower_cpu_info.caps & CPUPOWER_CAP_AMD_PSTATEDEF) {
-		fid = pstate.pstatedef.fid;
-		cof = 200 * fid / did;
+		if (cpupower_cpu_info.family >= 0x1A) {
+			fid = pstate.pstatedef2.fid;
+			if (fid > 0x0f)
+				cof = (fid * 5);
+		} else {
+			fid = pstate.pstatedef.fid;
+			cof = 200 * fid / did;
+		}
 	} else {
 		t = 0x10;
 		fid = pstate.pstate.fid;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [GIT PULL] cpupower update for Linux 6.10-rc2
  2024-05-28 15:34 [GIT PULL] cpupower update for Linux 6.10-rc2 Shuah Khan
@ 2024-05-28 20:09 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2024-05-28 20:09 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Rafael J. Wysocki, shuah, Thomas Renninger, linux-kernel,
	linux-pm

Hi Shuah,

On Tue, May 28, 2024 at 5:34 PM Shuah Khan <skhan@linuxfoundation.org> wrote:
>
> Hi Rafael,
>
> Please pull the following cpupower fixes update for Linux 6.10-rc2.
>
> This cpupower fixes update for Linux 6.10-rc2 consists of one single
> fix to cpupower's P-State frequency calculation and reporting with
> AMD Family 1Ah+ processors, when using the acpi-cpufreq driver.
>
> diff is attached.

Pulled, thanks!

> ----------------------------------------------------------------
>
> The following changes since commit 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0:
>
>    Linux 6.10-rc1 (2024-05-26 15:20:12 -0700)
>
> are available in the Git repository at:
>
>    git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux tags/linux-cpupower-6.10-rc2
>
> for you to fetch changes up to 43cad521c6d228ea0c51e248f8e5b3a6295a2849:
>
>    tools/power/cpupower: Fix Pstate frequency reporting on AMD Family 1Ah CPUs (2024-05-28 09:22:57 -0600)
>
> ----------------------------------------------------------------
> linux-cpupower-6.10-rc2
>
> This cpupower fixes update for Linux 6.10-rc2 consists of one single
> fix to cpupower's P-State frequency calculation and reporting with
> AMD Family 1Ah+ processors, when using the acpi-cpufreq driver.
>
> ----------------------------------------------------------------
> Dhananjay Ugwekar (1):
>        tools/power/cpupower: Fix Pstate frequency reporting on AMD Family 1Ah CPUs
>
>   tools/power/cpupower/utils/helpers/amd.c | 26 +++++++++++++++++++++++---
>   1 file changed, 23 insertions(+), 3 deletions(-)
> ----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-28 20:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-28 15:34 [GIT PULL] cpupower update for Linux 6.10-rc2 Shuah Khan
2024-05-28 20:09 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox