Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5224120ybv; Tue, 11 Feb 2020 11:30:25 -0800 (PST) X-Google-Smtp-Source: APXvYqx8k5AnHFKe1Tgk9nfeTyrt09PKupYXuApJm1OLr/t3c//1h7hp1BZ5Ufus3Re0J6b71Xuj X-Received: by 2002:aca:5486:: with SMTP id i128mr3739752oib.12.1581449425196; Tue, 11 Feb 2020 11:30:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581449425; cv=none; d=google.com; s=arc-20160816; b=WJXwHHMm609ndi0iKj86cmLBjWcpPE5rndbzBlm6L++qpLk19H1bgHVp4fieX5+rK1 /biJZhTTtt1zQg5lbXQidD/ZK4uHZM9A8I3CaqptB0rZiHnESGTVS2Z823BzRmIOR7x/ PjU0JsEmMy3QmX6zRLTqgBfqYXnLJsa4EMAo8uJ8VVdXALRpbbGUrxK/QOM7r1vroQaU Fg+gadLsYyLZXeIkCu1YEPXtW6CUCygwopfCXnn+8CNUeEkUyjDvBTAH/owT+234HP45 wUpSnBuX7a0vD3cKMFbbxFGz3aa5BPkvsSCN89gvfu1EZrRgobgdr6WjoKTsKt4U//Tq 27+A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=thO8D3GxDpPtTyZAyG3Rvt1a29mhe8rabl/p9zUSd2o=; b=HnGfbMAiTzQFPJ/0f0FJqsyGNyZuVNBjinrf9RxaOrfHdOqwKXI+47Q9BZ+BWssIRe 4C7+aHZLAO8CzgjuGNfc0yP6Sz23ZQeG41uuNBCcC3cv9w2AnInPYX7Kuo0BAPu0y/tI IEqcnIic0Feyv0DHtCUbctJyZvoPBktaGaKGMWJvVVcV6e5h+JE5kqaZB4T75th2zDmc L0r9GtMXgc7VvvFEq8WkKWZ4JELf0XwyYq8lRrg55nnBz0w5s9eqfGW/iDDhcna5kViq ENg/m8g0uJUbVkmDCI84WmK49ktSs/55HqoHp91MLJUn8MCbtiAKB/2RddAtHE7B6QBl VZHg== 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 i23si2275526oto.206.2020.02.11.11.30.12; Tue, 11 Feb 2020 11:30:25 -0800 (PST) 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 S1730284AbgBKQyI (ORCPT + 99 others); Tue, 11 Feb 2020 11:54:08 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:55993 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727707AbgBKQyI (ORCPT ); Tue, 11 Feb 2020 11:54:08 -0500 Received: from 79.184.254.199.ipv4.supernova.orange.pl (79.184.254.199) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.341) id bf497f49ca41fc91; Tue, 11 Feb 2020 17:54:06 +0100 From: "Rafael J. Wysocki" To: Linux ACPI Cc: Linux PM , LKML , Zhang Rui , David Box , Chen Yu , "Rafael J. Wysocki" , Tsuchiya Yuto , Bob Moore , Erik Kaneda Subject: [PATCH 2/2] ACPI: PM: s2idle: Prevent spurious SCIs from waking up the system Date: Tue, 11 Feb 2020 17:53:52 +0100 Message-ID: <7099853.cFaFQmLQCt@kreacher> In-Reply-To: <6974889.tv0o8xEHfr@kreacher> References: <6974889.tv0o8xEHfr@kreacher> 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 If the platform triggers a spurious SCI even though the status bit is not set for any GPE when the system is suspended to idle, it will be treated as a genuine wakeup, so avoid that by checking if any GPEs are active at all before returning 'true' from acpi_s2idle_wake(). Link: https://bugzilla.kernel.org/show_bug.cgi?id=206413 Fixes: 56b991849009 ("PM: sleep: Simplify suspend-to-idle control flow") Reported-by: Tsuchiya Yuto Cc: 5.4+ # 5.4+ Signed-off-by: Rafael J. Wysocki --- drivers/acpi/sleep.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) Index: linux-pm/drivers/acpi/sleep.c =================================================================== --- linux-pm.orig/drivers/acpi/sleep.c +++ linux-pm/drivers/acpi/sleep.c @@ -1006,10 +1006,16 @@ static bool acpi_s2idle_wake(void) return true; /* - * If there are no EC events to process, the wakeup is regarded - * as a genuine one. + * If there are no EC events to process and at least one of the + * other enabled GPEs is active, the wakeup is regarded as a + * genuine one. + * + * Note that the checks below must be carried out in this order + * to avoid returning prematurely due to a change of the EC GPE + * status bit from unset to set between the checks with the + * status bits of all the other GPEs unset. */ - if (!acpi_ec_dispatch_gpe()) + if (acpi_any_gpe_status_set() && !acpi_ec_dispatch_gpe()) return true; /*