Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB2 and USB3 are mistakenly marked as unsupported as the USB controller enters the suspended state #1497

Open
weizhenwu opened this issue Sep 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@weizhenwu
Copy link
Contributor

weizhenwu commented Sep 23, 2024

Bug Description

USB2 and USB3 are marked as unsupported mistakenly hence some of the USB jobs get skipped.
The resource job com.canonical.certification::usb relies on the command lsusb to determine if USB2/USB3 are supported

However, on Qualcomm's platform, the USB controller will auto-suspend when the cable/storage is removed.
This results in no output from the command lsusb, hence USB2/USB3 is marked as unsupported.

Expected result

There should be a reliable way to check if USB2 and USB3 are supported regardless of the USB controller status.

Environment

  • OS: 22.04 Server
  • Checkbox Version: snap
  • DUT: 202403-33869

To Reproduce

Run USB resource job by
$ checkbox-carmel-classic.checkbox-cli run com.canonical.certification::usb

Compare the output in two different scenarios

  • connecting a USB storage to the system
  • removing the USB storage from the system

Relevant log output

USB storage connected

ubuntu@ubuntu:~$ lsusb
Bus 002 Device 002: ID 13fe:6300 Kingston Technology Company Inc. SP Mobile C31 (64GB)
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
===========================[ Running Selected Jobs ]============================
==============[ Running job 1 / 1. Estimated time left: 0:00:00 ]===============
--------------[ Collect information about supported types of USB ]--------------
ID: com.canonical.certification::usb
Category: com.canonical.certification::information_gathering
... 8< -------------------------------------------------------------------------
usb2: supported
usb3: supported
------------------------------------------------------------------------- >8 ---
Outcome: job passed

USB storage removed

ubuntu@ubuntu:~$ lsusb
(none)
===========================[ Running Selected Jobs ]============================
==============[ Running job 1 / 1. Estimated time left: 0:00:00 ]===============
--------------[ Collect information about supported types of USB ]--------------
ID: com.canonical.certification::usb
Category: com.canonical.certification::information_gathering
... 8< -------------------------------------------------------------------------
usb2: unsupported
usb3: unsupported
------------------------------------------------------------------------- >8 ---
Outcome: job passed

Additional context

dmesg when USB storage connected:

[254039.180260] xhci-hcd xhci-hcd.2.auto: xHCI Host Controller
[254039.180339] xhci-hcd xhci-hcd.2.auto: new USB bus registered, assigned bus number 1
[254039.182397] xhci-hcd xhci-hcd.2.auto: hcc params 0x0230fe65 hci version 0x110 quirks 0x0000008000000010
[254039.182458] xhci-hcd xhci-hcd.2.auto: irq 187, io mem 0x0a600000
[254039.182599] xhci-hcd xhci-hcd.2.auto: xHCI Host Controller
[254039.182613] xhci-hcd xhci-hcd.2.auto: new USB bus registered, assigned bus number 2
[254039.182627] xhci-hcd xhci-hcd.2.auto: Host supports USB 3.0 SuperSpeed

dmesg when USB storage removed:

[254007.482178] xhci-hcd xhci-hcd.2.auto: remove, state 1
[254007.482419] usb usb2: USB disconnect, device number 1
[254007.550700] usb 2-1: USB disconnect, device number 2
[254007.585976] xhci-hcd xhci-hcd.2.auto: USB bus 2 deregistered
[254007.586048] xhci-hcd xhci-hcd.2.auto: remove, state 4
[254007.586063] usb usb1: USB disconnect, device number 1
[254007.588475] xhci-hcd xhci-hcd.2.auto: USB bus 1 deregistered
@weizhenwu weizhenwu added the bug Something isn't working label Sep 23, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CHECKBOX-1580.

This message was autogenerated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant