Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2471082yba; Mon, 15 Apr 2019 12:19:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4W98wtwFXXrACcuXEg3FxV8d3/S47nkXR/6QWcf+gEh8/1IuQ9MXqPJHU0Ji+Sx/sSVg7 X-Received: by 2002:a17:902:e110:: with SMTP id cc16mr77849621plb.147.1555355965965; Mon, 15 Apr 2019 12:19:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555355965; cv=none; d=google.com; s=arc-20160816; b=Uq1eKP36zWWIvPfNxAIyEyegaLA+b5AMt/6Arl352DBk0iI93MqzLnYqjGrsiwKvSC cKiYEeYG8/nymczzhCB6wx5Hy3vfKn3qM1Mxx6S+emEMTO2olcMcEFn5VgNwoQlzFKXh ehiHuLPOw7q42ffDocoyOKPWOr2E/Q5DKWnB7LrNtVlu42rRS4MpTiXcCskF54x113L6 hmlCmS1MwJN3PtPKXs8P91Uu7UnSPHyj1jQmMnqc428eDdpmNspV4Xk2W0ze3D4nACTU /5PQikEV2l3KvFEPtYI6dvgF6LJi7HD6OmjkVi2Vv5/abJ0m6hm3m1LxD+4KRdloFkHC qwow== 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=LTP6JDEx5YknNnZj1iWjwRLKBOFbhTPFiwtm3I83YsZIoW1hZDBk3hQW9kB+rqgFcn pjkT6MAuZhwwaNFv72BBRTaZsEJ8VotUDVNxTk9TqbJUMzrXJGsKDSvm96ZwOgj6yJLT Hn0LnrWuIJLJs5JEnr6tQUEiE3dhxiLcudjM3LhVHSOXqmvWgBxiVerqePvd8B3/pBVi voHZZ+4VVusz8CXVbbEFcQIdpb2zhIGVAqZhv59Dg2qMkYckgZC2y5aRkldjNFgvafwy V+IT+nPpcTLfKUguPjM+AaiYe04eVWLwhPpC8hYATvZwDFHtQmGNvdHxAzZqzeZA/tVK uZPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TVBlA+4i; 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 e14si46525101pff.76.2019.04.15.12.19.09; Mon, 15 Apr 2019 12:19:25 -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=TVBlA+4i; 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 S1731706AbfDOTRu (ORCPT + 99 others); Mon, 15 Apr 2019 15:17:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:49148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731318AbfDOTL6 (ORCPT ); Mon, 15 Apr 2019 15:11:58 -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 2652321908; Mon, 15 Apr 2019 19:11:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555355517; bh=2+KnyX2t/iFfamUdZsdmEI/4ufLoDglksusPnBnZhJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TVBlA+4iFQAEicuw79qfw5sjm/XjLE96bzLP1k6xAI4ZDOTbuKliCmqY+p4NleHzu vGs7RlxguWAxougscjSkBltk/phLlcv6OkavWjTJXyNMS570ap0Rd2UMSfhVdPQVVI e4aVJQ8XO3oZ4pacic6vtYkaKQoIn10ElZe2XI8w= 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 5.0 051/117] ACPICA: Clear status of GPEs before enabling them Date: Mon, 15 Apr 2019 21:00:21 +0200 Message-Id: <20190415183747.563797571@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183744.887851196@linuxfoundation.org> References: <20190415183744.887851196@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); }