Commit 9f7e3611 authored by Andrzej Kacprowski's avatar Andrzej Kacprowski Committed by Stanislaw Gruszka

accel/ivpu: Do not trigger extra VPU reset if the VPU is idle

Turning off the PLL and entering D0i3 will reset the VPU so
an explicit IP reset is redundant.
But if the VPU is active, it may interfere with PLL disabling
and to avoid that, we have to issue an additional IP reset
to silence the VPU before turning off the PLL.

Fixes: a8fed6d1 ("accel/ivpu: Fix power down sequence")
Cc: stable@vger.kernel.org # 6.3.x
Signed-off-by: default avatarAndrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Reviewed-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: default avatarJeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230525103818.877590-1-stanislaw.gruszka@linux.intel.com
parent 6eea63c7
...@@ -754,9 +754,8 @@ static int ivpu_hw_mtl_power_down(struct ivpu_device *vdev) ...@@ -754,9 +754,8 @@ static int ivpu_hw_mtl_power_down(struct ivpu_device *vdev)
{ {
int ret = 0; int ret = 0;
if (ivpu_hw_mtl_reset(vdev)) { if (!ivpu_hw_mtl_is_idle(vdev) && ivpu_hw_mtl_reset(vdev)) {
ivpu_err(vdev, "Failed to reset the VPU\n"); ivpu_err(vdev, "Failed to reset the VPU\n");
ret = -EIO;
} }
if (ivpu_pll_disable(vdev)) { if (ivpu_pll_disable(vdev)) {
...@@ -764,8 +763,10 @@ static int ivpu_hw_mtl_power_down(struct ivpu_device *vdev) ...@@ -764,8 +763,10 @@ static int ivpu_hw_mtl_power_down(struct ivpu_device *vdev)
ret = -EIO; ret = -EIO;
} }
if (ivpu_hw_mtl_d0i3_enable(vdev)) if (ivpu_hw_mtl_d0i3_enable(vdev)) {
ivpu_warn(vdev, "Failed to enable D0I3\n"); ivpu_err(vdev, "Failed to enter D0I3\n");
ret = -EIO;
}
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment