Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2475728yba; Mon, 15 Apr 2019 12:25:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxU4NV4ys2i2p77DpxrnOOPhOxQTUT0EEzQy1JpBPFau5EipOPtjRh7hm6UilYlKocWrf6E X-Received: by 2002:a62:ac08:: with SMTP id v8mr76623132pfe.42.1555356350764; Mon, 15 Apr 2019 12:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555356350; cv=none; d=google.com; s=arc-20160816; b=DjJ6GWdZIRVg4sRROXETzjL6KFbJ5WSaF+Co275Krke6HpbBpieK1+0QljQpUZ1/jw /rqFDThd+iAtNYjB3M5WY77WWZo632D3iaFD/MZPSN4xCZhgO8YPZHhbhyf9rabomBlz vx7YhIf1IS6LtNj/Vanjj+dHdOQJzLui2Fd45yX5lhlgRUsDUrZchLfvBRdRclR6pSf5 6/WtH0vpZb0hoetcNmE+sCHL1D+p2DgnrT9A5vOGJunGk41d2SPRoqhJC7A0D0P+NQ64 zWtjQzUUX6NDpb9ZtYmZZrbiKml7I1I0jl/Ml7tK9UfPL0Q6PeCX+vd/ceNrKCkJzNJC 5S5A== 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=6HyyVS7uRN5uIftxH6El0GlMpodq5xZyVvW5nXuf1jI=; b=brm0K2D3cUkz+Kxva6zr8YCQ9aaeBBHbO2iLMg0paZPpsFIk6R1AwJ69S7X0JBwysP 9GyrlN2y0GWnYcAQIf708ckeSRMjN4mcVOBiamDSdD7iRNf7vcyZcDV97aemZ68a2gEo 3257+Gog2RwSHQJsvOsfydrvyTDJIFv4MqgqBJvBa1HMvp3v09p3eh4S/FZVGK/puJh5 sYCRK/IyMWGAL0XS2DUPMpNANTwDrg0ibwAH+JSxoryycENuZX6RAuB2kZXWHmAr0ZYw ddggNVvumWxUL4evuBS5cXrHY3tIjApUnfPVK0q8P8dtvtNtXO7cX/F8oKPpJ2Wo7m7e k8MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QHw5NjF1; 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 q3si45360924pff.61.2019.04.15.12.25.34; Mon, 15 Apr 2019 12:25:50 -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; dkim=pass header.i=@kernel.org header.s=default header.b=QHw5NjF1; 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 S1728883AbfDOTGf (ORCPT + 99 others); Mon, 15 Apr 2019 15:06:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:41046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729195AbfDOTGd (ORCPT ); Mon, 15 Apr 2019 15:06:33 -0400 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 A1609218A1; Mon, 15 Apr 2019 19:06:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555355193; bh=2+KnyX2t/iFfamUdZsdmEI/4ufLoDglksusPnBnZhJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QHw5NjF1mJZnt264Xb4XZJN/32D19Qj+OC8RiqUb0r8KLkiaMWXL2oyHQX7vL22zV qBaAOAH49Few3Qg9/9OllfIjzJCsiR+Wl1IeBicYiYBrhd5pl5Xk9m2tVzJzxKncf5 tGIY8YQQe5HNYdo7C8QLPM87x3/x/LR10lTjU56s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Furquan Shaikh , "Rafael J. Wysocki" Subject: [PATCH 4.19 048/101] ACPICA: Clear status of GPEs before enabling them Date: Mon, 15 Apr 2019 20:58:46 +0200 Message-Id: <20190415183743.116160326@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183740.341577907@linuxfoundation.org> References: <20190415183740.341577907@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: Furquan Shaikh commit c8b1917c8987a6fa3695d479b4d60fbbbc3e537b upstream. Commit 18996f2db918 ("ACPICA: Events: Stop unconditionally clearing ACPI IRQs during suspend/resume") was added to stop clearing event status bits unconditionally in the system-wide suspend and resume paths. This was done because of an issue with a laptop lid appaering to be closed even when it was used to wake up the system from suspend (see https://bugzilla.kernel.org/show_bug.cgi?id=196249), which happened because event status bits were cleared unconditionally on system resume. Though this change fixed the issue in the resume path, it introduced regressions in a few suspend paths. First regression was reported and fixed in the S5 entry path by commit fa85015c0d95 ("ACPICA: Clear status of all events when entering S5"). Next regression was reported and fixed for all legacy sleep paths by commit f317c7dc12b7 ("ACPICA: Clear status of all events when entering sleep states"). However, there still is a suspend-to-idle regression, since suspend-to-idle does not follow the legacy sleep paths. In the suspend-to-idle case, wakeup is enabled as part of device suspend. If the status bits of wakeup GPEs are set when they are enabled, it causes a premature system wakeup to occur. To address that problem, partially revert commit 18996f2db918 to restore GPE status bits clearing before the GPE is enabled in acpi_ev_enable_gpe(). Fixes: 18996f2db918 ("ACPICA: Events: Stop unconditionally clearing ACPI IRQs during suspend/resume") Signed-off-by: Furquan Shaikh Cc: 4.17+ # 4.17+ [ rjw: Subject & changelog ] Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/acpica/evgpe.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/acpi/acpica/evgpe.c +++ b/drivers/acpi/acpica/evgpe.c @@ -81,8 +81,12 @@ acpi_status acpi_ev_enable_gpe(struct ac ACPI_FUNCTION_TRACE(ev_enable_gpe); - /* Enable the requested GPE */ + /* Clear the GPE status */ + status = acpi_hw_clear_gpe(gpe_event_info); + if (ACPI_FAILURE(status)) + return_ACPI_STATUS(status); + /* Enable the requested GPE */ status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_ENABLE); return_ACPI_STATUS(status); }