Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 May 2020 01:39:37 +0000 (UTC)
From:      Colin Percival <cperciva@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r361234 - stable/12/sys/dev/acpica
Message-ID:  <202005190139.04J1dbUQ064796@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cperciva
Date: Tue May 19 01:39:37 2020
New Revision: 361234
URL: https://svnweb.freebsd.org/changeset/base/361234

Log:
  MFC r361097:
    Send Lid status notification via devd from acpi_lid_status_update.
  
    Some laptops don't send ACPI "lid status changed" notifications upon
    opening the lid if the system was currently suspended.  In r358219
    this was partially fixed, updating the "lid_status" variable upon
    resume even if there is no "status changed" notification from ACPI.
  
    Unfortunately the fix in r358219 did not include notifying userland
    via devd; this causes problems on systems using upowerd (e.g. KDE),
    since upowerd remembers the most recent devd notification about the
    lid status rather than querying the sysctl to get the current status.
  
    This showed up as two symptoms when KDE's "When laptop lid closed: Sleep"
    option is set:
    1. 50% of the time, closing the lid would not trigger S3 sleep.
    2. 50% of the time, plugging/unplugging AC power would trigger S3 sleep.
  
  PR:		246477

Modified:
  stable/12/sys/dev/acpica/acpi_lid.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/acpica/acpi_lid.c
==============================================================================
--- stable/12/sys/dev/acpica/acpi_lid.c	Tue May 19 01:32:15 2020	(r361233)
+++ stable/12/sys/dev/acpica/acpi_lid.c	Tue May 19 01:39:37 2020	(r361234)
@@ -113,6 +113,9 @@ acpi_lid_status_update(struct acpi_lid_softc *sc)
 	/* range check value */
 	sc->lid_status = lid_status ? 1 : 0;
 
+	/* Send notification via devd */
+	acpi_UserNotify("Lid", sc->lid_handle, sc->lid_status);
+
 #ifdef EVDEV_SUPPORT
 	/* Notify evdev about lid status */
 	evdev_push_sw(sc->lid_evdev, SW_LID, lid_status ? 0 : 1);



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