Skip to content

Commit 2fbe479

Browse files
Karthikeyan RamasubramanianTzung-Bi Shih
Karthikeyan Ramasubramanian
authored and
Tzung-Bi Shih
committed
platform/chrome: cros_ec: Handle events during suspend after resume completion
Commit 47ea0dd ("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 47ea0dd ("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: 47ea0dd ("platform/chrome: cros_ec_lpc: Separate host command and irq disable") Cc: <[email protected]> Cc: Lalith Rajendran <[email protected]> Cc: <[email protected]> Signed-off-by: Karthikeyan Ramasubramanian <[email protected]> Link: https://lore.kernel.org/r/20240429121343.v2.1.If2e0cef959f1f6df9f4d1ab53a97c54aa54208af@changeid Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent c8f460d commit 2fbe479

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/platform/chrome/cros_ec.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,12 @@ static void cros_ec_send_resume_event(struct cros_ec_device *ec_dev)
432432
void cros_ec_resume_complete(struct cros_ec_device *ec_dev)
433433
{
434434
cros_ec_send_resume_event(ec_dev);
435+
436+
/*
437+
* Let the mfd devices know about events that occur during
438+
* suspend. This way the clients know what to do with them.
439+
*/
440+
cros_ec_report_events_during_suspend(ec_dev);
435441
}
436442
EXPORT_SYMBOL(cros_ec_resume_complete);
437443

@@ -442,12 +448,6 @@ static void cros_ec_enable_irq(struct cros_ec_device *ec_dev)
442448

443449
if (ec_dev->wake_enabled)
444450
disable_irq_wake(ec_dev->irq);
445-
446-
/*
447-
* Let the mfd devices know about events that occur during
448-
* suspend. This way the clients know what to do with them.
449-
*/
450-
cros_ec_report_events_during_suspend(ec_dev);
451451
}
452452

453453
/**
@@ -475,8 +475,8 @@ EXPORT_SYMBOL(cros_ec_resume_early);
475475
*/
476476
int cros_ec_resume(struct cros_ec_device *ec_dev)
477477
{
478-
cros_ec_enable_irq(ec_dev);
479-
cros_ec_send_resume_event(ec_dev);
478+
cros_ec_resume_early(ec_dev);
479+
cros_ec_resume_complete(ec_dev);
480480
return 0;
481481
}
482482
EXPORT_SYMBOL(cros_ec_resume);

0 commit comments

Comments
 (0)