Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2042625pxb; Sun, 17 Oct 2021 04:29:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQtyLWCUHmdSSBDAdQSNh/LQpsePazhSnajWBRwdYGgM/Np1dfbi0Onyodf8HmYqqEgTWn X-Received: by 2002:a17:90b:4a88:: with SMTP id lp8mr27156618pjb.226.1634470165692; Sun, 17 Oct 2021 04:29:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634470165; cv=none; d=google.com; s=arc-20160816; b=pBgu9rrDWVcNKinCTcCPin6tZOygm/hxkZf+NVgPECNb0H8H6yldI0cHiWfqOCoiMn Hv90XQXxR+OANx/RU25emRWrbNEidesT+ldE+MtZ+XKJVFhXO1Rs2+Q2Ca7Kw/bs19Xf +TU2+s6jQK6euFuYbA9jsx7D6GtUyZIfq4VInV/YY9joCHOpp+0jQfsrLG4UOHp/b3sA tOcBHkL8wDkCsVF5yKBTrePNaFspIPGNH8sgoHe1ItIBXBBEM48UeEABAqvolN4WEpbT VD3FydkHXkoLlA88MwaDvHhlmIfm35Cu5v5ZMazIIFzwRdpb/fu309iwhflT/yDNVhgf Lcmg== 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=Ni3uf9hRfWqVMcyq0v79RdmMxKFk5u1kr59B0igsSPA=; b=qT7wDGt/qG+Wr7tCVaLEEpIPUgZV3GPvRL4IVdpzWaj14KOIF6xsvZsEixsrb48G9s 4UmssStSD2ncgbXu9FbhvhEjASKTMJJakqoUg2Z0Xa4/o8ib18WqKHLu0qAs2F1eD+cl nwdlOEQiXW6Zf8bypIMgNomRiBE+09rly7YkyXSpmWBxu9V+ndDr7hd22EzCTIDGAVBD c8kSPL/hh7QvrqDRg4qPIycodvAS/rdILox2Jtc1XhsnmGzk1V39jiDEtSCAN2cgRU2Q B4dxcOfVyMw6ZDyXN0985jyrClAtaitF+6AandQFN/Akt9uuw51/6dQ0OKWb7sCGYxSY G6Kw== 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 s2si16098653plk.381.2021.10.17.04.29.13; Sun, 17 Oct 2021 04:29:25 -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 S241930AbhJORG4 (ORCPT + 99 others); Fri, 15 Oct 2021 13:06:56 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:47804 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237791AbhJORGy (ORCPT ); Fri, 15 Oct 2021 13:06:54 -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 6e753915d7a8dc33; Fri, 15 Oct 2021 19:04:46 +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 5A26C66A8C0; Fri, 15 Oct 2021 19:04:45 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: Linux PM , LKML , Mika Westerberg , Linux PCI Subject: [PATCH v1 3/3] ACPI: PM: Turn off wakeup power resources on _DSW/_PSW errors Date: Fri, 15 Oct 2021 19:04:26 +0200 Message-ID: <2795050.e9J7NaK4W3@kreacher> In-Reply-To: <4347933.LvFx2qVVIh@kreacher> References: <4347933.LvFx2qVVIh@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: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrvddugedguddtjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdejlefghfeiudektdelkeekvddugfeghffggeejgfeukeejleevgffgvdeluddtnecukfhppedvudefrddufeegrddujeehrddvheehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudejhedrvdehhedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehmihhkrgdrfigvshhtvghrsggvrhhgsehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthht oheplhhinhhugidqphgtihesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki If acpi_device_sleep_wake() called by acpi_enable_wakeup_device_power() returns an error which means that the evaluation of either _DWS or _PSW has failed, turn off all of the device's wakeup power resources to be consistent with the clearing of dev->wakeup.prepare_count. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/power.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: linux-pm/drivers/acpi/power.c =================================================================== --- linux-pm.orig/drivers/acpi/power.c +++ linux-pm/drivers/acpi/power.c @@ -731,8 +731,10 @@ int acpi_enable_wakeup_device_power(stru * put into arbitrary power state afterward. */ err = acpi_device_sleep_wake(dev, 1, sleep_state, 3); - if (err) + if (err) { + acpi_power_off_list(&dev->wakeup.resources); dev->wakeup.prepare_count = 0; + } out: mutex_unlock(&acpi_device_lock);