Skip to content

Commit

Permalink
USB: UHCI: adjust zhaoxin UHCI controllers OverCurrent bit value
Browse files Browse the repository at this point in the history
commit dddb342 upstream.

OverCurrent condition is not standardized in the UHCI spec.
Zhaoxin UHCI controllers report OverCurrent bit active off.
In order to handle OverCurrent condition correctly, the uhci-hcd
driver needs to be told to expect the active-off behavior.

Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable@vger.kernel.org
Signed-off-by: Weitao Wang <WeitaoWang-oc@zhaoxin.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20230423105952.4526-1-WeitaoWang-oc@zhaoxin.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Weitao Wang authored and gregkh committed May 30, 2023
1 parent 0caed1f commit 66070f5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/usb/host/uhci-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,13 @@ static int uhci_pci_init(struct usb_hcd *hcd)

uhci->rh_numports = uhci_count_ports(hcd);

/* Intel controllers report the OverCurrent bit active on.
* VIA controllers report it active off, so we'll adjust the
* bit value. (It's not standardized in the UHCI spec.)
/*
* Intel controllers report the OverCurrent bit active on. VIA
* and ZHAOXIN controllers report it active off, so we'll adjust
* the bit value. (It's not standardized in the UHCI spec.)
*/
if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_VIA)
if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_VIA ||
to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_ZHAOXIN)
uhci->oc_low = 1;

/* HP's server management chip requires a longer port reset delay. */
Expand Down

0 comments on commit 66070f5

Please sign in to comment.