Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp263917ybb; Thu, 28 Mar 2019 01:58:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzo0f2H+azmQyFnEi9rubcgIFJH3MUA3cVscD8xEKPNQENdLiqYMIeeDKLYtnOFzzRcLt2L X-Received: by 2002:a65:60ca:: with SMTP id r10mr38999457pgv.429.1553763507703; Thu, 28 Mar 2019 01:58:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553763507; cv=none; d=google.com; s=arc-20160816; b=apGydO1OJB7bjorsHYr9jTlv6VUxJI678mA6Ow8zV0CV5tgmyalBEWrs6Sh8KaoHIL FZDVTJisZ8wKYQsWy8VezKEhmSgwRWoeL1O3Psx4M7ttuiT+GNz62MydlB2XRvL6GyfX 06hWs41hZp55gojD0YkMNUaKm7Qr+zbpZ3mqzogUXbVT40vV3Z17NO1CU5PCu9A/m5JX IN21JpjFV6f8+vDnXBnSiTtjjQD9aLXV/DslHJ1fUWwvawvmcYu78gIOY3kcL/JTZKAH bVdMWGYt73g4CP6Po3tQ2eQuvUhLMhMYsD9hooLWOG54DfHXpjsclpHGzLnAApqSfkL/ SByw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=EROZdJfd6EE6W9XxTLeEb7P+1vhW3cEkXb4ZBDypzdY=; b=wH9vvdl9UvQYYepeEkwlSEqtQxHM58kzAqgdx499Vssk/H+eef+sHMvnp3uRzWcDfY 7zaFRAnjPN8/MCjJfICKQ8uD10bWSRDchszM1Nb5zSjTvsc/FeCz4OI1Xk8YVNLWXYap AIZBCQcLYeoYqYCg9mH3jLsyw6KtP7md1b7vUX+3fIMdZtg1CU0rgLQZgaxYneTdDXmp mHveevTKMruaO/SpWpPtfukIAU9S8pevSnWmJEIAlv1G9THM+1ws69kLiSGuPRo+ENKM KEV5rFYvywrJHzuLiseL4jAiGvYbsxMJhRFrhtlgIBOo2d48J8vvAnljfDv7EbkLy0y3 YKnQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si5633893pgq.129.2019.03.28.01.58.11; Thu, 28 Mar 2019 01:58:27 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726476AbfC1I5b (ORCPT + 99 others); Thu, 28 Mar 2019 04:57:31 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:42702 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726136AbfC1I5b (ORCPT ); Thu, 28 Mar 2019 04:57:31 -0400 Received: by mail-ot1-f68.google.com with SMTP id 103so17576860otd.9; Thu, 28 Mar 2019 01:57:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EROZdJfd6EE6W9XxTLeEb7P+1vhW3cEkXb4ZBDypzdY=; b=N/U4PtzzK2++sDcyLgaRGEyYfJdR2jxcTmrHMSeUera4VkVEgvNq5StoBxfTEapEqZ e9tAfrfpLVLIs+mPROhfBFxPfNt/E42tBCsdpUbw+HB0DwK3Zrl7Vhjifjwnux9IEmVF U0YvfX7f9xD00HsqAqd/x/Oqi0/04m8hSAdTHC3CQ2o7vnCmJdF6e6njQSxhjWhbS7KZ tkvy98ki0IR0+YKSgIfwUQLrZjTsQfVhQakRnTLfTtErbbY2FXJMzmBrJzQbi04JO9tv 8VJAQeQsJTGNJ/Um/qA/o4o/UQaCuORslR9XDstbccsuhlMjGRPpGxNUGVpeyXm48ixu HQ5Q== X-Gm-Message-State: APjAAAXqhVJ9Ve8eP5ywzJzihgw4In1cPAdZw/vSfa+4feVnuFjSEoT5 oloxeUGRHV6Eml+UFUg78i1x7k4agTec8Y5xSbE= X-Received: by 2002:a9d:6498:: with SMTP id g24mr30755915otl.343.1553763450279; Thu, 28 Mar 2019 01:57:30 -0700 (PDT) MIME-Version: 1.0 References: <20190320222844.134765-1-furquan@google.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Thu, 28 Mar 2019 09:57:18 +0100 Message-ID: Subject: Re: [PATCH] drivers/acpi: Clear status of an event before enabling it To: Furquan Shaikh Cc: "Rafael J. Wysocki" , Robert Moore , "Schmauss, Erik" , Rafael Wysocki , Len Brown , ACPI Devel Maling List , devel@acpica.org, Linux Kernel Mailing List , Rajat Jain , Evan Green , Duncan Laurie Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 28, 2019 at 1:46 AM Furquan Shaikh wrote: > > On Wed, Mar 27, 2019 at 5:24 AM Rafael J. Wysocki wrote: > > > > On Thu, Mar 21, 2019 at 3:16 AM Furquan Shaikh wrote: > > > > > > On Wed, Mar 20, 2019 at 5:11 PM Rafael J. Wysocki wrote: > > > > > > > > On Wed, Mar 20, 2019 at 11:34 PM Furquan Shaikh wrote: > > > > > > > > > > Commit 18996f2db918 ("ACPICA: Events: Stop unconditionally > > > > > clearing ACPI IRQs during suspend/resume") was added to stop clearing > > > > > of event status bits unconditionally on suspend and resume paths. This > > > > > was done because of an issue > > > > > reported (https://bugzilla.kernel.org/show_bug.cgi?id=196249) where > > > > > lid status stays closed even on resume (which happens because event > > > > > status bits are cleared unconditionally on resume). Though this change > > > > > fixed the issue on suspend path, it introduced regressions on several > > > > > resume paths. > > > > > > > > > > First regression was reported and fixed on S5 path by the following > > > > > change: commit fa85015c0d95 ("ACPICA: Clear status of all events when > > > > > entering S5"). Next regression was reported and fixed on all legacy > > > > > sleep paths by the commit f317c7dc12b7 ("ACPICA: Clear status of all > > > > > events when entering sleep states"). However, regression still exists > > > > > on S0ix sleep path since it does not follow the legacy sleep path. > > > > > > > > What exactly is failing? > > > > > > Here is the failure scenario: > > > > > > 1. Consider the case of trackpad which acts as a wake source. > > > 2. Since the pad is configured for SCI, GPE_STS gets set for that pad > > > during normal interrupts as well (i.e. during probe at boot or when > > > using the trackpad) > > > > I don't quite understand this. > > > > Is the same GPE used for signaling trackpad events in the system > > working state and for wakeup? > > Yes. The same pad is being configured for interrupts (i.e. routed to > APIC) during S0 as well as configured for GPE (i.e. routed for SCI) to > cause wakes when in S0ix/S3. This pad is externally connected to > trackpad interrupt line. And the way the system is wired up causes the GPE status to be set when it is enabled, I suppose? So effectively, you need to disable the active-state IRQ, then clear the GPE status and enable it for wakeup. OK, I'll queue up the patch (and talk to the upstream ACPICA people about taking it in there). Thanks!