Skip to content

Commit

Permalink
xhci: Don't defer primary roothub registration if there is only one r…
Browse files Browse the repository at this point in the history
…oothub

The support for xHCI controllers with only one roothub, and the code
to defer primary roothub registation until second roothub got merged
to usb-next for 5.19 at the same time.

commit 873f323 ("xhci: prepare for operation w/o shared hcd")
commit b7a4f9b ("xhci: Set HCD flag to defer primary roothub
registration")

These got merged in such a way that the flag to defer primary roothub
registration is set even for xHC controllers with just one roothub.

Fix this by setting the defer flag in a codepath taken only if we have
two roothubs

Fixes: 873f323 ("xhci: prepare for operation w/o shared hcd")
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20220516094850.19788-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Mathias Nyman authored and Greg Kroah-Hartman committed May 19, 2022
1 parent 376d6b0 commit 1bd8bb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/host/xhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,15 +696,15 @@ int xhci_run(struct usb_hcd *hcd)
xhci_dbg_trace(xhci, trace_xhci_dbg_init,
"Finished %s for main hcd", __func__);

set_bit(HCD_FLAG_DEFER_RH_REGISTER, &hcd->flags);

xhci_create_dbc_dev(xhci);

xhci_debugfs_init(xhci);

if (xhci_has_one_roothub(xhci))
return xhci_run_finished(xhci);

set_bit(HCD_FLAG_DEFER_RH_REGISTER, &hcd->flags);

return 0;
}
EXPORT_SYMBOL_GPL(xhci_run);
Expand Down

0 comments on commit 1bd8bb7

Please sign in to comment.