Page MenuHomeFreeBSD

amdsmu: Read and dump idlemask
ClosedPublic

Authored by obiwac on Jul 24 2025, 1:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 10, 4:32 PM
Unknown Object (File)
Fri, Oct 10, 4:32 PM
Unknown Object (File)
Fri, Oct 10, 4:32 PM
Unknown Object (File)
Fri, Oct 10, 4:31 PM
Unknown Object (File)
Fri, Oct 10, 10:50 AM
Unknown Object (File)
Thu, Sep 25, 4:54 AM
Unknown Object (File)
Sep 13 2025, 6:34 AM
Unknown Object (File)
Sep 11 2025, 2:52 AM
Subscribers
None

Details

Summary

Read and dump SMU's idlemask value in dev.amdsmu.0.idlemask sysctl.

The idlemask is used internally by AMD and its value is not documented anywhere. This patch exposes it mainly to help AMD diagnose issues with S0i3 entry on FreeBSD.

Sponsored by: The FreeBSD Foundation

Test Plan

I have tested this on the Framework 13 AMD Ryzen 7040 series (Phoenix):

% sysctl dev.amdsmu.0.idlemask
dev.amdsmu.0.idlemask: 1071365821

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

obiwac created this revision.

Do we expect to remove this again in the future?

No, this can always be useful (e.g. debugging S0i3 on new platforms, diagnosing user issues preventing the system from entering S0i3, etc).

Otherwise seems unobjectionable to me.

sys/dev/amdsmu/amdsmu.c
284

It's been a while, but I don't think this whitespace is style(9)?

289–296

This thing is pretty funky. Why not just do it in attach()?

obiwac marked 2 inline comments as done.

Simplify sysctl adding

sys/dev/amdsmu/amdsmu.c
285

"dump" seems confusing in the fn name, should it be amdsmu_get_idlemask or amdsmu_fetch_idlemask maybe?

sys/dev/amdsmu/amdsmu.c
285

Perhaps, it was named dump to match amdsmu_dump_metrics but maybe it should be named fetch instead.

obiwac marked an inline comment as not done.Jul 25 2025, 9:52 PM
This revision is now accepted and ready to land.Jul 26 2025, 8:49 PM

Review process looks good and complete.
Adding my accept as your mentor.

This revision was automatically updated to reflect the committed changes.