All of lore.kernel.org
 help / color / mirror / Atom feed
* mfd: cros_ec: Check for mkbp events on resume only if supported.
@ 2018-08-20 15:34 ` RaviChandra Sadineni
  2018-08-21  7:28   ` Marek Szyprowski
  2018-09-10 14:37   ` Lee Jones
  0 siblings, 2 replies; 3+ messages in thread
From: RaviChandra Sadineni @ 2018-08-20 15:34 UTC (permalink / raw)
  To: lee.jones, dmitry.torokhov, ravisadineni, ravisadineni, dtor,
	linux-samsung-soc, tbroch, linux-kernel, linux-input, tfiga,
	m.szyprowski

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: mfd: cros_ec: Check for mkbp events on resume only if supported.
  2018-08-20 15:34 ` mfd: cros_ec: Check for mkbp events on resume only if supported RaviChandra Sadineni
@ 2018-08-21  7:28   ` Marek Szyprowski
  2018-09-10 14:37   ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Marek Szyprowski @ 2018-08-21  7:28 UTC (permalink / raw)
  To: RaviChandra Sadineni, lee.jones, dmitry.torokhov, ravisadineni,
	dtor, linux-samsung-soc, tbroch, linux-kernel, linux-input,
	tfiga

Hi Ravi,

On 2018-08-20 17:34, RaviChandra Sadineni wrote:
> 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>

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>

> ---
>
>   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);
>   }

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mfd: cros_ec: Check for mkbp events on resume only if supported.
  2018-08-20 15:34 ` mfd: cros_ec: Check for mkbp events on resume only if supported RaviChandra Sadineni
  2018-08-21  7:28   ` Marek Szyprowski
@ 2018-09-10 14:37   ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2018-09-10 14:37 UTC (permalink / raw)
  To: RaviChandra Sadineni
  Cc: dmitry.torokhov, ravisadineni, dtor, linux-samsung-soc, tbroch,
	linux-kernel, linux-input, tfiga, m.szyprowski

On Mon, 20 Aug 2018, RaviChandra Sadineni wrote:

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

Applied, thanks.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-10 14:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20180820153427epcas3p366f998ada5f2f37f1198a1321e9e10be@epcas3p3.samsung.com>
2018-08-20 15:34 ` mfd: cros_ec: Check for mkbp events on resume only if supported RaviChandra Sadineni
2018-08-21  7:28   ` Marek Szyprowski
2018-09-10 14:37   ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.