--- zzzz-none-000/linux-4.1.38/drivers/usb/host/xhci.c 2017-01-18 18:48:06.000000000 +0000 +++ bcm63-7582-715/linux-4.1.38/drivers/usb/host/xhci.c 2020-11-25 10:06:48.000000000 +0000 @@ -37,6 +37,13 @@ #define PORT_WAKE_BITS (PORT_WKOC_E | PORT_WKDISC_E | PORT_WKCONN_E) +#if defined (CONFIG_AVM_KERNEL) +/* 20160219 AVM/VGJ USB3 ports switchable */ +int usb3port_config = 0; //default USB2 only +module_param(usb3port_config, int, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(usb3port_config, "Bitmask of allowed USB3 ports"); +#endif + /* Some 0.95 hardware can't handle the chain bit on a Link TRB being cleared */ static int link_quirk; module_param(link_quirk, int, S_IRUGO | S_IWUSR); @@ -355,6 +362,19 @@ return; } +#if defined(CONFIG_BCM_KF_ARM_BCM963XX) +#ifdef CONFIG_PM +static void __maybe_unused xhci_msix_sync_irqs(struct xhci_hcd *xhci) +{ + int i; + + if (xhci->msix_entries) { + for (i = 0; i < xhci->msix_count; i++) + synchronize_irq(xhci->msix_entries[i].vector); + } +} +#endif +#else static void __maybe_unused xhci_msix_sync_irqs(struct xhci_hcd *xhci) { int i; @@ -364,6 +384,7 @@ synchronize_irq(xhci->msix_entries[i].vector); } } +#endif static int xhci_try_enable_msi(struct usb_hcd *hcd) { @@ -506,6 +527,17 @@ { const char *dmi_product_name, *dmi_sys_vendor; +#if defined(CONFIG_BCM_KF_USB_HOSTS) && ( defined(CONFIG_BCM963138) || \ + defined(CONFIG_BCM963148) || defined(CONFIG_BCM96858) || \ + defined(CONFIG_BCM94908)) + + /* some bad USB3.0 devices are driving USB3.0 ports into compliance mode + * and makin gthe port unusable(till a reboot), this work around helps to + * avoid reboot by doing a warm reset. + */ + return true; +#endif + dmi_product_name = dmi_get_system_info(DMI_PRODUCT_NAME); dmi_sys_vendor = dmi_get_system_info(DMI_SYS_VENDOR); if (!dmi_product_name || !dmi_sys_vendor)