]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
accel/ivpu: Fix WARN in ivpu_ipc_send_receive_internal()
authorJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Tue, 10 Dec 2024 13:09:39 +0000 (14:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Dec 2024 13:02:16 +0000 (14:02 +0100)
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 <karol.wachowski@intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241210130939.1575610-4-jacek.lawrynowicz@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/accel/ivpu/ivpu_pm.c

index 59d3170f5e3541b76cff63ffa7b411f02e81ced4..10b7ae0f866c989f3cf4e5bc867fcc899fb93b90 100644 (file)
@@ -364,6 +364,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);
 }
@@ -378,7 +379,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);