All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] platform/chrome: cros_ec: Always expose last resume result
@ 2022-06-14  7:57 Stephen Boyd
  2022-06-14  8:20 ` patchwork-bot+chrome-platform
  2022-06-16  8:10 ` patchwork-bot+chrome-platform
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Boyd @ 2022-06-14  7:57 UTC (permalink / raw)
  To: Benson Leung
  Cc: linux-kernel, patches, Guenter Roeck, chrome-platform,
	Rajat Jain, Matthias Kaehlcke, Hsin-Yi Wang, Tzung-Bi Shih,
	Evan Green

The last resume result exposing logic in cros_ec_sleep_event()
incorrectly requires S0ix support, which doesn't work on ARM based
systems where S0ix doesn't exist. That's because cros_ec_sleep_event()
only reports the last resume result when the EC indicates the last sleep
event was an S0ix resume. On ARM systems, the last sleep event is always
S3 resume, but the EC can still detect sleep hang events in case some
other part of the AP is blocking sleep.

Always expose the last resume result if the EC supports it so that this
works on all devices regardless of S0ix support. This fixes sleep hang
detection on ARM based chromebooks like Trogdor.

Cc: Rajat Jain <rajatja@chromium.org>
Cc: Matthias Kaehlcke <mka@chromium.org>
Cc: Hsin-Yi Wang <hsinyi@chromium.org>
Cc: Tzung-Bi Shih <tzungbi@kernel.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Evan Green <evgreen@chromium.org>
Fixes: 7235560ac77a ("platform/chrome: Add support for v1 of host sleep event")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---

Changes from v2 (https://lore.kernel.org/r/20220611061825.4119270-1-swboyd@chromium.org):
 * Change slp_s0 to sleep in warning message

Changes from v1 (https://lore.kernel.org/r/20220610223703.3387691-1-swboyd@chromium.org):
 * Fixed typo

 drivers/platform/chrome/cros_ec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
index b3e94cdf7d1a..00381490dd3e 100644
--- a/drivers/platform/chrome/cros_ec.c
+++ b/drivers/platform/chrome/cros_ec.c
@@ -135,16 +135,16 @@ static int cros_ec_sleep_event(struct cros_ec_device *ec_dev, u8 sleep_event)
 	buf.msg.command = EC_CMD_HOST_SLEEP_EVENT;
 
 	ret = cros_ec_cmd_xfer_status(ec_dev, &buf.msg);
-
-	/* For now, report failure to transition to S0ix with a warning. */
+	/* Report failure to transition to system wide suspend with a warning. */
 	if (ret >= 0 && ec_dev->host_sleep_v1 &&
-	    (sleep_event == HOST_SLEEP_EVENT_S0IX_RESUME)) {
+	    (sleep_event == HOST_SLEEP_EVENT_S0IX_RESUME ||
+	     sleep_event == HOST_SLEEP_EVENT_S3_RESUME)) {
 		ec_dev->last_resume_result =
 			buf.u.resp1.resume_response.sleep_transitions;
 
 		WARN_ONCE(buf.u.resp1.resume_response.sleep_transitions &
 			  EC_HOST_RESUME_SLEEP_TIMEOUT,
-			  "EC detected sleep transition timeout. Total slp_s0 transitions: %d",
+			  "EC detected sleep transition timeout. Total sleep transitions: %d",
 			  buf.u.resp1.resume_response.sleep_transitions &
 			  EC_HOST_RESUME_SLEEP_TRANSITIONS_MASK);
 	}

base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56
-- 
https://chromeos.dev


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

* Re: [PATCH v3] platform/chrome: cros_ec: Always expose last resume result
  2022-06-14  7:57 [PATCH v3] platform/chrome: cros_ec: Always expose last resume result Stephen Boyd
@ 2022-06-14  8:20 ` patchwork-bot+chrome-platform
  2022-06-16  8:10 ` patchwork-bot+chrome-platform
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+chrome-platform @ 2022-06-14  8:20 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: bleung, linux-kernel, patches, groeck, chrome-platform, rajatja,
	mka, hsinyi, tzungbi, evgreen

Hello:

This patch was applied to chrome-platform/linux.git (for-kernelci)
by Tzung-Bi Shih <tzungbi@kernel.org>:

On Tue, 14 Jun 2022 00:57:26 -0700 you wrote:
> The last resume result exposing logic in cros_ec_sleep_event()
> incorrectly requires S0ix support, which doesn't work on ARM based
> systems where S0ix doesn't exist. That's because cros_ec_sleep_event()
> only reports the last resume result when the EC indicates the last sleep
> event was an S0ix resume. On ARM systems, the last sleep event is always
> S3 resume, but the EC can still detect sleep hang events in case some
> other part of the AP is blocking sleep.
> 
> [...]

Here is the summary with links:
  - [v3] platform/chrome: cros_ec: Always expose last resume result
    https://git.kernel.org/chrome-platform/c/74bb746407bf

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH v3] platform/chrome: cros_ec: Always expose last resume result
  2022-06-14  7:57 [PATCH v3] platform/chrome: cros_ec: Always expose last resume result Stephen Boyd
  2022-06-14  8:20 ` patchwork-bot+chrome-platform
@ 2022-06-16  8:10 ` patchwork-bot+chrome-platform
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+chrome-platform @ 2022-06-16  8:10 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: bleung, linux-kernel, patches, groeck, chrome-platform, rajatja,
	mka, hsinyi, tzungbi, evgreen

Hello:

This patch was applied to chrome-platform/linux.git (for-next)
by Tzung-Bi Shih <tzungbi@kernel.org>:

On Tue, 14 Jun 2022 00:57:26 -0700 you wrote:
> The last resume result exposing logic in cros_ec_sleep_event()
> incorrectly requires S0ix support, which doesn't work on ARM based
> systems where S0ix doesn't exist. That's because cros_ec_sleep_event()
> only reports the last resume result when the EC indicates the last sleep
> event was an S0ix resume. On ARM systems, the last sleep event is always
> S3 resume, but the EC can still detect sleep hang events in case some
> other part of the AP is blocking sleep.
> 
> [...]

Here is the summary with links:
  - [v3] platform/chrome: cros_ec: Always expose last resume result
    https://git.kernel.org/chrome-platform/c/74bb746407bf

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-06-16  8:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-14  7:57 [PATCH v3] platform/chrome: cros_ec: Always expose last resume result Stephen Boyd
2022-06-14  8:20 ` patchwork-bot+chrome-platform
2022-06-16  8:10 ` patchwork-bot+chrome-platform

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.