Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1407865

[PATCH v2 3/3] ACPI / button: Send "open" state after boot/resume

From Lv Zheng <lv.zheng@intel.com>
Newsgroups linux.kernel
Subject [PATCH v2 3/3] ACPI / button: Send "open" state after boot/resume
Date 2016-05-27 09:20 +0200
Message-ID <rDkdP-ox-27@gated-at.bofh.it> (permalink)
References <rzIy6-28V-11@gated-at.bofh.it> <rDkdP-ox-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Linux userspace (systemd-logind) keeps on rechecking lid state when the
lid state is closed. If it failed to update the lid state to open after
boot/resume, the system suspending right after the boot/resume could be
resulted.
Graphics drivers also uses the lid notifications to implment
MODESET_ON_LID_OPEN option.

Before the situation is improved from the userspace and from the graphics
driver, simply send initial "open" lid state to avoid issues. After this is
improved from the userspace and from the graphics driver, Linux kernel
could simply revert this minimal commit.

Link 1: https://lkml.org/2016/3/7/460
Link 2: https://github.com/systemd/systemd/issues/2087
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Cc: Bastien Nocera: <hadess@hadess.net>
---
 drivers/acpi/button.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index e706e4b..6e77312 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -342,6 +342,8 @@ static int acpi_button_resume(struct device *dev)
 	struct acpi_button *button = acpi_driver_data(device);
 
 	button->suspended = false;
+	if (button->type == ACPI_BUTTON_TYPE_LID)
+		return acpi_lid_notify_state(device, 1);
 	return 0;
 }
 #endif
@@ -422,6 +424,7 @@ static int acpi_button_add(struct acpi_device *device)
 	if (error)
 		goto err_remove_fs;
 	if (button->type == ACPI_BUTTON_TYPE_LID) {
+		(void)acpi_lid_notify_state(device, 1);
 		/*
 		 * This assumes there's only one lid device, or if there are
 		 * more we only care about the last one...
-- 
1.7.10

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH 1/2] ACPI / button: Send "open" state after boot/resume Lv Zheng <lv.zheng@intel.com> - 2016-05-17 10:30 +0200
  Re: [RFC PATCH 1/2] ACPI / button: Send "open" state after boot/resume "Rafael J. Wysocki" <rafael@kernel.org> - 2016-05-18 01:40 +0200
    RE: [RFC PATCH 1/2] ACPI / button: Send "open" state after  boot/resume "Zheng, Lv" <lv.zheng@intel.com> - 2016-05-18 03:30 +0200
      Re: [RFC PATCH 1/2] ACPI / button: Send "open" state after boot/resume "Rafael J. Wysocki" <rafael@kernel.org> - 2016-05-19 01:00 +0200
        RE: [RFC PATCH 1/2] ACPI / button: Send "open" state after  boot/resume "Zheng, Lv" <lv.zheng@intel.com> - 2016-05-19 04:00 +0200
          Re: [RFC PATCH 1/2] ACPI / button: Send "open" state after boot/resume "Rafael J. Wysocki" <rafael@kernel.org> - 2016-05-19 15:30 +0200
            Re: [RFC PATCH 1/2] ACPI / button: Send "open" state after  boot/resume Benjamin Tissoires <benjamin.tissoires@gmail.com> - 2016-05-26 15:40 +0200
              RE: [RFC PATCH 1/2] ACPI / button: Send "open" state after  boot/resume "Zheng, Lv" <lv.zheng@intel.com> - 2016-05-30 03:50 +0200
  Re: [RFC PATCH 1/2] ACPI / button: Send "open" state after  boot/resume Bastien Nocera <hadess@hadess.net> - 2016-05-18 15:00 +0200
    Re: [RFC PATCH 1/2] ACPI / button: Send "open" state after boot/resume "Rafael J. Wysocki" <rafael@kernel.org> - 2016-05-18 23:50 +0200
    RE: [RFC PATCH 1/2] ACPI / button: Send "open" state after  boot/resume "Zheng, Lv" <lv.zheng@intel.com> - 2016-05-19 04:00 +0200
  [PATCH v2 2/3] ACPI / button: Refactor functions to eliminate redundant code Lv Zheng <lv.zheng@intel.com> - 2016-05-27 09:20 +0200
  [PATCH v2 1/3] ACPI / button: Remove initial lid state notification Lv Zheng <lv.zheng@intel.com> - 2016-05-27 09:20 +0200
  [PATCH v2 3/3] ACPI / button: Send "open" state after boot/resume Lv Zheng <lv.zheng@intel.com> - 2016-05-27 09:20 +0200
    Re: [PATCH v2 3/3] ACPI / button: Send "open" state after boot/resume Benjamin Tissoires <benjamin.tissoires@gmail.com> - 2016-05-30 10:20 +0200
      RE: [PATCH v2 3/3] ACPI / button: Send "open" state after  boot/resume "Zheng, Lv" <lv.zheng@intel.com> - 2016-05-31 05:00 +0200
  [PATCH v2 0/3] ACPI / button: Clarify initial lid state Lv Zheng <lv.zheng@intel.com> - 2016-05-27 09:20 +0200
    Re: [PATCH v2 0/3] ACPI / button: Clarify initial lid state Valdis.Kletnieks@vt.edu - 2016-05-28 00:20 +0200

csiph-web