Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Sep 2015 20:49:28 -0700
From:      Colin Percival <cperciva@freebsd.org>
To:        "freebsd-acpi@freebsd.org" <freebsd-acpi@freebsd.org>
Subject:   disabling sleep when shutting down
Message-ID:  <55FA3848.7090802@freebsd.org>

next in thread | raw e-mail | index | archive | help
Hi ACPI people,

I ran into an interesting glitch recently: I told my laptop to shut down,
then closed the lid... and it promptly went into S3.  When I opened the
lid a couple days later, it resumed... and then finished the shutdown
which it had started 2 days earlier.  Meanwhile with two days of sitting
in S3 instead of S5, the battery had almost completely drained.

The obvious answer here is to disable Suspend if we're in the shutdown
path.  My first thought was to make rc.suspend slightly smarter, but that
isn't good enough since there's a 10 second timeout after which the suspend
will happen even if rc.suspend doesn't send the expected acknowledgment.  So
I think we need to get the kernel ACPI bits to disable Suspend.

It looks to me like adding a sysctl to dev/acpica/acpi.c and checking it in
acpi_ReqSleepState would work; then we just need a line in /etc/rc.shutdown
to set the sysctl.  But ACPI code scares me, so I figured I should check
with you guys first... am I missing anything?

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55FA3848.7090802>