drm/accel/amdxdna: add debugfs support
PATCH 1/2 drm/accel/amdxdna: add debugfs support
Expose driver state through debugfs to aid debugging and development. Three read-only entries are created under /sys/kernel/debug/accel/<N>/:
- fw_version: firmware version as major.minor.sub.build
- device_info: device VBNV string and device type identifier
- clients: per-fd info (pid, heap usage, total BO usage)
Resolves the TODO item in drivers/accel/amdxdna/TODO.
Signed-off-by Md Shofiqul Islam <[email protected]>
--- drivers/accel/amdxdna/Makefile | 1 + drivers/accel/amdxdna/amdxdna_debugfs.c | 63 +++++++++++++++++++++++++ drivers/accel/amdxdna/amdxdna_debugfs.h | 17 +++++++ drivers/accel/amdxdna/amdxdna_pci_drv.c | 3 ++ 4 files changed, 84 insertions(+) create mode 100644 drivers/accel/amdxdna/amdxdna_debugfs.c create mode 100644 drivers/accel/amdxdna/amdxdna_debugfs.h
drivers/accel/amdxdna/Makefile +1 -0
@@ -10,6 +10,7 @@ amdxdna-y := \ aie2_smu.o \ aie2_solver.o \ amdxdna_ctx.o \ + amdxdna_debugfs.o \ amdxdna_gem.o \ amdxdna_iommu.o \ amdxdna_mailbox.o \
drivers/accel/amdxdna/amdxdna_debugfs.c new file +63 -0
63 lines not on this page · raw message
drivers/accel/amdxdna/amdxdna_debugfs.h new file +17 -0
@@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) 2024, Advanced Micro Devices, Inc. +*/ + +#ifndef _AMDXDNA_DEBUGFS_H_ +#define _AMDXDNA_DEBUGFS_H_ + +struct amdxdna_dev ; + +#ifdef CONFIG_DEBUG_FS +void amdxdna_debugfs_init (struct amdxdna_dev *xdna); +#else +static inline void amdxdna_debugfs_init (struct amdxdna_dev *xdna) {} +#endif + +#endif /* _AMDXDNA_DEBUGFS_H_ */
drivers/accel/amdxdna/amdxdna_pci_drv.c +3 -0
@@ -15,6 +15,7 @@#include <linux/pci.h> #include "amdxdna_ctx.h" +#include "amdxdna_debugfs.h" #include "amdxdna_gem.h" #include "amdxdna_pci_drv.h" #include "amdxdna_pm.h"
@@ -319,6 +320,8 @@ static int amdxdna_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto failed_sysfs_fini; } +amdxdna_debugfs_init (xdna); +return 0 ; failed_sysfs_fini:
Signature · 1 line
2.51.1