Page MenuHomeFreeBSD

acpi: Warn if no amdsmu(4) loaded after suspend-to-idle resume
ClosedPublic

Authored by obiwac on Mon, Sep 14, 6:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 4, 4:34 AM
Unknown Object (File)
Sat, Oct 3, 12:09 PM
Unknown Object (File)
Sat, Oct 3, 12:47 AM
Unknown Object (File)
Fri, Oct 2, 9:14 PM
Unknown Object (File)
Fri, Oct 2, 8:46 PM
Unknown Object (File)
Fri, Oct 2, 5:20 PM
Unknown Object (File)
Thu, Oct 1, 4:55 AM
Unknown Object (File)
Tue, Sep 29, 7:05 PM
Subscribers

Details

Summary

If amdsmu(4) is not loaded when entering suspend-to-idle, emit a
warning.

FreeBSD currently only supports S0ix on AMD CPUs through the SMU. When
Intel support is completed, we should check the equivalent for Intel
(intelpmc).

Sponsored by: The FreeBSD Foundation

Test Plan

Enter suspend-to-idle without amdsmu(4) loaded. It should emit this warning message.

Diff Detail

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

Event Timeline

olce requested changes to this revision.Wed, Sep 16, 11:29 AM

I'm fine with the principle of adding a warning. It's just that the current implementation is too rough, as it basically applies to all architectures whereas this concerns only amd64, and also the warning will be issued on Intel platforms as well, which is really confusing.

So, could you bracket this with __amd64__ and test cpu_vendor_id for CPU_VENDOR_AMD (and possibly CPU_VENDOR_HYGON too), and only in these cases perform the search for amdsmu?

This revision now requires changes to proceed.Wed, Sep 16, 11:29 AM

I do want this warning to be emitted on other platforms though, because without specific support they are likely not entering deep sleep either. The message itself is supposed to imply that only platforms with amdsmu are currently supported, but maybe I can make this a little more explicit.

  • factor out into check_post_suspend_to_idle()
  • different messages on AMD/Hygon than for other CPU vendors

Always printing a warning is fine for the time being. Having a separate function for the check is neat.

Still, that does not compile because cpu_vendor_id is only declared (and defined) for amd64/i386.

only use cpu_vendor_id on x64

Always printing a warning is fine for the time being. Having a separate function for the check is neat.

Still, that does not compile because cpu_vendor_id is only declared (and defined) for amd64/i386.

ah oops indeed, thanks for catching that

This revision is now accepted and ready to land.Wed, Sep 16, 4:15 PM