<p>Furquan Shaikh has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/22005">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">google/chromeec: Drain all MKBP events while clearing host events<br><br>EC maintains a FIFO of all MKBP events and sets host event whenever<br>a new entry is added to the FIFO. Clearing only the host event for<br>MKBP creates an inconsistent state where there are pending MKBP events<br>in the FIFO but host event for MKBP is cleared. In order to maintain a<br>consistent view, host should clear all MKBP events in the FIFO if host<br>event is being cleared.<br><br>This change drains out all the MKBP events in the FIFO when<br>clear_pending_events is called.<br><br>TEST=Verified that all the MKBP events that occur before<br>clear_pending_events is called get cleared from the FIFO.<br><br>Change-Id: I131722dc01608dff30230fe341e6b23ae4cc409e<br>Signed-off-by: Furquan Shaikh <furquan@chromium.org><br>---<br>M src/ec/google/chromeec/smihandler.c<br>1 file changed, 5 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/05/22005/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/ec/google/chromeec/smihandler.c b/src/ec/google/chromeec/smihandler.c<br>index 379ff68..60b4d15 100644<br>--- a/src/ec/google/chromeec/smihandler.c<br>+++ b/src/ec/google/chromeec/smihandler.c<br>@@ -48,8 +48,13 @@<br> <br> static void clear_pending_events(void)<br> {<br>+   struct ec_response_get_next_event mkbp_event;<br>+<br>      while (google_chromeec_get_event() != 0)<br>              ;<br>+<br>+ while (google_chromeec_get_mkbp_event(&mkbp_event) == 0)<br>+         ;<br> }<br> <br> void chromeec_smi_sleep(int slp_type, uint32_t s3_mask, uint32_t s5_mask)<br></pre><p>To view, visit <a href="https://review.coreboot.org/22005">change 22005</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/22005"/><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: I131722dc01608dff30230fe341e6b23ae4cc409e </div>
<div style="display:none"> Gerrit-Change-Number: 22005 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Furquan Shaikh <furquan@google.com> </div>