Skip to contentSkip to conversation

Proper way to disable hibernate for a platform

DISCUSSION Thomas Glanzmann 1 participant 1 message Jan 11

lore
Share & tools
lore
#0 lore raw

Hallo,
arm based macs do not support hibernation at the moment, sometimes they crash, sometimes they try to stop the cpu, can't and abort the attempt. What is the porper way to tell hibernation code that suspend is not available on that platform?

Looking at the code in kernel/power/hibernate.c it appears that hibernation_available is the right place to do it:

bool hibernation_available(void)

{
        return nohibernate == 0 &&
                !security_locked_down(LOCKDOWN_HIBERNATION) &&
                !secretmem_active() && !cxl_mem_active();
}

Or is there a better way? How would a platform agnostic interface best look like, something allong the lines:

dmi_check_system(hibernate_blacklist)

Or ist there a better way?

Cheers,
Thomas