From 3cd3cb6f33cbbd18f9acac01ca5008e2dfb76242 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Tue, 9 Jun 2020 15:13:15 -0700 Subject: ec/google/wilco: Suppress UCSI events in S0ix If a UCSI event comes in when the EC is in S0ix mode then the kernel driver attempts a transaction but fails and this can leave the system in an unexpected state where the only wake source is the power button. This change will not notify the UCSI driver if the EC is in S0ix mode and instead keep track of the event and send it on resume. BUG=b:157923800 TEST=tested on drallion system: 1. Put drallion system into suspend 2. Attach power supply 3. Ensure the system can wake with keypress Signed-off-by: Duncan Laurie Change-Id: I43acb089385d9b41ac955f053e409daad67423f1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/42237 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Furquan Shaikh --- src/ec/google/wilco/acpi/ec.asl | 9 +++++++++ src/ec/google/wilco/acpi/event.asl | 10 ++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'src/ec/google') diff --git a/src/ec/google/wilco/acpi/ec.asl b/src/ec/google/wilco/acpi/ec.asl index 1bb28be063..7531dbf8a5 100644 --- a/src/ec/google/wilco/acpi/ec.asl +++ b/src/ec/google/wilco/acpi/ec.asl @@ -7,6 +7,8 @@ Device (EC0) Name (_GPE, EC_SCI_GPI) Name (_STA, 0xf) Name (DBUG, Zero) + Name (ISSX, Zero) /* Is the EC in S0ix mode? */ + Name (UCEP, Zero) /* Is there a pending UCSI event? */ Name (_CRS, ResourceTemplate() { IO (Decode16, @@ -140,6 +142,8 @@ Device (EC0) */ Method (S0IX, 1, Serialized) { + ^ISSX = Arg0 /* Update S0ix state. */ + If (Arg0) { Printf ("EC Enter S0ix") W (CSEX, One) @@ -152,6 +156,11 @@ Device (EC0) } Else { Printf ("EC Exit S0ix") W (CSEX, Zero) + + /* If UCSI event happened during S0ix send it now. */ + If (^UCEP == One) { + ^_Q79 () + } } } diff --git a/src/ec/google/wilco/acpi/event.asl b/src/ec/google/wilco/acpi/event.asl index bf4bb19be7..4e24ee32de 100644 --- a/src/ec/google/wilco/acpi/event.asl +++ b/src/ec/google/wilco/acpi/event.asl @@ -139,6 +139,12 @@ Method (_Q66, 0, Serialized) /* UCSI SCI uses a unique event code */ Method (_Q79, 0, Serialized) { - Printf ("EC _Q79 UCSI Event") - Notify (^UCSI, 0x80) + If (ISSX == Zero) { + Printf ("EC _Q79 UCSI Event") + Notify (^UCSI, 0x80) + ^UCEP = Zero + } Else { + Printf ("EC _Q79 UCSI Event Masked in S0ix") + ^UCEP = One + } } -- cgit v1.2.3