From 781892b660c20f633b5acc04a0444f4afc2ab975 Mon Sep 17 00:00:00 2001 From: Marc Fiuczynski Date: Fri, 9 Jun 2006 17:41:39 +0000 Subject: [PATCH] Backported fix from 2.6.17-rc1: Wait for the UHCI controller in HP's iLO2 server management chip. --- drivers/usb/host/uhci-hub.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c index 4c45ba839..f94d16912 100644 --- a/drivers/usb/host/uhci-hub.c +++ b/drivers/usb/host/uhci-hub.c @@ -86,6 +86,21 @@ static void uhci_finish_suspend(struct uhci_hcd *uhci, int port, } } +/* Wait for the UHCI controller in HP's iLO2 server management chip. + * It can take up to 250 us to finish a reset and set the CSC bit. + */ +static void wait_for_HP(unsigned long port_addr) +{ + int i; + + for (i = 10; i < 250; i += 10) { + if (inw(port_addr) & USBPORTSC_CSC) + return; + udelay(10); + } + /* Log a warning? */ +} + static void uhci_check_ports(struct uhci_hcd *uhci) { unsigned int port; @@ -99,6 +114,11 @@ static void uhci_check_ports(struct uhci_hcd *uhci) if (time_after_eq(jiffies, uhci->ports_timeout)) { CLR_RH_PORTSTAT(USBPORTSC_PR); udelay(10); + /* HP's server management chip requires + * a longer delay. */ + if (to_pci_dev(uhci_dev(uhci))->vendor == + PCI_VENDOR_ID_HP) + wait_for_HP(port_addr); /* If the port was enabled before, turning * reset on caused a port enable change. -- 2.47.0