[coreboot-gerrit] Change in coreboot[master]: libpayload/drivers/usb/uhci: Fix infinite loop

Patrick Rudolph (Code Review) gerrit at coreboot.org
Sat Feb 10 12:11:03 CET 2018


Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/23687


Change subject: libpayload/drivers/usb/uhci: Fix infinite loop
......................................................................

libpayload/drivers/usb/uhci: Fix infinite loop

Libpayload and the libpayload-client might not handle some USB
devices at all. The current UHCI implementation does find an unattached
device, and tries to load a driver again and again, which will not
happen for unsupported devices.

Only handle port change events, and port disconnect events, like
it's done on other HCI controllers.

Tested on Lenovo T500 using UHCI controller.
Devices are found on startup and hot(un)plugging is still working.

Change-Id: Ic652311e995e7addd807d2dda8e1c8f385a0d45c
Signed-off-by: Patrick Rudolph <siro at das-labor.org>
---
M payloads/libpayload/drivers/usb/uhci_rh.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/23687/1

diff --git a/payloads/libpayload/drivers/usb/uhci_rh.c b/payloads/libpayload/drivers/usb/uhci_rh.c
index e08cce1..79ad8fb 100644
--- a/payloads/libpayload/drivers/usb/uhci_rh.c
+++ b/payloads/libpayload/drivers/usb/uhci_rh.c
@@ -145,14 +145,14 @@
 	u16 stored, real;
 
 	stored = (RH_INST (dev)->port[0] == -1);
-	real = ((uhci_reg_read16 (dev->controller, PORTSC1) & 1) == 0);
+	real = ((uhci_reg_read16(dev->controller, PORTSC1) & 8) == 0);
 	if (stored != real) {
 		usb_debug("change on port 1\n");
 		return 1;
 	}
 
 	stored = (RH_INST (dev)->port[1] == -1);
-	real = ((uhci_reg_read16 (dev->controller, PORTSC2) & 1) == 0);
+	real = ((uhci_reg_read16(dev->controller, PORTSC2) & 8) == 0);
 	if (stored != real) {
 		usb_debug("change on port 2\n");
 		return 2;

-- 
To view, visit https://review.coreboot.org/23687
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic652311e995e7addd807d2dda8e1c8f385a0d45c
Gerrit-Change-Number: 23687
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <siro at das-labor.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180210/2b6b70c2/attachment-0001.html>


More information about the coreboot-gerrit mailing list