From patchwork Sat Dec 27 20:22:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 5548941 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E3C6CBF6C3 for ; Mon, 29 Dec 2014 08:26:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CBC8E200F4 for ; Mon, 29 Dec 2014 08:25:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E5D6320117 for ; Mon, 29 Dec 2014 08:25:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D7B5289A72; Mon, 29 Dec 2014 00:25:30 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from v094114.home.net.pl (v094114.home.net.pl [79.96.170.134]) by gabe.freedesktop.org (Postfix) with SMTP id 3E5F2890A5; Sat, 27 Dec 2014 12:01:01 -0800 (PST) Received: from aayg134.neoplus.adsl.tpnet.pl (83.6.118.134) (HELO vostro.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer v0.80) id 6e987aecc04a15ab; Sat, 27 Dec 2014 21:00:59 +0100 From: "Rafael J. Wysocki" To: Pali =?ISO-8859-1?Q?Roh=E1r?= Subject: Re: [Intel-gfx] 3.19-rc1 errors when opening LID Date: Sat, 27 Dec 2014 21:22:56 +0100 Message-ID: <1818900.MY9q0yfluC@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/3.16.0-rc5+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <201412270919.49540@pali> References: <201412241951.48652@pali> <549C4278.5080707@gmail.com> <201412270919.49540@pali> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 29 Dec 2014 00:25:30 -0800 Cc: nick , linux-pci@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-acpi@vger.kernel.org, Bjorn Helgaas , Daniel Vetter , Andy Shevchenko , Mika Westerberg , Len Brown X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Saturday, December 27, 2014 09:19:49 AM Pali Rohár wrote: > Hello, > > in attachment is output of ls -l /sys/bus/acpi/devices from both > 3.13 and 3.19 kernels. > > Anyway Gabriele Mazzotta wrote me that new acpi devices could be > created after commit faae404ebdc6bba (ACPICA: Add "Windows 2013" > string to _OSI support). > > Maybe this another output could help you: > > $ cat /sys/bus/acpi/devices/INT33C5\:00/status > 0 > $ cat /sys/bus/acpi/devices/INT33C5\:00/power_state > (unknown) > > Device INT33C5 is in that dmesg log: > acpi INT33C5:00: Cannot transition to non-D0 state from D3 The appended patch should make these messages go away, please test. > And status 0 in sysnode could indicate that acpi device is not > present right? That's correct. --- drivers/acpi/device_pm.c | 7 ++++--- include/acpi/acpi_bus.h | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) Index: linux-pm/include/acpi/acpi_bus.h =================================================================== --- linux-pm.orig/include/acpi/acpi_bus.h +++ linux-pm/include/acpi/acpi_bus.h @@ -589,7 +589,8 @@ static inline u32 acpi_target_system_sta static inline bool acpi_device_power_manageable(struct acpi_device *adev) { - return adev->flags.power_manageable; + return adev->flags.power_manageable + && (adev->status.present || adev->status.functional); } static inline bool acpi_device_can_wakeup(struct acpi_device *adev) Index: linux-pm/drivers/acpi/device_pm.c =================================================================== --- linux-pm.orig/drivers/acpi/device_pm.c +++ linux-pm/drivers/acpi/device_pm.c @@ -68,7 +68,8 @@ int acpi_device_get_power(struct acpi_de { int result = ACPI_STATE_UNKNOWN; - if (!device || !state) + if (!device || !state + || !(device->status.present || device->status.functional)) return -EINVAL; if (!device->flags.power_manageable) { @@ -156,7 +157,7 @@ int acpi_device_set_power(struct acpi_de int result = 0; bool cut_power = false; - if (!device || !device->flags.power_manageable + if (!device || !acpi_device_power_manageable(device) || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3_COLD)) return -EINVAL; @@ -361,7 +362,7 @@ bool acpi_bus_power_manageable(acpi_hand int result; result = acpi_bus_get_device(handle, &device); - return result ? false : device->flags.power_manageable; + return result ? false : acpi_device_power_manageable(device); } EXPORT_SYMBOL(acpi_bus_power_manageable);