<p>Bill XIE has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/25322">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">drivers/pc80/tpm: Add some delay to tis_readresponse()<br><br>Certain TPMs (observed on Infineon SLB9635 installed on revolve 810 g1)<br>seem to need some delay between tis_wait_valid() and<br>tis_has_valid_data(), or tis_has_valid_data() may invalidly return 0,<br>ending the loop immaturely with some bytes left unread, and fail to<br>pass the check below, causing the current command not finalized by<br>tis_command_ready(), and blocking any later tis_wait_ready().<br><br>Change-Id: Ic2a2f252e72a0bbce51e2863f8e46647b1570ba5<br>Signed-off-by: Bill XIE <persmule@gmail.com><br>---<br>M src/drivers/pc80/tpm/tis.c<br>1 file changed, 6 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/22/25322/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/drivers/pc80/tpm/tis.c b/src/drivers/pc80/tpm/tis.c</span><br><span>index 9802654..0c175dd 100644</span><br><span>--- a/src/drivers/pc80/tpm/tis.c</span><br><span>+++ b/src/drivers/pc80/tpm/tis.c</span><br><span>@@ -595,6 +595,12 @@</span><br><span>          if (offset == expected_count)</span><br><span>                        break;  /* We got all we need */</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+          /*</span><br><span style="color: hsl(120, 100%, 40%);">+             * Certain TPMs seem to need some delay between tis_wait_valid()</span><br><span style="color: hsl(120, 100%, 40%);">+               * and tis_has_valid_data(), or some race condition will occur.</span><br><span style="color: hsl(120, 100%, 40%);">+                */</span><br><span style="color: hsl(120, 100%, 40%);">+           udelay(10);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>        } while (tis_has_valid_data(locality));</span><br><span> </span><br><span>  /* * Make sure we indeed read all there was. */</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/25322">change 25322</a>. To unsubscribe, or for help writing mail filters, 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/25322"/><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: Ic2a2f252e72a0bbce51e2863f8e46647b1570ba5 </div>
<div style="display:none"> Gerrit-Change-Number: 25322 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Bill XIE <persmule@gmail.com> </div>