The recorded disconnections (in port->disconnected) will currently be left uncleared if usb_attached() returns an error (e.g. because there are no drivers for a particular USB device). This is incorrect behaviour: the disconnection has been handled and the record should be cleared until the next physical disconnection is detected (via the CSC bit). The problem is masked for EHCI, UHCI, and USB hubs, since these will report a changed port (via usb_port_changed()) only when the underlying hardware reports a change. xHCI will call usb_port_changed() in response to any port status event, at which point the stale value of port->disconnected will be erroneously acted upon. This can lead to an endless loop of repeatedly enumerating the same device when a driverless device is attached to an xHCI root hub port. Fix by unconditionally clearing port->disconnected in usb_hotplugged(). Reported-by: Robin Smidsrød <robin@smidsrod.no> Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
1591 |
|
1591 |
|
1592 |
|
1592 |
|
1593 |
|
1593 |
|
1594 |
|
|
|
|
1594 |
|
|
1595 |
|
1595 |
|
1596 |
|
1596 |
|
1597 |
|
1597 |
|
|
|
||
1599 |
|
1599 |
|
1600 |
|
1600 |
|
1601 |
|
1601 |
|
1602 |
|
|
|
1603 |
|
|
|
1604 |
|
|
|
1605 |
|
|
|
|
1602 |
|
|
|
1603 |
|
|
|
1604 |
|
|
1606 |
|
1605 |
|
|
1606 |
|
|
|
1607 |
|
|
1607 |
|
1608 |
|
1608 |
|
1609 |
|
1609 |
|
|
|
1610 |
|
|
|
|
1610 |
|
|
1611 |
|
1611 |
|
1612 |
|
1612 |
|
1613 |
|
1613 |
|