Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2059167pxb; Sun, 17 Oct 2021 04:57:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgmBzUeDWmoyvZCO00gl0QMQ3wVx4zTgEH/Q0WnN7i3h/80cMlZaK5xu9MMdmBPgllqIrl X-Received: by 2002:a05:6a00:1acc:b0:44d:98de:6ed6 with SMTP id f12-20020a056a001acc00b0044d98de6ed6mr14313872pfv.50.1634471877636; Sun, 17 Oct 2021 04:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634471877; cv=none; d=google.com; s=arc-20160816; b=Z7cHo3JK9ixP1/DM6tNfJlsFIAvJEJkSptE1sENvEFopCLFb3gTr6jWW0vxQd65We2 oHnrE9JEQCCQIWS/2H1jaRNbjyBrGCYZljCwaUD69mwqo7FFb7Q8S+EUynyb6rxZx9j2 s8V7wZJSeEd6CbM6PdrnPBkSJAHLvbe0O2FtIHsHNZCNEYrY4+aalmslYfuHqYVd4mU3 TMSwVUwfwCTckVRcWsPNavG5440xewDT1DtULxVy047q61n1bM/hlESHA/iTOtsanBgg AAYbS9jH1ydyaZCRcsSjpCk/tbQtsI+UOCwoi346BuSueXm+GKTa3S3X3Wa85KrVyWLr J1JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=d9MRMOG53QmAqV712Yk5lfSvwyi6wOw+TSCURfVp2pk=; b=iAj2GSWXO5hmjD6nk2IfU21p+xMcu1mMXMDKEuzQEeaQYxJySp6X0aydEapAuoBf8v bcUJ6MpAS155rHsscC9TZwv/4h+elqUsaoSYQieb1A1PxmWdU9Kto1bw3SlJLpwO3SQK pw87O24bjSRckCdwtKhvaCzv1oFTBrv+zoAwaWZ+lUZ4QQsnZiTl9Q/YsgNIUtL2N3eh 4w2/cNMQ1SRGQP8mLTIQyA7rBH1KE91bHLBcTnWFyr0w684B3NyYkouB9loCeWwDrLmM UO3j+vhhZ2BLEH9G4SMMxZQ9uD5GikKU7fIfYQSaFqqT8vNhMWJIrgE86wjrJqJFaFPv ik1Q== 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 t4si15569064pfd.103.2021.10.17.04.57.45; Sun, 17 Oct 2021 04:57:57 -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 S242131AbhJORSX (ORCPT + 99 others); Fri, 15 Oct 2021 13:18:23 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:53284 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242204AbhJORSW (ORCPT ); Fri, 15 Oct 2021 13:18:22 -0400 Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 3.0.0) id 2299f938f24327a6; Fri, 15 Oct 2021 19:16:14 +0200 Received: from kreacher.localnet (unknown [213.134.175.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 4C3A866A8C0; Fri, 15 Oct 2021 19:16:13 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Linux PCI , Linux PM , Mika Westerberg , "Andreas K. Huettel" Subject: [PATCH v1 1/2] ACPI: PM: Do not turn off power resources in unknown state Date: Fri, 15 Oct 2021 19:12:21 +0200 Message-ID: <3625109.kQq0lBPeGt@kreacher> In-Reply-To: <21226252.EfDdHjke4D@kreacher> References: <21226252.EfDdHjke4D@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.175.255 X-CLIENT-HOSTNAME: 213.134.175.255 X-VADE-SPAMSTATE: spam:medium X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrudeljedgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecuufhprghmkfhppghrthculdeftddtmdenucfjughrpefhvffufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeetgefgleetgeduheeugeeikeevudelueelvdeufeejfeffgeefjedugfetfeehhfenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppedvudefrddufeegrddujeehrddvheehnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehinhgvthepvddufedrudefgedrudejhedrvdehhedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhptghisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdho rhhgpdhrtghpthhtohepmhhikhgrrdifvghsthgvrhgsvghrgheslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopegrnhgurhgvrghsrdhhuhgvthhtvghlsehurhdruggv X-DCC--Metrics: v370.home.net.pl 1024; Body=24 Fuz1=24 Fuz2=24 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Commit 6381195ad7d0 ("ACPI: power: Rework turning off unused power resources") caused power resources in unknown state with reference counters equal to zero to be turned off too, but that caused issues to appear in the field, so modify the code to only turn off power resources that are known to be "on". Link: https://lore.kernel.org/linux-acpi/6faf4b92-78d5-47a4-63df-cc2bab7769d0@molgen.mpg.de/ Fixes: 6381195ad7d0 ("ACPI: power: Rework turning off unused power resources") Reported-by: Andreas K. Huettel Tested-by: Andreas K. Huettel Signed-off-by: Rafael J. Wysocki Cc: 5.14+ # 5.14+ --- drivers/acpi/power.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) Index: linux-pm/drivers/acpi/power.c =================================================================== --- linux-pm.orig/drivers/acpi/power.c +++ linux-pm/drivers/acpi/power.c @@ -1015,13 +1015,8 @@ void acpi_turn_off_unused_power_resource list_for_each_entry_reverse(resource, &acpi_power_resource_list, list_node) { mutex_lock(&resource->resource_lock); - /* - * Turn off power resources in an unknown state too, because the - * platform firmware on some system expects the OS to turn off - * power resources without any users unconditionally. - */ if (!resource->ref_count && - resource->state != ACPI_POWER_RESOURCE_STATE_OFF) { + resource->state == ACPI_POWER_RESOURCE_STATE_ON) { acpi_handle_debug(resource->device.handle, "Turning OFF\n"); __acpi_power_off(resource); }