]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
accel/habanalabs/gaudi2: add support for logging register accesses from debugfs
authorSharley Calzolari <sharley.calzolari@intel.com>
Thu, 18 Jul 2024 15:01:52 +0000 (18:01 +0300)
committerKoby Elbaz <koby.elbaz@intel.com>
Thu, 25 Sep 2025 06:09:26 +0000 (09:09 +0300)
commitb5cddeb0dc6521dfee669e74967c6d28b1fd0d9e
treef0efab18f744642b9d60f443fe0847a1fe27be87
parent214e26a43f237358eec59c7c4e5ed1eaf2bfe472
accel/habanalabs/gaudi2: add support for logging register accesses from debugfs

Add infrastructure for logging the last configuration register accesses
that occur via debugfs read/write operations. At interrupt time, these
log entries can be dumped to dmesg, which helps in diagnosing the cause
of RAZWI and ADDR_DEC interrupts.

The logging is implemented as a ring buffer of access entries, with each
entry recording timestamp and access details. To ensure correctness
under concurrent access, operations are now protected using spinlocks.
Entries are copied under lock and then printed after releasing it, which
minimizes time spent in the critical section.

Signed-off-by: Sharley Calzolari <sharley.calzolari@intel.com>
Reviewed-by: Koby Elbaz <koby.elbaz@intel.com>
Signed-off-by: Koby Elbaz <koby.elbaz@intel.com>
drivers/accel/habanalabs/common/debugfs.c
drivers/accel/habanalabs/common/habanalabs.h
drivers/accel/habanalabs/gaudi2/gaudi2.c