Bug 240881 - acpi_lid: dev.acpi_lid.0.state: 0 after resume (lid opened)
Summary: acpi_lid: dev.acpi_lid.0.state: 0 after resume (lid opened)
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Hans Petter Selasky
URL: https://reviews.freebsd.org/D23724
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-27 20:36 UTC by Johannes Lundberg
Modified: 2020-02-24 09:31 UTC (History)
3 users (show)

See Also:
koobs: mfc-stable12?
koobs: mfc-stable11?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Lundberg freebsd_committer 2019-09-27 20:36:10 UTC
As the title says, state remains = 0 after resume by opening the lid.

This happens when I suspend with command 'acpiconf -s3' and the lid is already closed (for example suspending while an external screen is connected)

Dell Latitude 2018 laptop
FreeBSD 13-CURRENT as of this date.
Comment 1 Johannes Lundberg freebsd_committer 2019-09-27 21:15:26 UTC
Some more consistent test results.

If lid switch does nothing, dev.acpi_lid.0.state updates as it should on lid open/close.

If lid switch suspends, or if I wake up from suspend by opening the lid, state remains 0.
Comment 2 commit-hook freebsd_committer 2020-02-21 09:52:29 UTC
A commit references this bug:

Author: hselasky
Date: Fri Feb 21 09:52:21 UTC 2020
New revision: 358219
URL: https://svnweb.freebsd.org/changeset/base/358219

Log:
  Make sure the ACPI lid state is updated during boot and after resume.
  While at it update the sysctl(9) description for the lid state.

  Differential Revision:	https://reviews.freebsd.org/D23724
  PR:		240881
  Submitted by:	Yuri Pankov <yuripv@yuripv.me>
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Changes:
  head/sys/dev/acpica/acpi_lid.c
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2020-02-22 03:48:34 UTC
Thanks for this Hans. Can/will this go to stable/11 ?
Comment 4 Hans Petter Selasky freebsd_committer 2020-02-22 08:57:20 UTC
I think so.
Comment 5 commit-hook freebsd_committer 2020-02-24 09:31:46 UTC
A commit references this bug:

Author: hselasky
Date: Mon Feb 24 09:31:31 UTC 2020
New revision: 358270
URL: https://svnweb.freebsd.org/changeset/base/358270

Log:
  Always check return value from acpi_GetInteger() after r358219.
  If a failure happens reading the lid state, assume the lid is opened.

  Suggested by:	cem @
  Differential Revision:	https://reviews.freebsd.org/D23724
  PR:		240881
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Changes:
  head/sys/dev/acpica/acpi_lid.c