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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'usb-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
"Here are some small reverts and fixes for USB drivers for issues that
came up during the 5.16-rc1 merge window.

These include:

- two reverts of xhci and USB core patches that are causing problems
in many systems.

- xhci 3.1 enumeration delay fix for systems that were having
problems.

All three of these have been in linux-next all week with no reported
issues"

* tag 'usb-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
xhci: Fix USB 3.1 enumeration issues by increasing roothub power-on-good delay
Revert "usb: core: hcd: Add support for deferring roothub registration"
Revert "xhci: Set HCD flag to defer primary roothub registration"

+8 -27
+6 -23
drivers/usb/core/hcd.c
··· 2795 2795 { 2796 2796 int retval; 2797 2797 struct usb_device *rhdev; 2798 - struct usb_hcd *shared_hcd; 2799 2798 2800 2799 if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) { 2801 2800 hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev); ··· 2955 2956 goto err_hcd_driver_start; 2956 2957 } 2957 2958 2958 - /* starting here, usbcore will pay attention to the shared HCD roothub */ 2959 - shared_hcd = hcd->shared_hcd; 2960 - if (!usb_hcd_is_primary_hcd(hcd) && shared_hcd && HCD_DEFER_RH_REGISTER(shared_hcd)) { 2961 - retval = register_root_hub(shared_hcd); 2962 - if (retval != 0) 2963 - goto err_register_root_hub; 2964 - 2965 - if (shared_hcd->uses_new_polling && HCD_POLL_RH(shared_hcd)) 2966 - usb_hcd_poll_rh_status(shared_hcd); 2967 - } 2968 - 2969 2959 /* starting here, usbcore will pay attention to this root hub */ 2970 - if (!HCD_DEFER_RH_REGISTER(hcd)) { 2971 - retval = register_root_hub(hcd); 2972 - if (retval != 0) 2973 - goto err_register_root_hub; 2960 + retval = register_root_hub(hcd); 2961 + if (retval != 0) 2962 + goto err_register_root_hub; 2974 2963 2975 - if (hcd->uses_new_polling && HCD_POLL_RH(hcd)) 2976 - usb_hcd_poll_rh_status(hcd); 2977 - } 2964 + if (hcd->uses_new_polling && HCD_POLL_RH(hcd)) 2965 + usb_hcd_poll_rh_status(hcd); 2978 2966 2979 2967 return retval; 2980 2968 ··· 2999 3013 void usb_remove_hcd(struct usb_hcd *hcd) 3000 3014 { 3001 3015 struct usb_device *rhdev = hcd->self.root_hub; 3002 - bool rh_registered; 3003 3016 3004 3017 dev_info(hcd->self.controller, "remove, state %x\n", hcd->state); 3005 3018 ··· 3009 3024 3010 3025 dev_dbg(hcd->self.controller, "roothub graceful disconnect\n"); 3011 3026 spin_lock_irq (&hcd_root_hub_lock); 3012 - rh_registered = hcd->rh_registered; 3013 3027 hcd->rh_registered = 0; 3014 3028 spin_unlock_irq (&hcd_root_hub_lock); 3015 3029 ··· 3018 3034 cancel_work_sync(&hcd->died_work); 3019 3035 3020 3036 mutex_lock(&usb_bus_idr_lock); 3021 - if (rh_registered) 3022 - usb_disconnect(&rhdev); /* Sets rhdev to NULL */ 3037 + usb_disconnect(&rhdev); /* Sets rhdev to NULL */ 3023 3038 mutex_unlock(&usb_bus_idr_lock); 3024 3039 3025 3040 /*
+2 -1
drivers/usb/host/xhci-hub.c
··· 257 257 { 258 258 u16 temp; 259 259 260 - desc->bPwrOn2PwrGood = 10; /* xhci section 5.4.9 says 20ms max */ 261 260 desc->bHubContrCurrent = 0; 262 261 263 262 desc->bNbrPorts = ports; ··· 291 292 desc->bDescriptorType = USB_DT_HUB; 292 293 temp = 1 + (ports / 8); 293 294 desc->bDescLength = USB_DT_HUB_NONVAR_SIZE + 2 * temp; 295 + desc->bPwrOn2PwrGood = 10; /* xhci section 5.4.8 says 20ms */ 294 296 295 297 /* The Device Removable bits are reported on a byte granularity. 296 298 * If the port doesn't exist within that byte, the bit is set to 0. ··· 344 344 xhci_common_hub_descriptor(xhci, desc, ports); 345 345 desc->bDescriptorType = USB_DT_SS_HUB; 346 346 desc->bDescLength = USB_DT_SS_HUB_SIZE; 347 + desc->bPwrOn2PwrGood = 50; /* usb 3.1 may fail if less than 100ms */ 347 348 348 349 /* header decode latency should be zero for roothubs, 349 350 * see section 4.23.5.2.
-1
drivers/usb/host/xhci.c
··· 692 692 if (ret) 693 693 xhci_free_command(xhci, command); 694 694 } 695 - set_bit(HCD_FLAG_DEFER_RH_REGISTER, &hcd->flags); 696 695 xhci_dbg_trace(xhci, trace_xhci_dbg_init, 697 696 "Finished xhci_run for USB2 roothub"); 698 697
-2
include/linux/usb/hcd.h
··· 124 124 #define HCD_FLAG_RH_RUNNING 5 /* root hub is running? */ 125 125 #define HCD_FLAG_DEAD 6 /* controller has died? */ 126 126 #define HCD_FLAG_INTF_AUTHORIZED 7 /* authorize interfaces? */ 127 - #define HCD_FLAG_DEFER_RH_REGISTER 8 /* Defer roothub registration */ 128 127 129 128 /* The flags can be tested using these macros; they are likely to 130 129 * be slightly faster than test_bit(). ··· 134 135 #define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING)) 135 136 #define HCD_RH_RUNNING(hcd) ((hcd)->flags & (1U << HCD_FLAG_RH_RUNNING)) 136 137 #define HCD_DEAD(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEAD)) 137 - #define HCD_DEFER_RH_REGISTER(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEFER_RH_REGISTER)) 138 138 139 139 /* 140 140 * Specifies if interfaces are authorized by default