Short circuit the retry loop in legacy_hub_port_reset() by returning an
error from usb_control_msg() when a device was handed over to a companion
by the ehci code. This avoids trying to reset low / fullspeed devices 5
times needlessly. Also do not print an error when a device has been handed
over.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
/* Reset the port */
ret = legacy_hub_port_reset(dev, port, &portstatus);
if (ret < 0) {
- printf("cannot reset port %i!?\n", port + 1);
+ if (ret != -ENXIO)
+ printf("cannot reset port %i!?\n", port + 1);
return ret;
}
port - 1);
reg |= EHCI_PS_PO;
ehci_writel(status_reg, reg);
- break;
+ return -ENXIO;
} else {
int ret;
reg &= ~EHCI_PS_CLEAR;
reg |= EHCI_PS_PO;
ehci_writel(status_reg, reg);
+ return -ENXIO;
} else {
ctrl->portreset |= 1 << port;
}