[PATCH v4 06/31] accel: ethosu: Fix runtime PM get error handling
From: Rob Herring (Arm)
Date: Thu Oct 29 2026 - 09:41:06 EST
pm_runtime_get_if_active() can return an error including for !CONFIG_PM.
Do not treat that as an active runtime-PM reference.
Fixes: 5a5e9c0228e6 ("accel: Add Arm Ethos-U NPU driver")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Rob Herring (Arm) <robh@xxxxxxxxxx>
---
v4:
- new patch
---
drivers/accel/ethosu/ethosu_perfmon.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/accel/ethosu/ethosu_perfmon.c b/drivers/accel/ethosu/ethosu_perfmon.c
index 26f625374f9d..0ae2df3ceac8 100644
--- a/drivers/accel/ethosu/ethosu_perfmon.c
+++ b/drivers/accel/ethosu/ethosu_perfmon.c
@@ -71,7 +71,8 @@ void ethosu_perfmon_stop_locked(struct ethosu_device *ethosu, struct ethosu_perf
ncounters = perfmon->ncounters - 1;
- if (!pm_runtime_get_if_active(ethosu->base.dev)) {
+ if (IS_ENABLED(CONFIG_PM) &&
+ pm_runtime_get_if_active(ethosu->base.dev) <= 0) {
ethosu->perfmon_state.active = NULL;
return;
}
--
2.53.0