]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
accel/amdxdna: Enhance runtime power management
authorLizhi Hou <lizhi.hou@amd.com>
Tue, 23 Sep 2025 15:22:29 +0000 (08:22 -0700)
committerLizhi Hou <lizhi.hou@amd.com>
Wed, 24 Sep 2025 20:47:59 +0000 (13:47 -0700)
commit063db451832b8849faf1b0b8404b3a6a39995b29
treea54610588099458ea9e4df5a7915ab38178c21e8
parent90315cd293f321ada7bbd43a59636716e102d68a
accel/amdxdna: Enhance runtime power management

Currently, pm_runtime_resume_and_get() is invoked in the driver's open
callback, and pm_runtime_put_autosuspend() is called in the close
callback. As a result, the device remains active whenever an application
opens it, even if no I/O is performed, leading to unnecessary power
consumption.

Move the runtime PM calls to the AIE2 callbacks that actually interact
with the hardware. The device will automatically suspend after 5 seconds
of inactivity (no hardware accesses and no pending commands), and it will
be resumed on the next hardware access.

Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://lore.kernel.org/r/20250923152229.1303625-1-lizhi.hou@amd.com
12 files changed:
drivers/accel/amdxdna/Makefile
drivers/accel/amdxdna/aie2_ctx.c
drivers/accel/amdxdna/aie2_message.c
drivers/accel/amdxdna/aie2_pci.c
drivers/accel/amdxdna/aie2_pci.h
drivers/accel/amdxdna/aie2_smu.c
drivers/accel/amdxdna/amdxdna_ctx.c
drivers/accel/amdxdna/amdxdna_mailbox.c
drivers/accel/amdxdna/amdxdna_pci_drv.c
drivers/accel/amdxdna/amdxdna_pci_drv.h
drivers/accel/amdxdna/amdxdna_pm.c [new file with mode: 0644]
drivers/accel/amdxdna/amdxdna_pm.h [new file with mode: 0644]