[PATCH v2 0/2] uacce: add device usage sysfs interface

From: Weili Qian

Date: Mon Sep 21 2026 - 05:53:45 EST


Add a read-only dev_usage sysfs attribute so userspace can query device
usage through sysfs. Patch 1 adds the attribute and the get_dev_usage
callback to the UACCE framework; patch 2 implements the callback in the
HiSilicon QM driver.

Changes in v2:
- Switch from qm_pm_get_sync() to hisi_qm_get_dfx_access() so that
reading dev_usage does not wake a runtime-suspended device. When
suspended, 0 is reported for each channel without touching the
hardware.
- Rename total_bw to max_bw in qm_usage_percent() and add a comment
describing the channel-usage register layout to clarify the
per-channel maximum semantics.

Weili Qian (2):
uacce: add device usage sysfs interface
crypto: hisilicon/qm - implement uacce get_dev_usage callback

Documentation/ABI/testing/sysfs-driver-uacce | 9 +++
drivers/crypto/hisilicon/debugfs.c | 17 -----
drivers/crypto/hisilicon/qm.c | 66 ++++++++++++++++++++
drivers/crypto/hisilicon/qm_common.h | 1 +
drivers/misc/uacce/uacce.c | 19 ++++++
include/linux/uacce.h | 5 ++
6 files changed, 100 insertions(+), 17 deletions(-)

--
2.43.0