linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: RaviChandra Sadineni <ravisadineni@chromium.org>
To: lee.jones@linaro.org, dmitry.torokhov@gmail.com,
	ravisadineni@chromium.org, ravisadineni@google.com,
	dtor@google.com, linux-samsung-soc@vger.kernel.org,
	tbroch@google.com, linux-kernel@vger.kernel.org,
	linux-input@vger.kernel.org, tfiga@chromium.org,
	m.szyprowski@samsung.com
Subject: mfd: cros_ec: Check for mkbp events on resume only if supported.
Date: Mon, 20 Aug 2018 08:34:19 -0700	[thread overview]
Message-ID: <20180820153419.32098-1-ravisadineni@google.com> (raw)

Currently on every resume we check for mkbp events and notify the
clients. This helps in identifying the wakeup sources. But on devices
that do not support mkbp protocol, we might end up querying key state of
the keyboard in a loop which blocks the resume. Instead check for events
only if mkbp is supported.

Signed-off-by: RaviChandra Sadineni <ravisadineni@chromium.org>
---

 Note: This patch fixes the suspend/resume issue on Snow and Peach-Pit
 Chromebooks, both on vanilla v4.18 as well as linux-next from 20 August 
 2018. Further info at: https://lkml.org/lkml/2018/6/5/1076
 
 drivers/mfd/cros_ec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c
index 65a9757a6d21..fe6f83766144 100644
--- a/drivers/mfd/cros_ec.c
+++ b/drivers/mfd/cros_ec.c
@@ -218,7 +218,8 @@ EXPORT_SYMBOL(cros_ec_suspend);
 
 static void cros_ec_report_events_during_suspend(struct cros_ec_device *ec_dev)
 {
-	while (cros_ec_get_next_event(ec_dev, NULL) > 0)
+	while (ec_dev->mkbp_event_supported &&
+	       cros_ec_get_next_event(ec_dev, NULL) > 0)
 		blocking_notifier_call_chain(&ec_dev->event_notifier,
 					     1, ec_dev);
 }
-- 
2.16.4


             reply	other threads:[~2018-08-20 15:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180820153427epcas3p366f998ada5f2f37f1198a1321e9e10be@epcas3p3.samsung.com>
2018-08-20 15:34 ` RaviChandra Sadineni [this message]
2018-08-21  7:28   ` mfd: cros_ec: Check for mkbp events on resume only if supported Marek Szyprowski
2018-09-10 14:37   ` Lee Jones

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=20180820153419.32098-1-ravisadineni@google.com \
    --to=ravisadineni@chromium.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dtor@google.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=ravisadineni@google.com \
    --cc=tbroch@google.com \
    --cc=tfiga@chromium.org \
    /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).