Page MenuHomeFreeBSD

acpi_lid: correct Lid state after boot and resume
ClosedPublic

Authored by yuripv on Feb 17 2020, 2:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 14, 11:39 PM
Unknown Object (File)
Feb 24 2024, 12:22 AM
Unknown Object (File)
Feb 16 2024, 1:14 AM
Unknown Object (File)
Jan 11 2024, 9:44 PM
Unknown Object (File)
Dec 20 2023, 6:52 AM
Unknown Object (File)
Nov 30 2023, 10:06 AM
Unknown Object (File)
Oct 6 2023, 3:22 PM
Unknown Object (File)
Sep 1 2023, 4:21 AM
Subscribers

Details

Summary
  1. Correct value after boot, triggered by a message on questions@. I have looked the file history, and see that it was implemented previously, and backed out as breaking pure GPE lid switches -- it should not be a problem now as the logic has changed, and we send notifications based only on current value, without comparing it to previous one.
  2. Correct value after resume, PR240881.
  3. Correct the sysctl description while here.
Test Plan

Check dev.acpi_lid.0.state value after:

  1. Both open and closed lid: normal boot, 1 open, 0 closed.
  2. Closed lid: suspend using acpiconf -s3, resume by opening the lid, check state (state = 1).
  3. Closed lid: suspend using acpiconf -s3, resume using a power button on dock (state = 0).
  4. Open lid: suspend using acpiconf -s3, resume using a power button (state = 1).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/acpica/acpi_lid.c
136 ↗(On Diff #68435)

Wonder if I should fix this description while here, it's somewhat misleading.

hselasky added inline comments.
sys/dev/acpica/acpi_lid.c
136 ↗(On Diff #68435)

Please do.

yuripv edited the summary of this revision. (Show Details)

Correct sysctl description.

yuripv added inline comments.
sys/dev/acpica/acpi_lid.c
136 ↗(On Diff #68435)

Looks better now?

This revision is now accepted and ready to land.Feb 21 2020, 9:48 AM
cem added inline comments.
head/sys/dev/acpica/acpi_lid.c
128

This is now inconsistent with acpi_lid_notify_status_changed(), which checks the return value of acpi_GetInteger(... "_LID" ...) with if (ACPI_FAILURE(status)).

(We should probably check the error return everywhere, or nowhere.)

head/sys/dev/acpica/acpi_lid.c
128

I need to check in which cases we can expect an error.

For the time being, failure in these code paths is not critical and will likely block attach for the LID driver.