mbox series

[SRU,F/I,0/4] Fix USB devices not being detected at boot

Message ID cover.1649357153.git.luke.nowakowskikrijger@canonical.com
Headers show
Series Fix USB devices not being detected at boot | expand

Message

Luke Nowakowski-Krijger April 7, 2022, 8 p.m. UTC
[SRU Justification]

[Impact]
There are users with certain intel xHCI controllers that are
experiencing problems with USB devices not being detected at boot.

This is because when the primary roothub is registered, device
enumeration happens before xHC is running and leads to devices not being
detected. This results in the error that looks something like 
'usb usb1-port3: couldn't allocate usb_device'.

[Fix]
Register both root hubs along with the secondary hcd for xhci.

This original fix was reverted upstream due to regressions that occured due to
racing that happened when both roothubs were registered simultaneously.
However with those fixes being addressed in commits
("usb: hub: Fix usb enumeration issue due to address0 race")
("usb: hub: Fix locking issues with address0_mutex")
the maintainers have stated that they will be reintroducing this commit.
So lets reintroduce it here to fix the issues that users are
experiencing.

[Test Case]
Confirmed by Chris Chiu that this issue exists on similiar hardware
reported by the users and that reverting these reverts fixes the issue
showing no signs of 'couldn't allocate usb_device' and with USB devices
available after boot.

[Regression Potential]
Should be low now that we carry the fixes that seemed to be caused by
this patch series.

Luke Nowakowski-Krijger (2):
  UBUNTU: SAUCE: Revert "Revert "xhci: Set HCD flag to defer primary
    roothub registration""
  UBUNTU: SAUCE: Revert "Revert "usb: core: hcd: Add support for
    deferring roothub registration""

 drivers/usb/core/hcd.c  | 29 +++++++++++++++++++++++------
 drivers/usb/host/xhci.c |  1 +
 include/linux/usb/hcd.h |  2 ++
 3 files changed, 26 insertions(+), 6 deletions(-)

Comments

Kleber Sacilotto de Souza April 8, 2022, 7:30 a.m. UTC | #1
On 07.04.22 22:00, Luke Nowakowski-Krijger wrote:
> [SRU Justification]
> 
> [Impact]
> There are users with certain intel xHCI controllers that are
> experiencing problems with USB devices not being detected at boot.
> 
> This is because when the primary roothub is registered, device
> enumeration happens before xHC is running and leads to devices not being
> detected. This results in the error that looks something like
> 'usb usb1-port3: couldn't allocate usb_device'.
> 
> [Fix]
> Register both root hubs along with the secondary hcd for xhci.
> 
> This original fix was reverted upstream due to regressions that occured due to
> racing that happened when both roothubs were registered simultaneously.
> However with those fixes being addressed in commits
> ("usb: hub: Fix usb enumeration issue due to address0 race")
> ("usb: hub: Fix locking issues with address0_mutex")
> the maintainers have stated that they will be reintroducing this commit.
> So lets reintroduce it here to fix the issues that users are
> experiencing.
> 
> [Test Case]
> Confirmed by Chris Chiu that this issue exists on similiar hardware
> reported by the users and that reverting these reverts fixes the issue
> showing no signs of 'couldn't allocate usb_device' and with USB devices
> available after boot.
> 
> [Regression Potential]
> Should be low now that we carry the fixes that seemed to be caused by
> this patch series.
> 
> Luke Nowakowski-Krijger (2):
>    UBUNTU: SAUCE: Revert "Revert "xhci: Set HCD flag to defer primary
>      roothub registration""
>    UBUNTU: SAUCE: Revert "Revert "usb: core: hcd: Add support for
>      deferring roothub registration""
> 
>   drivers/usb/core/hcd.c  | 29 +++++++++++++++++++++++------
>   drivers/usb/host/xhci.c |  1 +
>   include/linux/usb/hcd.h |  2 ++
>   3 files changed, 26 insertions(+), 6 deletions(-)
> 

Thank you Luke for investigating and fixing this.

Could you please add the SRU justification also to the bug report?


Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

Thanks
Khalid Elmously April 8, 2022, 7:52 a.m. UTC | #2
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>


On 2022-04-07 13:00:50 , Luke Nowakowski-Krijger wrote:
> [SRU Justification]
> 
> [Impact]
> There are users with certain intel xHCI controllers that are
> experiencing problems with USB devices not being detected at boot.
> 
> This is because when the primary roothub is registered, device
> enumeration happens before xHC is running and leads to devices not being
> detected. This results in the error that looks something like 
> 'usb usb1-port3: couldn't allocate usb_device'.
> 
> [Fix]
> Register both root hubs along with the secondary hcd for xhci.
> 
> This original fix was reverted upstream due to regressions that occured due to
> racing that happened when both roothubs were registered simultaneously.
> However with those fixes being addressed in commits
> ("usb: hub: Fix usb enumeration issue due to address0 race")
> ("usb: hub: Fix locking issues with address0_mutex")
> the maintainers have stated that they will be reintroducing this commit.
> So lets reintroduce it here to fix the issues that users are
> experiencing.
> 
> [Test Case]
> Confirmed by Chris Chiu that this issue exists on similiar hardware
> reported by the users and that reverting these reverts fixes the issue
> showing no signs of 'couldn't allocate usb_device' and with USB devices
> available after boot.
> 
> [Regression Potential]
> Should be low now that we carry the fixes that seemed to be caused by
> this patch series.
> 
> Luke Nowakowski-Krijger (2):
>   UBUNTU: SAUCE: Revert "Revert "xhci: Set HCD flag to defer primary
>     roothub registration""
>   UBUNTU: SAUCE: Revert "Revert "usb: core: hcd: Add support for
>     deferring roothub registration""
> 
>  drivers/usb/core/hcd.c  | 29 +++++++++++++++++++++++------
>  drivers/usb/host/xhci.c |  1 +
>  include/linux/usb/hcd.h |  2 ++
>  3 files changed, 26 insertions(+), 6 deletions(-)
> 
> -- 
> 2.32.0
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Kleber Sacilotto de Souza April 8, 2022, 8:17 a.m. UTC | #3
On 07.04.22 22:00, Luke Nowakowski-Krijger wrote:
> [SRU Justification]
> 
> [Impact]
> There are users with certain intel xHCI controllers that are
> experiencing problems with USB devices not being detected at boot.
> 
> This is because when the primary roothub is registered, device
> enumeration happens before xHC is running and leads to devices not being
> detected. This results in the error that looks something like
> 'usb usb1-port3: couldn't allocate usb_device'.
> 
> [Fix]
> Register both root hubs along with the secondary hcd for xhci.
> 
> This original fix was reverted upstream due to regressions that occured due to
> racing that happened when both roothubs were registered simultaneously.
> However with those fixes being addressed in commits
> ("usb: hub: Fix usb enumeration issue due to address0 race")
> ("usb: hub: Fix locking issues with address0_mutex")
> the maintainers have stated that they will be reintroducing this commit.
> So lets reintroduce it here to fix the issues that users are
> experiencing.
> 
> [Test Case]
> Confirmed by Chris Chiu that this issue exists on similiar hardware
> reported by the users and that reverting these reverts fixes the issue
> showing no signs of 'couldn't allocate usb_device' and with USB devices
> available after boot.
> 
> [Regression Potential]
> Should be low now that we carry the fixes that seemed to be caused by
> this patch series.
> 
> Luke Nowakowski-Krijger (2):
>    UBUNTU: SAUCE: Revert "Revert "xhci: Set HCD flag to defer primary
>      roothub registration""
>    UBUNTU: SAUCE: Revert "Revert "usb: core: hcd: Add support for
>      deferring roothub registration""
> 
>   drivers/usb/core/hcd.c  | 29 +++++++++++++++++++++++------
>   drivers/usb/host/xhci.c |  1 +
>   include/linux/usb/hcd.h |  2 ++
>   3 files changed, 26 insertions(+), 6 deletions(-)
> 

Hi Luke,

Is this fix also needed for Jammy and unstable?
Kleber Sacilotto de Souza April 8, 2022, 8:24 a.m. UTC | #4
On 07.04.22 22:00, Luke Nowakowski-Krijger wrote:
> [SRU Justification]
> 
> [Impact]
> There are users with certain intel xHCI controllers that are
> experiencing problems with USB devices not being detected at boot.
> 
> This is because when the primary roothub is registered, device
> enumeration happens before xHC is running and leads to devices not being
> detected. This results in the error that looks something like
> 'usb usb1-port3: couldn't allocate usb_device'.
> 
> [Fix]
> Register both root hubs along with the secondary hcd for xhci.
> 
> This original fix was reverted upstream due to regressions that occured due to
> racing that happened when both roothubs were registered simultaneously.
> However with those fixes being addressed in commits
> ("usb: hub: Fix usb enumeration issue due to address0 race")
> ("usb: hub: Fix locking issues with address0_mutex")
> the maintainers have stated that they will be reintroducing this commit.
> So lets reintroduce it here to fix the issues that users are
> experiencing.
> 
> [Test Case]
> Confirmed by Chris Chiu that this issue exists on similiar hardware
> reported by the users and that reverting these reverts fixes the issue
> showing no signs of 'couldn't allocate usb_device' and with USB devices
> available after boot.
> 
> [Regression Potential]
> Should be low now that we carry the fixes that seemed to be caused by
> this patch series.
> 
> Luke Nowakowski-Krijger (2):
>    UBUNTU: SAUCE: Revert "Revert "xhci: Set HCD flag to defer primary
>      roothub registration""
>    UBUNTU: SAUCE: Revert "Revert "usb: core: hcd: Add support for
>      deferring roothub registration""
> 
>   drivers/usb/core/hcd.c  | 29 +++++++++++++++++++++++------
>   drivers/usb/host/xhci.c |  1 +
>   include/linux/usb/hcd.h |  2 ++
>   3 files changed, 26 insertions(+), 6 deletions(-)
> 

Applied to focal:linux and impish:linux.

Thanks,
Kleber