<p>Furquan Shaikh has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21931">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">soc/intel/skylake: Fix broken suspend/resume for deep S3<br><br>Change d3476809 (soc/intel/skylake: Add support in SKL for PMC common<br>code) changed the logic for obtaining previous sleep state by<br>unconditionally checking for PWR_FLR and SUS_PWR_FLR. In case of deep<br>S3, SUS_PWR_FLR is set in gen_pmcon_b (just like resume from deep<br>S5/G3) and hence the check for power failure should be done only when<br>WAK_STS bit is not set. This is necessary to differentiate wakes from<br>deep S3 and G3.<br><br>This change restores the original logic by performing power failure<br>check only in cases where WAK_STS bit is not set.<br><br>BUG=b:67617726<br>TEST=Verified following:<br>1. When WAK_STS bit is not set and SUS_PWR_FLR is set, coreboot<br>correctly identifies that the system prev sleep state was S5.<br>2. When WAK_STS bit is set and SUS_PWR_FLR is set, coreboot correctly<br>identifies that the system prev sleep state was S3.<br><br>Change-Id: Ic97bbc9911ba34aa21f4728c77fc20c5bb08f6f9<br>Signed-off-by: Furquan Shaikh <furquan@chromium.org><br>---<br>M src/soc/intel/skylake/romstage/power_state.c<br>1 file changed, 2 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/21931/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/soc/intel/skylake/romstage/power_state.c b/src/soc/intel/skylake/romstage/power_state.c<br>index 78650fa..3eae936 100644<br>--- a/src/soc/intel/skylake/romstage/power_state.c<br>+++ b/src/soc/intel/skylake/romstage/power_state.c<br>@@ -44,7 +44,8 @@<br>   * S5 because the PCH does not set the WAK_STS bit when waking<br>         * from a true G3 state.<br>       */<br>-  if (ps->gen_pmcon_b & (PWR_FLR | SUS_PWR_FLR))<br>+        if (!(ps->pm1_sts & WAK_STS) &&<br>+           (ps->gen_pmcon_b & (PWR_FLR | SUS_PWR_FLR)))<br>               prev_sleep_state = ACPI_S5;<br> <br>        /*<br></pre><p>To view, visit <a href="https://review.coreboot.org/21931">change 21931</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/21931"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ic97bbc9911ba34aa21f4728c77fc20c5bb08f6f9 </div>
<div style="display:none"> Gerrit-Change-Number: 21931 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Furquan Shaikh <furquan@google.com> </div>