Skip to content

Commit 93d071a

Browse files
committed
Add a check that the XDNA driver has bound to the device
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/5049 Signed-off-by: Mario Limonciello <superm1@kernel.org>
1 parent ed54f0a commit 93d071a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/amd_debug/prerequisites.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,20 @@ def check_storage(self):
340340
and (valid_ahci or not has_sata)
341341
)
342342

343+
def check_amd_xdna(self):
344+
"""Check for AMD XDNA driver"""
345+
for device in self.pyudev.list_devices(subsystem="pci", PCI_CLASS="118000"):
346+
slot = device.properties["PCI_SLOT_NAME"]
347+
driver = device.properties.get("DRIVER")
348+
if not driver:
349+
self.db.record_prereq(f"NPU device in {slot} missing driver", "🚦")
350+
self.failures += [MissingDriver(slot)]
351+
return False
352+
p = os.path.join(device.sys_path, "fw_version")
353+
xdna_fw_version = read_file(p)
354+
self.db.record_prereq(f"NPU loaded with firmware {xdna_fw_version}", "✅")
355+
return True
356+
343357
def check_amd_hsmp(self):
344358
"""Check for AMD HSMP driver"""
345359
# not needed to check in newer kernels
@@ -1356,6 +1370,7 @@ def run(self):
13561370
self.check_i2c_hid,
13571371
self.check_pinctrl_amd,
13581372
self.check_amd_hsmp,
1373+
self.check_amd_xdna,
13591374
self.check_amd_pmc,
13601375
self.check_amd_cpu_hpet_wa,
13611376
self.check_port_pm_override,

0 commit comments

Comments
 (0)