Skip to content

Commit 5625207

Browse files
committed
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"
2 parents debe436 + e1959fa commit 5625207

File tree

4 files changed

+8
-27
lines changed

4 files changed

+8
-27
lines changed

drivers/usb/core/hcd.c

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2795,7 +2795,6 @@ int usb_add_hcd(struct usb_hcd *hcd,
27952795
{
27962796
int retval;
27972797
struct usb_device *rhdev;
2798-
struct usb_hcd *shared_hcd;
27992798

28002799
if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
28012800
hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev);
@@ -2956,26 +2955,13 @@ int usb_add_hcd(struct usb_hcd *hcd,
29562955
goto err_hcd_driver_start;
29572956
}
29582957

2959-
/* starting here, usbcore will pay attention to the shared HCD roothub */
2960-
shared_hcd = hcd->shared_hcd;
2961-
if (!usb_hcd_is_primary_hcd(hcd) && shared_hcd && HCD_DEFER_RH_REGISTER(shared_hcd)) {
2962-
retval = register_root_hub(shared_hcd);
2963-
if (retval != 0)
2964-
goto err_register_root_hub;
2965-
2966-
if (shared_hcd->uses_new_polling && HCD_POLL_RH(shared_hcd))
2967-
usb_hcd_poll_rh_status(shared_hcd);
2968-
}
2969-
29702958
/* starting here, usbcore will pay attention to this root hub */
2971-
if (!HCD_DEFER_RH_REGISTER(hcd)) {
2972-
retval = register_root_hub(hcd);
2973-
if (retval != 0)
2974-
goto err_register_root_hub;
2959+
retval = register_root_hub(hcd);
2960+
if (retval != 0)
2961+
goto err_register_root_hub;
29752962

2976-
if (hcd->uses_new_polling && HCD_POLL_RH(hcd))
2977-
usb_hcd_poll_rh_status(hcd);
2978-
}
2963+
if (hcd->uses_new_polling && HCD_POLL_RH(hcd))
2964+
usb_hcd_poll_rh_status(hcd);
29792965

29802966
return retval;
29812967

@@ -3013,7 +2999,6 @@ EXPORT_SYMBOL_GPL(usb_add_hcd);
30132999
void usb_remove_hcd(struct usb_hcd *hcd)
30143000
{
30153001
struct usb_device *rhdev = hcd->self.root_hub;
3016-
bool rh_registered;
30173002

30183003
dev_info(hcd->self.controller, "remove, state %x\n", hcd->state);
30193004

@@ -3024,7 +3009,6 @@ void usb_remove_hcd(struct usb_hcd *hcd)
30243009

30253010
dev_dbg(hcd->self.controller, "roothub graceful disconnect\n");
30263011
spin_lock_irq (&hcd_root_hub_lock);
3027-
rh_registered = hcd->rh_registered;
30283012
hcd->rh_registered = 0;
30293013
spin_unlock_irq (&hcd_root_hub_lock);
30303014

@@ -3034,8 +3018,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
30343018
cancel_work_sync(&hcd->died_work);
30353019

30363020
mutex_lock(&usb_bus_idr_lock);
3037-
if (rh_registered)
3038-
usb_disconnect(&rhdev); /* Sets rhdev to NULL */
3021+
usb_disconnect(&rhdev); /* Sets rhdev to NULL */
30393022
mutex_unlock(&usb_bus_idr_lock);
30403023

30413024
/*

drivers/usb/host/xhci-hub.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ static void xhci_common_hub_descriptor(struct xhci_hcd *xhci,
257257
{
258258
u16 temp;
259259

260-
desc->bPwrOn2PwrGood = 10; /* xhci section 5.4.9 says 20ms max */
261260
desc->bHubContrCurrent = 0;
262261

263262
desc->bNbrPorts = ports;
@@ -292,6 +291,7 @@ static void xhci_usb2_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci,
292291
desc->bDescriptorType = USB_DT_HUB;
293292
temp = 1 + (ports / 8);
294293
desc->bDescLength = USB_DT_HUB_NONVAR_SIZE + 2 * temp;
294+
desc->bPwrOn2PwrGood = 10; /* xhci section 5.4.8 says 20ms */
295295

296296
/* The Device Removable bits are reported on a byte granularity.
297297
* If the port doesn't exist within that byte, the bit is set to 0.
@@ -344,6 +344,7 @@ static void xhci_usb3_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci,
344344
xhci_common_hub_descriptor(xhci, desc, ports);
345345
desc->bDescriptorType = USB_DT_SS_HUB;
346346
desc->bDescLength = USB_DT_SS_HUB_SIZE;
347+
desc->bPwrOn2PwrGood = 50; /* usb 3.1 may fail if less than 100ms */
347348

348349
/* header decode latency should be zero for roothubs,
349350
* see section 4.23.5.2.

drivers/usb/host/xhci.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,6 @@ int xhci_run(struct usb_hcd *hcd)
692692
if (ret)
693693
xhci_free_command(xhci, command);
694694
}
695-
set_bit(HCD_FLAG_DEFER_RH_REGISTER, &hcd->flags);
696695
xhci_dbg_trace(xhci, trace_xhci_dbg_init,
697696
"Finished xhci_run for USB2 roothub");
698697

include/linux/usb/hcd.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ struct usb_hcd {
124124
#define HCD_FLAG_RH_RUNNING 5 /* root hub is running? */
125125
#define HCD_FLAG_DEAD 6 /* controller has died? */
126126
#define HCD_FLAG_INTF_AUTHORIZED 7 /* authorize interfaces? */
127-
#define HCD_FLAG_DEFER_RH_REGISTER 8 /* Defer roothub registration */
128127

129128
/* The flags can be tested using these macros; they are likely to
130129
* be slightly faster than test_bit().
@@ -135,7 +134,6 @@ struct usb_hcd {
135134
#define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING))
136135
#define HCD_RH_RUNNING(hcd) ((hcd)->flags & (1U << HCD_FLAG_RH_RUNNING))
137136
#define HCD_DEAD(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEAD))
138-
#define HCD_DEFER_RH_REGISTER(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEFER_RH_REGISTER))
139137

140138
/*
141139
* Specifies if interfaces are authorized by default

0 commit comments

Comments
 (0)