Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6203262ybv; Tue, 18 Feb 2020 11:58:48 -0800 (PST) X-Google-Smtp-Source: APXvYqz7IcJ2ktJadYcPW9wXIAJSsLfCsaImq4epzFAywhfaKZsOWx9ljmtg7qAf6f55YgUEMB4/ X-Received: by 2002:a9d:51c1:: with SMTP id d1mr16118177oth.136.1582055928701; Tue, 18 Feb 2020 11:58:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582055928; cv=none; d=google.com; s=arc-20160816; b=PR0HwC4VynFOLSk+TAcaDBtTwplx5iEAM0waWTcgu7NeQy9juj1HbJKk5tnXF+9wnJ M6eM6rc7m+8ow8sweZizS9uFcO8w0BxKFXHAaNAl4Lzn1RBiN9eo969N43r3HwTrBlTo 8BgEYq8M3O9hTzIt6W0rN9YVNMxz4ZZjq+Tod1ZlPkrVbgo8LKCx5J3a8yaLTQActekd pkRjMImq4qfIkj985fwnJMXJE+vR2UlybCxcChPNO6mJu2z0FfwSSHqGqvasVhnbrwwC zOoz/UNgagk9IQ+HF9nEe2R/A65KmHkGrhJlzSOadxh60uEh8r6HFgEVysVlOcKxK650 BBmg== 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=TI7ByTGwNDjLYhArDP/mpKIK3uvzL9KTGQa+vjdWOps=; b=kZcBLN6en7vUtXVDTuhRFrRqut7T9umZ/9jLyYJyS+B85cwESwzQG5ySb1YDBTISaw UknwN8yPlkZx8mBSib5NUGTh1j9sTxFgXFj/u1i4eisiZQlmofURKE1ZQrFzlUmtuVu0 ouYFUHlDzUsOBZdxvH2coXqYmnG/M4q991Q7dNnD2GkO3Y2OEbj07jkj2I53BQW2vb5a V1HaS+w+VHAlyeVdCLF6WTQw7NXwC/rdoOtPZQo8XHT/ZH0rZWWAv/9qMOg0FnanlEX3 Xz6z92My1MXUUvS5c0lAZkht2BSkrBOmZgNlrLfCsqAZFuQAkZvWek8kSwHTyIEGcLyF E5uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vQyz768Z; 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 w1si682084oih.173.2020.02.18.11.58.36; Tue, 18 Feb 2020 11:58:48 -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=vQyz768Z; 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 S1727313AbgBRT6G (ORCPT + 99 others); Tue, 18 Feb 2020 14:58:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:35514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728107AbgBRT6C (ORCPT ); Tue, 18 Feb 2020 14:58:02 -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 A05D920659; Tue, 18 Feb 2020 19:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582055882; bh=tiQFygU+6caMUo6KTU6OL9ZWBmUqQI7c5sgTqloa6go=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vQyz768ZirPniDhX4iG7UwUiPnZshwzGo1lXtMv8NbPKxf+FJYaTXIZBhzJOlD4/F ZNGwT8ePV6VHTakK4eTrzUbZe561Zi6LVWaDOjKhSu7YZHkx4/Gk1buH/4gPRtPah4 2fqZ2DnCYgmNXr72MWccFlaLUWB9o+JdjYZ9g3G0= 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.4 11/66] ACPI: PM: s2idle: Prevent spurious SCIs from waking up the system Date: Tue, 18 Feb 2020 20:54:38 +0100 Message-Id: <20200218190429.147740614@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200218190428.035153861@linuxfoundation.org> References: <20200218190428.035153861@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 @@ -993,10 +993,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; /*