Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1974899imm; Sun, 12 Aug 2018 04:06:09 -0700 (PDT) X-Google-Smtp-Source: AA+uWPw422L0PS9MF0UgxBqR1VNdP5/Mzxr9mL6Nq/E3n7wswEz5uhBPEnjyrk+JUJa2Vhtor6Dw X-Received: by 2002:a17:902:5481:: with SMTP id e1-v6mr12837762pli.309.1534071969828; Sun, 12 Aug 2018 04:06:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534071969; cv=none; d=google.com; s=arc-20160816; b=z/prmnfWELFmekewTXz+MilJz47yLlqTBXBCkR1f6veF+lehByPt6Jknxf2fmluVai lE9yl6lBT8JJFhJjSmbI8I4mACOKotRhZbody8DQlY2tUvV7uRD84s2SDVp42tZ07nWr e3lZo6e/Ozx9jz/GS9ip3EHrE5wBb+/bqk/dZ/T0rx7fFHk5Jr56Bs70DyS8Nhvv3ubI KgRd64m5Q7NSeZS2hdFzghWA3SVyEYzwTXCMIZgJsvewyovfGUIFn5cAjuvCIsVl4r0C tEc9NZGUGDqE5GLZMJzi0i0P++24eCN6y9YdwcUBhKUosPZUL3d8SfsrdaJYr0XWbXpd jQZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:arc-authentication-results; bh=dFVXD/NTaNK2jpdHOXo8rwjnA5BMn+RDs9TQZNd44ZI=; b=WV0M62i99Aatd6SEl5dalgQvKK00hW+0fWEF18m6HkvF07FtMLX5cJdnzsD260zXAo Ysg+tRw3AzindMOFT/4SyarNTdDvKdjKbLE2SUJEnvWyC9Aqddqma07b/RnhBwv8ofx4 iV+IXOtYjOYSHff2/XubSDSq4oE9MZte5b0cX4B+HaIEzpTaXbvuZcjZXKacL4iFhbnP TMmWmusv6vWm3WmU/ISkVeiliflrOYXDCKgOAclVSuQ/m2yxLXcNKxk+Fo8s0UdK1OiJ yFUReTfmkC7i4Zv8rjfFPcIduLsjrSdMs2s2cy5J3uuw4cEIig5pz9yEKKgHLbe25WKD a3RA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ba10-v6si11938665plb.228.2018.08.12.04.05.55; Sun, 12 Aug 2018 04:06:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728131AbeHLN34 (ORCPT + 99 others); Sun, 12 Aug 2018 09:29:56 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:50939 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728065AbeHLN34 (ORCPT ); Sun, 12 Aug 2018 09:29:56 -0400 Received: from 79.184.254.66.ipv4.supernova.orange.pl (79.184.254.66) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id fd5b4c1f0c3bc93f; Sun, 12 Aug 2018 12:52:16 +0200 From: "Rafael J. Wysocki" To: Linux ACPI Cc: Paul Menzel , Linux PM , LKML , Erik Schmauss Subject: [PATCH] ACPICA: Clear status of all events when entering sleep states Date: Sun, 12 Aug 2018 12:50:09 +0200 Message-ID: <1764673.ub23GCSM6t@aspire.rjw.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Commit fa85015c0d95 (ACPICA: Clear status of all events when entering S5) made the sleep state entry code in ACPICA clear the status of all ACPI events when entering S5 to fix a functional regression reported against commit 18996f2db918 (ACPICA: Events: Stop unconditionally clearing ACPI IRQs during suspend/resume). However, it is reported now that the regression also affects system states other than S5 on some systems and causes them to wake up from sleep prematurely. For this reason, make the code in question clear the status of all ACPI events when entering all sleep states (in addition to S5) to avoid the premature wakeups (this may cause some wakeup events to be missed in theory, but the likelihood of that is small and the change here simply restores the previous behavior of the code). Fixes: 18996f2db918 (ACPICA: Events: Stop unconditionally clearing ACPI IRQs during suspend/resume) Reported-by: Paul Menzel Tested-by: Paul Menzel Cc: 4.17+ # 4.17+: fa85015c0d95 ACPICA: Clear status ... Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/hwsleep.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) Index: linux-pm/drivers/acpi/acpica/hwsleep.c =================================================================== --- linux-pm.orig/drivers/acpi/acpica/hwsleep.c +++ linux-pm/drivers/acpi/acpica/hwsleep.c @@ -56,14 +56,9 @@ acpi_status acpi_hw_legacy_sleep(u8 slee if (ACPI_FAILURE(status)) { return_ACPI_STATUS(status); } - /* - * If the target sleep state is S5, clear all GPEs and fixed events too - */ - if (sleep_state == ACPI_STATE_S5) { - status = acpi_hw_clear_acpi_status(); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } + status = acpi_hw_clear_acpi_status(); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); } acpi_gbl_system_awake_and_running = FALSE;