Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp988995ybb; Thu, 28 Mar 2019 16:50:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJFSaAgqJDCjgQwkZ5KebOC46NUaXvqQtyGPEUZoJBTDM7AW/yKFO4ymWxucFKOOmr+XOm X-Received: by 2002:a17:902:f094:: with SMTP id go20mr22895316plb.159.1553817051730; Thu, 28 Mar 2019 16:50:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553817051; cv=none; d=google.com; s=arc-20160816; b=u8OReqE5hHQU75aAgUgQCOKLj6ykFINhjVsI9DOKenF6x86JmzXiB344rNs8QyclNQ 9zoZxbemULB5LvG/MmXlxamkwGEKwjsQSJ1P93nIhJxdaMn2YRn1Srrw4WnHQbz80NdJ zrruWVEnhtvGmLamL+MoKwDMritxkDOmxxAC/Sm3ZbpwJW1socuzgN9Lk+KvCyyl6dPI NeRu9/3KP/GUwlRY0HJBst8y0bTb9VtYL39dnFSLexhJk8DoS62iFixmCYu52K0TWtmy 1NZ3jeyFK0BRRN9yzGzGG98wD8VPRPm/hP+1EqWb6vWwKsWGu2OhUoeOYReDs42XX1vs 56ZA== 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:dkim-signature; bh=vrG0xVXFW6lpwZPzipOxZqZ/XiI7RlykZHu1woLN+7c=; b=goARLte0Gq5jiwmAMRfXU2/ucID+QP5WI6GnNT9ADg1YR4G3bqQw6MnVeg5BZyl1Vo t6JeKQR5WRKtyjMk3chxczzelY3Dd7lAvskqNxzMD9U1vwEEJUfDA1jZKI+79/tnTIC4 +GMZAaAmsJG5YB2Hfk7ATJJiuy+3uiuvdC1SRDYnbO4MrnSmm3j7pOAAxMXENffJLu59 Ds6zPW8mYDOjkYm+w/84msJkCel/Hh4dimJFgt09z6O3ZdBXJh10Sayds8uegIj1GVEF Tpzo9Qx1Ogxya8PhtrbCLLKPw26ZRsEzBdI995LBasKBrLOfVsWfAQlAeUlaxB56z2cN UNDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=kGyLsJRe; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5si472761pge.192.2019.03.28.16.50.35; Thu, 28 Mar 2019 16:50:51 -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=@google.com header.s=20161025 header.b=kGyLsJRe; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728690AbfC1Xsi (ORCPT + 99 others); Thu, 28 Mar 2019 19:48:38 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:37215 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727658AbfC1Xsh (ORCPT ); Thu, 28 Mar 2019 19:48:37 -0400 Received: by mail-it1-f195.google.com with SMTP id u65so1098959itc.2 for ; Thu, 28 Mar 2019 16:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vrG0xVXFW6lpwZPzipOxZqZ/XiI7RlykZHu1woLN+7c=; b=kGyLsJReFwopGKFWbTKr1bVsq/gGxA0wF323f1/btuYXdqKZ1cCxszrv3onUCdRIPz 0P5DKM4Dw7GoXdGN+OYw7UsuoyJiMQriZ2+DhbVRYDi83z3JuyVvnfLZbfLY8EH40sBs v0L8lUX131ZckJ06TuCrtJQE0ff84XJWDeihzx7VzQxPA4/CZ5w+EpFMk7oB+NR2sbds n89/PW7Y/O8fto6UUzWqFs/FiEyzvRvZJZiokIgL/d7wQLWXCWLT/uhHRvXUEtOLf+Yu TNWlA5Pp0m5VGS3nbpC/taEKBF8eVk8V5KOnFcrNxoO/oj0vLASOPvW67bgjRjSElcSq 00oA== 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=vrG0xVXFW6lpwZPzipOxZqZ/XiI7RlykZHu1woLN+7c=; b=SWpREFCbHxDDJaCxYoe95eJ6SEksms3hTurymWJgFPCcQFad8VGhUDbvm9ZTEF6H3Z KF9UTUtdDlhYc+SddBs5B3HSS6AIk+ZSdx9Xcui4cO90DoJran7ymxTrHGkTUhz6JN24 XKgREgDWpMjzwocGpA1IMJY7+jX7/6QlwRWSjY5azm6tOZfUfmhIR4yy22v9LdZVrul+ 84DOOtfPAyTEcVqDD/N6wVbnwtDy8+s+aI8988bXgUiF4CD3Bmme8z0Z1Bz7dhyL/OUD FihCeVnEDomujnlIF3vrTYUKXAbpT3e37tg0aVLPSwDrF4mpTfuxUBNZUjQC7VSg5X7B 5j3w== X-Gm-Message-State: APjAAAV9xUs15zqfGWeniTKiahE5b0uB/+/exsRMUjr50ws1jmHKULbo dTkpN6vKFt+LlLZUcfSXzUUZBWE6zN4YgwYomeMqmw== X-Received: by 2002:a24:c106:: with SMTP id e6mr2302037itg.21.1553816916536; Thu, 28 Mar 2019 16:48:36 -0700 (PDT) MIME-Version: 1.0 References: <20190320222844.134765-1-furquan@google.com> In-Reply-To: From: Furquan Shaikh Date: Thu, 28 Mar 2019 16:48:24 -0700 Message-ID: Subject: Re: [PATCH] drivers/acpi: Clear status of an event before enabling it To: "Rafael J. Wysocki" Cc: 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:57 AM Rafael J. Wysocki wrote: > > 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? That is correct. > > 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). Thank you! > > Thanks!