<p>Patrick Rudolph has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/23687">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">libpayload/drivers/usb/uhci: Fix infinite loop<br><br>Libpayload and the libpayload-client might not handle some USB<br>devices at all. The current UHCI implementation does find an unattached<br>device, and tries to load a driver again and again, which will not<br>happen for unsupported devices.<br><br>Only handle port change events, and port disconnect events, like<br>it's done on other HCI controllers.<br><br>Tested on Lenovo T500 using UHCI controller.<br>Devices are found on startup and hot(un)plugging is still working.<br><br>Change-Id: Ic652311e995e7addd807d2dda8e1c8f385a0d45c<br>Signed-off-by: Patrick Rudolph <siro@das-labor.org><br>---<br>M payloads/libpayload/drivers/usb/uhci_rh.c<br>1 file changed, 2 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/23687/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/payloads/libpayload/drivers/usb/uhci_rh.c b/payloads/libpayload/drivers/usb/uhci_rh.c</span><br><span>index e08cce1..79ad8fb 100644</span><br><span>--- a/payloads/libpayload/drivers/usb/uhci_rh.c</span><br><span>+++ b/payloads/libpayload/drivers/usb/uhci_rh.c</span><br><span>@@ -145,14 +145,14 @@</span><br><span>       u16 stored, real;</span><br><span> </span><br><span>        stored = (RH_INST (dev)->port[0] == -1);</span><br><span style="color: hsl(0, 100%, 40%);">-     real = ((uhci_reg_read16 (dev->controller, PORTSC1) & 1) == 0);</span><br><span style="color: hsl(120, 100%, 40%);">+        real = ((uhci_reg_read16(dev->controller, PORTSC1) & 8) == 0);</span><br><span>        if (stored != real) {</span><br><span>                usb_debug("change on port 1\n");</span><br><span>           return 1;</span><br><span>    }</span><br><span> </span><br><span>        stored = (RH_INST (dev)->port[1] == -1);</span><br><span style="color: hsl(0, 100%, 40%);">-     real = ((uhci_reg_read16 (dev->controller, PORTSC2) & 1) == 0);</span><br><span style="color: hsl(120, 100%, 40%);">+        real = ((uhci_reg_read16(dev->controller, PORTSC2) & 8) == 0);</span><br><span>        if (stored != real) {</span><br><span>                usb_debug("change on port 2\n");</span><br><span>           return 2;</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/23687">change 23687</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/23687"/><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: Ic652311e995e7addd807d2dda8e1c8f385a0d45c </div>
<div style="display:none"> Gerrit-Change-Number: 23687 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Patrick Rudolph <siro@das-labor.org> </div>