Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp40764pxf; Wed, 17 Mar 2021 14:47:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVsvU+q5EY405SfMYeMYmIqmkYyunqClK6tB1NSF4twCWdUscuTYuHGgLgV7FfjjfhAzzM X-Received: by 2002:aa7:d98b:: with SMTP id u11mr45598239eds.352.1616017671971; Wed, 17 Mar 2021 14:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616017671; cv=none; d=google.com; s=arc-20160816; b=VK6uvvVimWocSwfyYrKpEybQdV4L614kSf5fDJI06bB9gJ4FUZoT0OO1MK3FyPYKZ5 LJq95gHMIr3gZYmO4cgA2ioftRSnHuj+l3zx8ugULn8t8EP2lGyJnz6bdXEaw7ELANVb 2UXi4Yz8fM7zBrNMLkWJWBnItgWhE+biI8c47mtV3vzuNISaXh4HQqeXP5Im/8r/3ybf 3VTl2kRMSjzNEhHBTlPJudgnOpUjHRwezqTooYqdBICThKmJMTioBPrWcLg6HbWI0ea9 EZ1sKL1stlSBRTcI7dltEWlVPVEc7Ui6cMAVgUt0Rc2yQ55gOMiHCEQs72NOa18rMMhU 31QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=bnmXoU5zekQbtVSxdKIDWXtkCdMwWQe8UYOe/S934U4=; b=telqwOsWGdZB42SKmjiabjYuzKra0mKrUBDB2acHamqKAHrYrn9WtXRoa61bal3U/u Fd0lqu9wTqyW6Jiz68y0FDuSDXH+m6EKujBhW7/Mxh8zNjBnT78IPA7iu/FA1JYazlLP iWy8Jkbfy4cs4X0OKVaifTnoUWKMv1wUVbXwQNwLe1ql2NKb7HDo6PLgiy0triDwJ9Cc TRh5urd+FiUZUwQC8Wd2ic0sR51ynnPlB7E5qCapunNVa4pJyzCEfcnnfZFXS0wYHo/7 3nOoe0OED/WK8SzrKZj9xsoXKds1fXKS2j5ws+8l/ECSeH0HmojC+rmb/vaifY9TWW7S 5MVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x16si22957edd.234.2021.03.17.14.47.29; Wed, 17 Mar 2021 14:47:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232367AbhCQV0o (ORCPT + 99 others); Wed, 17 Mar 2021 17:26:44 -0400 Received: from mx3.molgen.mpg.de ([141.14.17.11]:37331 "EHLO mx1.molgen.mpg.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231161AbhCQV0g (ORCPT ); Wed, 17 Mar 2021 17:26:36 -0400 Received: from [192.168.0.3] (ip5f5aeabc.dynamic.kabel-deutschland.de [95.90.234.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id D5C4020647911; Wed, 17 Mar 2021 22:26:33 +0100 (CET) Subject: Re: [PATCH] ACPI: scan: Turn off unused power resources during initialization To: "Rafael J. Wysocki" Cc: LKML , linux-pm@vger.kernel.org, David Box , linux-acpi@vger.kernel.org References: <2527835.vZkJICojNU@kreacher> From: Paul Menzel Message-ID: <8b35de7b-072f-128c-6a3f-c7da5a1b91b8@molgen.mpg.de> Date: Wed, 17 Mar 2021 22:26:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <2527835.vZkJICojNU@kreacher> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Rafael, Am 17.03.21 um 17:49 schrieb Rafael J. Wysocki: > From: Rafael J. Wysocki > > It is reported that on certain platforms unused ACPI power resources > that have not been explicitly turned off prevent the platform from > reaching the lowest power state in suspend-to-idle which leads to > excessive power draw. > > For this reason, turn all of the unused ACPI power resources off > at the end of the initial namespace scan for devices in analogy with > resume from suspend-to-RAM. > > Reported-by: David Box Thank you for the patch. Could you please add more details to the commit message, saying what device this was on, and if there were some error/warning messages pointing to the problem? Kind regards, Paul > Signed-off-by: Rafael J. Wysocki > --- > drivers/acpi/internal.h | 1 + > drivers/acpi/scan.c | 2 ++ > drivers/acpi/sleep.h | 1 - > 3 files changed, 3 insertions(+), 1 deletion(-) > > Index: linux-pm/drivers/acpi/internal.h > =================================================================== > --- linux-pm.orig/drivers/acpi/internal.h > +++ linux-pm/drivers/acpi/internal.h > @@ -139,6 +139,7 @@ int acpi_device_sleep_wake(struct acpi_d > int acpi_power_get_inferred_state(struct acpi_device *device, int *state); > int acpi_power_on_resources(struct acpi_device *device, int state); > int acpi_power_transition(struct acpi_device *device, int state); > +void acpi_turn_off_unused_power_resources(void); > > /* -------------------------------------------------------------------------- > Device Power Management > Index: linux-pm/drivers/acpi/scan.c > =================================================================== > --- linux-pm.orig/drivers/acpi/scan.c > +++ linux-pm/drivers/acpi/scan.c > @@ -2360,6 +2360,8 @@ int __init acpi_scan_init(void) > } > } > > + acpi_turn_off_unused_power_resources(); > + > acpi_scan_initialized = true; > > out: > Index: linux-pm/drivers/acpi/sleep.h > =================================================================== > --- linux-pm.orig/drivers/acpi/sleep.h > +++ linux-pm/drivers/acpi/sleep.h > @@ -8,7 +8,6 @@ extern struct list_head acpi_wakeup_devi > extern struct mutex acpi_device_lock; > > extern void acpi_resume_power_resources(void); > -extern void acpi_turn_off_unused_power_resources(void); > > static inline acpi_status acpi_set_waking_vector(u32 wakeup_address) > {