linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Furquan Shaikh <furquan@google.com>
To: robert.moore@intel.com, erik.schmauss@intel.com,
	rafael.j.wysocki@intel.com, Len Brown <lenb@kernel.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	devel@acpica.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	lv.zheng@intel.com, ericbakuladavis@gmail.com,
	mika.westerberg@linux.intel.com
Cc: Rajat Jain <rajatja@google.com>, Evan Green <evgreen@google.com>,
	Duncan Laurie <dlaurie@google.com>
Subject: Re: [PATCH] drivers/acpi: Clear status of an event before enabling it
Date: Wed, 20 Mar 2019 16:44:52 -0600	[thread overview]
Message-ID: <CAEGmHFH3FBwXZEwF_rH69dBYFQegFJgcxt+5HPL_9sM_4pg+=A@mail.gmail.com> (raw)
In-Reply-To: <20190320222844.134765-1-furquan@google.com>

Adding authors of the original commit whom I failed to copy in the
original patch.

On Wed, Mar 20, 2019 at 4:34 PM Furquan Shaikh <furquan@google.com> 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.
>
> In case of S0ix, events are enabled as part of device suspend path. If
> status bits for the events are set when they are enabled, it could
> result in premature wake from S0ix. This change ensures that status is
> cleared for any event that is being enabled so that any stale events
> are cleared out.
>
> Signed-off-by: Furquan Shaikh <furquan@google.com>
> ---
>  drivers/acpi/acpica/evgpe.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
> index 62d3aa74277b4..61455ab42fc87 100644
> --- a/drivers/acpi/acpica/evgpe.c
> +++ b/drivers/acpi/acpica/evgpe.c
> @@ -81,8 +81,12 @@ acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
>
>         ACPI_FUNCTION_TRACE(ev_enable_gpe);
>
> -       /* Enable the requested GPE */
> +       /* Clear the GPE (of stale events) */
> +       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);
>  }
> --
> 2.21.0.225.g810b269d1ac-goog
>

  reply	other threads:[~2019-03-20 22:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20 22:28 [PATCH] drivers/acpi: Clear status of an event before enabling it Furquan Shaikh
2019-03-20 22:44 ` Furquan Shaikh [this message]
2019-03-20 23:11 ` Rafael J. Wysocki
2019-03-21  2:16   ` Furquan Shaikh
2019-03-27 12:24     ` Rafael J. Wysocki
2019-03-28  0:46       ` Furquan Shaikh
2019-03-28  8:57         ` Rafael J. Wysocki
2019-03-28 23:48           ` Furquan Shaikh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEGmHFH3FBwXZEwF_rH69dBYFQegFJgcxt+5HPL_9sM_4pg+=A@mail.gmail.com' \
    --to=furquan@google.com \
    --cc=devel@acpica.org \
    --cc=dlaurie@google.com \
    --cc=ericbakuladavis@gmail.com \
    --cc=erik.schmauss@intel.com \
    --cc=evgreen@google.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rajatja@google.com \
    --cc=robert.moore@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).