On 13.06.2017 14:26, Jiahau Chang wrote:
2017-06-07 16:02 GMT+08:00 Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>:
On 06.06.2017 13:13, Jiahau Chang wrote:
v4: Remove the patch code in case USB_PORT_FEAT_REMOTE_WAKE_MASK
For AMD Promontory xHCI host, although you can disable USB 2.0 ports in
BIOS
settings, those ports will be enabled anyway after you remove a device on
that port and re-plug it in again. It's a known limitation of the chip.
As a workaround we can clear the PORT_WAKE_BITS.
Signed-off-by: Jiahau Chang <Lars_Chang@xxxxxxxxxxxxxx>
---
drivers/usb/host/xhci-hub.c | 2 ++
drivers/usb/host/xhci-pci.c | 13 +++++++++++++
drivers/usb/host/xhci.h | 2 ++
3 files changed, 17 insertions(+)
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 0dde49c..8994676 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -1461,6 +1461,8 @@ int xhci_bus_suspend(struct usb_hcd *hcd)
t2 |= PORT_WKOC_E | PORT_WKCONN_E;
t2 &= ~PORT_WKDISC_E;
}
+ if ((xhci->quirks & XHCI_U2_DISABLE_WAKE) &&
(hcd->speed < HCD_USB3))
+ t2 &= ~PORT_WAKE_BITS;
This will disable connect/disconnect/overcurrent wake for all usb2 ports on
AMD Promontory host.
I don't think that is what you want.
Is there a way for the driver to see which ports are disabled in bios?
If yes, then it would be better to just disable wake for those ports
Sorry for reply late. Our customers always request remote wake-up
feature only, they don’t want to support
connect/disconnect/overcurrent wake according to experience on other
OS. Due to support disable port feature, WOE and WCE bit should be
disabled.
I'm still a bit uncomfortable with this.
This change will make a hardcoded policy decision to never support Wake on
Connect/Disconnect/Overcurrent on USB2 ports for any AMD Promontory based product
now or in the future.
Is there really no way the driver can know if a port is disabled in BIOS?
Something in ACPI DSDT under xhci or port devices, or some bits in the PORTSC register?
-Mathias
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html