Skip to contentSkip to conversation

mfd: cros_ec: Check for mkbp events on resume only if supported.

PATCH Applied RaviChandra Sadineni 3 participants 3 messages Aug 20, 2018 – Sep 10, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore 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.

---

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(-)
drivers/mfd/cros_ec.c +2 -1
index 65a9757a6d21..fe6f83766144 100644
@@ -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);
 }
Signature · 1 line
2.16.4
#1 lore raw

Hi Ravi,

Quoted 7 lines · RaviChandra Sadineni

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.

Quoted 14 lines

---

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(-)
drivers/mfd/cros_ec.c +0 -0
index 65a9757a6d21..fe6f83766144 100644

drivers/mfd/cros_ec.c EXPORT_SYMBOL(cros_ec_suspend); · line 225

Quoted 9 lines
drivers/mfd/cros_ec.c +2 -1
@@ -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);
  }

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland
Applied
#2 lore raw
In reply to RaviChandra Sadineni
Quoted 7 lines · RaviChandra Sadineni

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.

Quoted 8 lines

---

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(-)

Applied, thanks.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog