diff options
author | Mario Limonciello <mario.limonciello@amd.com> | 2025-05-15 22:50:54 -0500 |
---|---|---|
committer | Mario Limonciello <mario.limonciello@amd.com> | 2025-05-15 22:51:05 -0500 |
commit | 43c4a3a5b2bbee9f377038fa452efdb4ee94114b (patch) | |
tree | 16f4de1a43a8bbe6c6a07341d4493d5d933e30ba | |
parent | 9fcfaf9ddb32ef9013de7ea64a0e23b29d4f3579 (diff) | |
download | amd-debug-tools-master.tar.gz |
When there are a bunch of controllers these are just noise.
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
-rw-r--r-- | src/amd_debug/prerequisites.py | 14 | ||||
-rw-r--r-- | src/test_prerequisites.py | 3 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/amd_debug/prerequisites.py b/src/amd_debug/prerequisites.py index 7fe9820..5f8617a 100644 --- a/src/amd_debug/prerequisites.py +++ b/src/amd_debug/prerequisites.py @@ -379,6 +379,7 @@ class PrerequisiteValidator(AmdTool): def check_usb3(self): """Check for the USB4 controller""" + slots = [] for device in self.pyudev.list_devices(subsystem="pci", PCI_CLASS="C0330"): slot = device.properties["PCI_SLOT_NAME"] if device.properties.get("DRIVER") != "xhci_hcd": @@ -387,18 +388,27 @@ class PrerequisiteValidator(AmdTool): ) self.failures += [MissingXhciHcd()] return False - self.db.record_prereq(f"USB3 driver `xhci_hcd` bound to {slot}", "✅") + slots += [slot] + if slots: + self.db.record_prereq( + f"USB3 driver `xhci_hcd` bound to {', '.join(slots)}", "✅" + ) return True def check_usb4(self): """Check if the thunderbolt driver is loaded""" + slots = [] for device in self.pyudev.list_devices(subsystem="pci", PCI_CLASS="C0340"): slot = device.properties["PCI_SLOT_NAME"] if device.properties.get("DRIVER") != "thunderbolt": self.db.record_prereq("USB4 driver `thunderbolt` missing", "❌") self.failures += [MissingThunderbolt()] return False - self.db.record_prereq(f"USB4 driver `thunderbolt` bound to {slot}", "✅") + slots += [slot] + if slots: + self.db.record_prereq( + f"USB4 driver `thunderbolt` bound to {', '.join(slots)}", "✅" + ) return True def check_sleep_mode(self): diff --git a/src/test_prerequisites.py b/src/test_prerequisites.py index 7cf1d53..b9422ab 100644 --- a/src/test_prerequisites.py +++ b/src/test_prerequisites.py @@ -1628,9 +1628,6 @@ class TestPrerequisiteValidator(unittest.TestCase): result = self.validator.check_usb3() self.assertFalse(result) self.mock_db.record_prereq.assert_any_call( - "USB3 driver `xhci_hcd` bound to 0000:00:1d.0", "✅" - ) - self.mock_db.record_prereq.assert_any_call( "USB3 controller for 0000:00:1d.1 not using `xhci_hcd` driver", "❌" ) self.assertTrue( |