Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6210936ybv; Tue, 18 Feb 2020 12:06:23 -0800 (PST) X-Google-Smtp-Source: APXvYqx0PyQhc87OTIKRQpXk0rbsEBZWmDUJ/tGdlz3zTL2X416gvIYIzcDreiTah3vOHPYg2ZVA X-Received: by 2002:a05:6830:160c:: with SMTP id g12mr12759356otr.82.1582056383506; Tue, 18 Feb 2020 12:06:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582056383; cv=none; d=google.com; s=arc-20160816; b=l7+IIR6wP4boql2wtQoPZpd2K8kJuUrOaNZb2utucilfBwKmoeAUyBZCIcI/dlSp6H jOS0ANhn2z9/G53gB1EzSkwpJjZAROOuzhdpF4PbTLMUpB0U8sXprida4JsHcJ97JLq1 Oy/lNpmkWMgovcawSoAMMAtE8HMfVuqGbO16pUtlurVVEwaiQTdnNykrsq2BPhjtQ/3J 8y6xPEq5SGeYlqHPtnKG9X5fh8sJ+1V91va/jRPfILj/FLrvKCx9kBddj2BTSnObOGIe mpwmgDF8/8pLm420e9lmlSys5Geo2D9zwNyA6LMNdt/6zNzbOILysKXrLBkXpHi2xwmV v+Hg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=St6XPCT3K8wDL/AT0pLRhVqeP/vvZ5d73oUAGFFdNq4=; b=VCbuXxdaqubQDijwh6E+EcJSNXXvjS5dfuJnfmSRwr0FiEn8IK7goGmGyk70r7MKPl TcAMYBZgScUVaQfiMvNY7xGDxxsGr7Y+RBW6/+5YzfT0xK8LdjdE2vDv4KwmQMlYrz4u wsiebJiNPsDtxCBmLvN+hZdgfiH3gpWeujvg89XdVJSRSnmTl4FYm4IJRXApkB6PSTf1 2QmgkpebnaCd7+LzZ2sKUEHTcOxozRGBCTZ1O/isvoh42Yn4ZXFyui8AQTjML/gPZOL+ 8rhdEk4J3HjNe4v0uQTGc9Aimor11PitOOT7sbGseomSvWyz9HEjKAGlWcTKj6O2AU6+ ZqrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JnCxz2Px; 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 k128si8544054oih.274.2020.02.18.12.06.11; Tue, 18 Feb 2020 12:06:23 -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; dkim=pass header.i=@kernel.org header.s=default header.b=JnCxz2Px; 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 S1728668AbgBRUAv (ORCPT + 99 others); Tue, 18 Feb 2020 15:00:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:40166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728660AbgBRUAs (ORCPT ); Tue, 18 Feb 2020 15:00:48 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C4C6E24125; Tue, 18 Feb 2020 20:00:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582056048; bh=0CiL0ngTLIrsFbDJVGFNrI71BflXTKRxxmu1f1m5Yew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JnCxz2Px478OGpR6JO7fGThcND/Ahwu8IgxoR7fPzn6rL77igdvW8mmzkVAnkrmrn OUfEl3Sh7cv7qJDhz1D4faIQ6NWawdGIIiGBcqh+WTOaJQIv4d5pwlU60A9eRJqBlP RTf1oyf3earWuM3CE/l0sSFl0Mu9lJlMvflrOjmQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tsuchiya Yuto , "Rafael J. Wysocki" Subject: [PATCH 5.5 15/80] ACPI: PM: s2idle: Prevent spurious SCIs from waking up the system Date: Tue, 18 Feb 2020 20:54:36 +0100 Message-Id: <20200218190433.549986040@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200218190432.043414522@linuxfoundation.org> References: <20200218190432.043414522@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki commit fdde0ff8590b4c1c41b3227f5ac4265fccccb96b upstream. 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 Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/sleep.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -1003,10 +1003,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; /*