From patchwork Fri Jun 16 04:40:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= X-Patchwork-Id: 9790509 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4F6F860326 for ; Fri, 16 Jun 2017 04:42:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DA912855C for ; Fri, 16 Jun 2017 04:42:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42A8F28608; Fri, 16 Jun 2017 04:42:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FAED2855C for ; Fri, 16 Jun 2017 04:42:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752171AbdFPEl6 (ORCPT ); Fri, 16 Jun 2017 00:41:58 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36103 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751923AbdFPElQ (ORCPT ); Fri, 16 Jun 2017 00:41:16 -0400 Received: by mail-wr0-f194.google.com with SMTP id 77so5298867wrb.3 for ; Thu, 15 Jun 2017 21:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kempniu.pl; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a5aLvQVCwSLKF3E7Wr/7PuNELL0n3S62x2KFN+uXiCE=; b=Hl47mqaSpYRSjvbuwoSRrNWvsfm+UYEP45r5S3Ui/8Nl5BHd2fxJDLCNWDCCzuytJa TkRWkMfXR3pXarvAc6rBuMbVQ6uVaOn5EQA1U50ySK4Jl9HHHwYRHgOTVb6YaQHcZTHU 1QUe/1pZZ7DpZebI+vaSA/nmyevGhZtk2rpog= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a5aLvQVCwSLKF3E7Wr/7PuNELL0n3S62x2KFN+uXiCE=; b=A0XM0tl9Ec5HgOlza9TsI2it/ojmD6OdZNLGlHEbTkTbp/oWuR7v4LElHkjefIaD0f BUCwr2cq6R9dzd+yxbLRsBBn0+62teAX1YfIUWK3s74ORv49CeHWJv1VfyOl4V2GxpaI aWxfTU5TWJPgcMiKssH8545EB1NWGtsBOLEMgatelYtW/rojoLN1VZCaXkEz8RnJ+Ggk uRQiFhCaXG2kKQ74mRfWUQMc71bcDXfI1/dK/1WIucGJiUn+XSGByyk3WEBbmFYZPtx3 u8nHqKYJ0+pqvDXPf1RxNb0ouoNgdxnROfDL6vFtCuS48qh0eZMlBLvhrUQPkgzhMcY8 emCQ== X-Gm-Message-State: AKS2vOwQALwvbhgTvz27zJN/XZAVrLSm2xRojOq703oyKhe49XX36I44 AqXbqKoc9wvpIb+p X-Received: by 10.223.147.165 with SMTP id 34mr5348598wrp.175.1497588075075; Thu, 15 Jun 2017 21:41:15 -0700 (PDT) Received: from kmp-mobile.hq.kempniu.pl (kmp-mobile.hq.kempniu.pl. [2001:470:64df:111::2d90]) by smtp.googlemail.com with ESMTPSA id g3sm2026681wrd.11.2017.06.15.21.41.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jun 2017 21:41:14 -0700 (PDT) From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= To: Jonathan Woithe , Darren Hart , Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] platform/x86: fujitsu-laptop: do not update ACPI device power status Date: Fri, 16 Jun 2017 06:40:56 +0200 Message-Id: <20170616044058.30443-6-kernel@kempniu.pl> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170616044058.30443-1-kernel@kempniu.pl> References: <20170616044058.30443-1-kernel@kempniu.pl> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Calling acpi_bus_update_power() for ACPI devices FUJ02B1 and FUJ02E3 is pointless as they are not power manageable (neither _PS0 nor _PR0 is defined for any of them), which causes their power state to be inherited from their parent devices. Given the ACPI paths of these two devices (\_SB.PCI0.LPCB.FJEX, \_SB.FEXT), their parent devices are also not power manageable. These parent devices will thus have their power state initialized to ACPI_STATE_D0, which in turn causes the power state for both FUJ02B1 and FUJ02E3 to always be ACPI_STATE_D0 ("on"). Remove relevant acpi_bus_update_power() calls along with parts of debug messages that they were supposed to have an effect on. Signed-off-by: Michał Kępień --- drivers/platform/x86/fujitsu-laptop.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 5c0dc2126313..b9f3ede4d567 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -400,7 +400,6 @@ static int fujitsu_backlight_register(struct acpi_device *device) static int acpi_fujitsu_bl_add(struct acpi_device *device) { struct fujitsu_bl *priv; - int state = 0; int error; if (acpi_video_get_backlight_type() != acpi_backlight_vendor) @@ -419,15 +418,8 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device) if (error) return error; - error = acpi_bus_update_power(device->handle, &state); - if (error) { - pr_err("Error reading power state\n"); - return error; - } - - pr_info("ACPI: %s [%s] (%s)\n", - acpi_device_name(device), acpi_device_bid(device), - !device->power.state ? "on" : "off"); + pr_info("ACPI: %s [%s]\n", + acpi_device_name(device), acpi_device_bid(device)); if (acpi_has_method(device->handle, METHOD_NAME__INI)) { vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n"); @@ -788,7 +780,6 @@ static int acpi_fujitsu_laptop_leds_register(struct acpi_device *device) static int acpi_fujitsu_laptop_add(struct acpi_device *device) { struct fujitsu_laptop *priv; - int state = 0; int error; int i; @@ -807,15 +798,8 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device) if (error) return error; - error = acpi_bus_update_power(device->handle, &state); - if (error) { - pr_err("Error reading power state\n"); - return error; - } - - pr_info("ACPI: %s [%s] (%s)\n", - acpi_device_name(device), acpi_device_bid(device), - !device->power.state ? "on" : "off"); + pr_info("ACPI: %s [%s]\n", + acpi_device_name(device), acpi_device_bid(device)); if (acpi_has_method(device->handle, METHOD_NAME__INI)) { vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n");