* [PATCH v2] chrome/cros_ec: Handle events during suspend after resume completion
@ 2024-04-29 18:13 Karthikeyan Ramasubramanian
2024-04-30 1:40 ` patchwork-bot+chrome-platform
2024-04-30 1:40 ` patchwork-bot+chrome-platform
0 siblings, 2 replies; 3+ messages in thread
From: Karthikeyan Ramasubramanian @ 2024-04-29 18:13 UTC (permalink / raw)
To: LKML
Cc: Karthikeyan Ramasubramanian, stable, Lalith Rajendran,
chrome-platform, Benson Leung, Guenter Roeck, Tzung-Bi Shih
Commit 47ea0ddb1f56 ("platform/chrome: cros_ec_lpc: Separate host
command and irq disable") re-ordered the resume sequence. Before that
change, cros_ec resume sequence is:
1) Enable IRQ
2) Send resume event
3) Handle events during suspend
After commit 47ea0ddb1f56 ("platform/chrome: cros_ec_lpc: Separate host
command and irq disable"), cros_ec resume sequence is:
1) Enable IRQ
2) Handle events during suspend
3) Send resume event.
This re-ordering leads to delayed handling of any events queued between
items 2) and 3) with the updated sequence. Also in certain platforms, EC
skips triggering interrupt for certain events eg. mkbp events until the
resume event is received. Such events are stuck in the host event queue
indefinitely. This change puts back the original order to avoid any
delay in handling the pending events.
Fixes: 47ea0ddb1f56 ("platform/chrome: cros_ec_lpc: Separate host command and irq disable")
Cc: stable@vger.kernel.org
Cc: Lalith Rajendran <lalithkraj@chromium.org>
Cc: chrome-platform@lists.linux.dev
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@chromium.org>
---
Changes in v2:
- Updated the commit message with the right problem description
drivers/platform/chrome/cros_ec.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
index badc68bbae8cc..41714df053916 100644
--- a/drivers/platform/chrome/cros_ec.c
+++ b/drivers/platform/chrome/cros_ec.c
@@ -432,6 +432,12 @@ static void cros_ec_send_resume_event(struct cros_ec_device *ec_dev)
void cros_ec_resume_complete(struct cros_ec_device *ec_dev)
{
cros_ec_send_resume_event(ec_dev);
+ /*
+ * Let the mfd devices know about events that occur during
+ * suspend. This way the clients know what to do with them.
+ */
+ cros_ec_report_events_during_suspend(ec_dev);
+
}
EXPORT_SYMBOL(cros_ec_resume_complete);
@@ -442,12 +448,6 @@ static void cros_ec_enable_irq(struct cros_ec_device *ec_dev)
if (ec_dev->wake_enabled)
disable_irq_wake(ec_dev->irq);
-
- /*
- * Let the mfd devices know about events that occur during
- * suspend. This way the clients know what to do with them.
- */
- cros_ec_report_events_during_suspend(ec_dev);
}
/**
@@ -475,8 +475,9 @@ EXPORT_SYMBOL(cros_ec_resume_early);
*/
int cros_ec_resume(struct cros_ec_device *ec_dev)
{
- cros_ec_enable_irq(ec_dev);
- cros_ec_send_resume_event(ec_dev);
+ cros_ec_resume_early(ec_dev);
+ cros_ec_resume_complete(ec_dev);
+
return 0;
}
EXPORT_SYMBOL(cros_ec_resume);
--
2.44.0.769.g3c40516874-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] chrome/cros_ec: Handle events during suspend after resume completion
2024-04-29 18:13 [PATCH v2] chrome/cros_ec: Handle events during suspend after resume completion Karthikeyan Ramasubramanian
2024-04-30 1:40 ` patchwork-bot+chrome-platform
@ 2024-04-30 1:40 ` patchwork-bot+chrome-platform
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+chrome-platform @ 2024-04-30 1:40 UTC (permalink / raw)
To: Karthikeyan Ramasubramanian
Cc: linux-kernel, stable, lalithkraj, chrome-platform, bleung, groeck,
tzungbi
Hello:
This patch was applied to chrome-platform/linux.git (for-next)
by Tzung-Bi Shih <tzungbi@kernel.org>:
On Mon, 29 Apr 2024 12:13:45 -0600 you wrote:
> Commit 47ea0ddb1f56 ("platform/chrome: cros_ec_lpc: Separate host
> command and irq disable") re-ordered the resume sequence. Before that
> change, cros_ec resume sequence is:
> 1) Enable IRQ
> 2) Send resume event
> 3) Handle events during suspend
>
> [...]
Here is the summary with links:
- [v2] chrome/cros_ec: Handle events during suspend after resume completion
https://git.kernel.org/chrome-platform/c/2fbe479c0024
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 v2] chrome/cros_ec: Handle events during suspend after resume completion
2024-04-29 18:13 [PATCH v2] chrome/cros_ec: Handle events during suspend after resume completion Karthikeyan Ramasubramanian
@ 2024-04-30 1:40 ` patchwork-bot+chrome-platform
2024-04-30 1:40 ` patchwork-bot+chrome-platform
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+chrome-platform @ 2024-04-30 1:40 UTC (permalink / raw)
To: Karthikeyan Ramasubramanian
Cc: linux-kernel, stable, lalithkraj, chrome-platform, bleung, groeck,
tzungbi
Hello:
This patch was applied to chrome-platform/linux.git (for-kernelci)
by Tzung-Bi Shih <tzungbi@kernel.org>:
On Mon, 29 Apr 2024 12:13:45 -0600 you wrote:
> Commit 47ea0ddb1f56 ("platform/chrome: cros_ec_lpc: Separate host
> command and irq disable") re-ordered the resume sequence. Before that
> change, cros_ec resume sequence is:
> 1) Enable IRQ
> 2) Send resume event
> 3) Handle events during suspend
>
> [...]
Here is the summary with links:
- [v2] chrome/cros_ec: Handle events during suspend after resume completion
https://git.kernel.org/chrome-platform/c/2fbe479c0024
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:[~2024-04-30 1:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-29 18:13 [PATCH v2] chrome/cros_ec: Handle events during suspend after resume completion Karthikeyan Ramasubramanian
2024-04-30 1:40 ` patchwork-bot+chrome-platform
2024-04-30 1:40 ` patchwork-bot+chrome-platform
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox