Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: UHCI: adjust zhaoxin UHCI controllers OverCurrent bit value

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>

authored by

Weitao Wang and committed by
Greg Kroah-Hartman
dddb342b 4e8ef34e

+6 -4
+6 -4
drivers/usb/host/uhci-pci.c
··· 119 119 120 120 uhci->rh_numports = uhci_count_ports(hcd); 121 121 122 - /* Intel controllers report the OverCurrent bit active on. 123 - * VIA controllers report it active off, so we'll adjust the 124 - * bit value. (It's not standardized in the UHCI spec.) 122 + /* 123 + * Intel controllers report the OverCurrent bit active on. VIA 124 + * and ZHAOXIN controllers report it active off, so we'll adjust 125 + * the bit value. (It's not standardized in the UHCI spec.) 125 126 */ 126 - if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_VIA) 127 + if (to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_VIA || 128 + to_pci_dev(uhci_dev(uhci))->vendor == PCI_VENDOR_ID_ZHAOXIN) 127 129 uhci->oc_low = 1; 128 130 129 131 /* HP's server management chip requires a longer port reset delay. */