Skip to content

Commit 439b08c

Browse files
committed
Revert "usb: core: hcd: Add support for deferring roothub registration"
This reverts commit 58877b0. It has been reported to be causing problems in Arch and Fedora bug reports. Reported-by: Hans de Goede <[email protected]> Link: https://bbs.archlinux.org/viewtopic.php?pid=2000956#p2000956 Link: https://bugzilla.redhat.com/show_bug.cgi?id=2019542 Link: https://bugzilla.redhat.com/show_bug.cgi?id=2019576 Link: https://lore.kernel.org/r/[email protected] Cc: Mathias Nyman <[email protected]> Cc: Chris Chiu <[email protected]> Cc: Alan Stern <[email protected]> Cc: Kishon Vijay Abraham I <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0a55457 commit 439b08c

File tree

2 files changed

+6
-25
lines changed

2 files changed

+6
-25
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
/*

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)