Bug 247003 - Would like suspend / resume to work out of the box
Summary: Would like suspend / resume to work out of the box
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.1-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-05 14:51 UTC by luna
Modified: 2020-06-07 09:17 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description luna 2020-06-05 14:51:03 UTC
I've tried installing FreeBSD on several laptops (two ThinkPads, an x220 and a t420) and suspend / resume doesn't work out of the box like it does on OpenBSD. This is a fundamental, basic feature of laptops and not supporting it on FreeBSD makes it hard to recommend it for laptop users.
Comment 1 luna 2020-06-05 14:58:40 UTC
Just to clarify a bit, what I mean here is suspend / resume when closing the lid and opening it again. This is entirely separate to issues of ACPI / APM not supporting a specific machine (which I appreciate is a mess of undocumented black magic).
Comment 2 Andriy Gapon freebsd_committer freebsd_triage 2020-06-06 19:49:32 UTC
Why suspending on lid close should be the default behavior?
Comment 3 luna 2020-06-06 20:05:44 UTC
(In reply to Andriy Gapon from comment #2)

Closing a laptop's lid is a very commonly supported way of putting the machine to sleep. I do this with my MacBooks every day. I do this with my OpenBSD ThinkPad every day, too. When I've run Linux on laptops, besides distributions like Gentoo that are intentionally minimal in their default configuration, it suspends when I close the lid as well.

I feel this is a common enough expectation that it would be reasonable for FreeBSD to support it as well.

I return the question to you: why doesn't FreeBSD do this by default?
Comment 4 Dmitry Marakasov freebsd_committer freebsd_triage 2020-06-06 21:48:43 UTC
I'm strongly against this. Closing the lid is very common for anything not involving suspending, e.g. moving a laptop around, turning off the display or just protecting it against the dust. Suspending running operations, losing tcp connections and other consequences of suspend/resume in these cases are not expected, would be an inconvenience at least, and dangerous in many cases, given the prevalence of misbehaving hardware with high chance of laptop failing to properly resume. FWIW, I've not seen any other OS to suspend on lid close for years.

This should be a part of individual tuning which would be needed for most laptops anyway, along with configuring power profile, driver/firmware loading and some model-specific quirks such as intel_backlight. The default system should not play powersaving games without explicit request.
Comment 5 Andriy Gapon freebsd_committer freebsd_triage 2020-06-07 09:17:02 UTC
Just in case:
- the behavior you want is easily configurable with hw.acpi.lid_switch_state for "barebones" FreeBSD, but I usually configure the behavior via my desktop environment of choice
- my personal preference, if anyone cares, is to just lock current session while on AC and to suspend while on battery