From ba3daef936d9b0de6ae83f13fd1db5e78b9f4093 Mon Sep 17 00:00:00 2001 From: Jacek Lawrynowicz Date: Fri, 14 Mar 2025 12:03:09 +0900 Subject: [PATCH] accel/ivpu: Fix WARN in ivpu_ipc_send_receive_internal() BugLink: https://bugs.launchpad.net/bugs/2102266 commit 0f6482caa6acdfdfc744db7430771fe7e6c4e787 upstream. Move pm_runtime_set_active() to ivpu_pm_init() so when ivpu_ipc_send_receive_internal() is executed before ivpu_pm_enable() it already has correct runtime state, even if last resume was not successful. Fixes: 8ed520ff4682 ("accel/ivpu: Move set autosuspend delay to HW specific code") Cc: stable@vger.kernel.org # v6.7+ Reviewed-by: Karol Wachowski Reviewed-by: Jeffrey Hugo Signed-off-by: Jacek Lawrynowicz Link: https://patchwork.freedesktop.org/patch/msgid/20241210130939.1575610-4-jacek.lawrynowicz@linux.intel.com Signed-off-by: Greg Kroah-Hartman CVE-2024-54193 Signed-off-by: Koichiro Den Signed-off-by: Mehmet Basaran --- drivers/accel/ivpu/ivpu_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/accel/ivpu/ivpu_pm.c b/drivers/accel/ivpu/ivpu_pm.c index eff8b8736c24..0e895524ab29 100644 --- a/drivers/accel/ivpu/ivpu_pm.c +++ b/drivers/accel/ivpu/ivpu_pm.c @@ -376,6 +376,7 @@ void ivpu_pm_init(struct ivpu_device *vdev) pm_runtime_use_autosuspend(dev); pm_runtime_set_autosuspend_delay(dev, delay); + pm_runtime_set_active(dev); ivpu_dbg(vdev, PM, "Autosuspend delay = %d\n", delay); } @@ -390,7 +391,6 @@ void ivpu_pm_enable(struct ivpu_device *vdev) { struct device *dev = vdev->drm.dev; - pm_runtime_set_active(dev); pm_runtime_allow(dev); pm_runtime_mark_last_busy(dev); pm_runtime_put_autosuspend(dev);