Page MenuHomeFreeBSD

sys/x86/cpufreq/hwpstate_amd.c: add amd pstate for zen5
ClosedPublic

Authored by aokblast on Dec 8 2024, 8:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jan 20, 3:09 PM
Unknown Object (File)
Sun, Jan 19, 12:15 PM
Unknown Object (File)
Sun, Jan 19, 10:36 AM
Unknown Object (File)
Sun, Jan 19, 7:17 AM
Unknown Object (File)
Sun, Jan 19, 3:33 AM
Unknown Object (File)
Sun, Jan 19, 3:07 AM
Unknown Object (File)
Sun, Jan 19, 3:04 AM
Unknown Object (File)
Sat, Jan 18, 10:00 AM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 61030
Build 57914: arc lint + arc unit

Event Timeline

Is the associated hardware documentation public, and if so, could you link to it?

sys/x86/cpufreq/hwpstate_amd.c
518–519

Missing break

sys/x86/cpufreq/hwpstate_amd.c
93–95

I think we can just keep using the 17H macros for these three fields that didn't change? (IDIV, IDD, VID)

Fix break error and add reference

In D47985#1093902, @cem wrote:

Is the associated hardware documentation public, and if so, could you link to it?

I found it in volume 1 here: https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/programmer-references/57896.zip

sys/x86/cpufreq/hwpstate_amd.c
91

This comment is repeated below, so isn't really needed here.

174

As a matter of style, it'd be a bit nicer to return the value instead of writing through a pointer.

492
494

According to the PPR, fid <= 0xf is a reserved value. Should we report an error in that case, instead of silently leaving the frequency unset?

Fix style and report error for fid

Update debug message for fid

BTW, is hwpstate_amd quite older than intel one? I thought it don't have autonomous mode and it throttling all cpu into same freqs.

BTW, is hwpstate_amd quite older than intel one? I thought it don't have autonomous mode and it throttling all cpu into same freqs.

Indeed, it doesn't implement the CPPC interfaces. As far as I know, we just rely on the platform firmware to handle CPU power management.

This revision is now accepted and ready to land.Dec 9 2024, 3:11 PM

Tested together with aokblast yesterday on Framework 16 (Ryzen 4) and it seems to work with case 0x19:.
Frequency can't correctly be reported but from the temperature reading it seems that very likely the frequency is scaled.

Does frequency reporting work correctly on ryzen 5?

It doesn't report the correct freq from zen5 (observed from htop). We can only observe a static frequency instead of dynamically changed. I will create a patch about zen4 later

This revision now requires review to proceed.Wed, Jan 15, 11:29 AM

If everything looks good, please merge the parent revision before merging this one.

The zen4/zen5 patch on github: https://github.com/aokblast/freebsd-src/tree/add_amd_pstate_for_zen5

You can use .patch to get the git patch.

This revision was not accepted when it landed; it landed in state Needs Review.Thu, Jan 16, 2:26 PM
Closed by commit rG0e6e1f14f0a7: hwpstate_amd: add amd pstate for zen5 (authored by aokblast, committed by markj). · Explain Why
This revision was automatically updated to reflect the committed changes.