All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] accel/ivpu: Do not trigger extra VPU reset if the VPU is idle
@ 2023-05-25 10:38 Stanislaw Gruszka
  2023-05-25 10:38 ` [PATCH 2/2] accel/ivpu: Do not use mutex_lock_interruptible Stanislaw Gruszka
  2023-06-02 17:23 ` [PATCH 1/2] accel/ivpu: Do not trigger extra VPU reset if the VPU is idle Jeffrey Hugo
  0 siblings, 2 replies; 8+ messages in thread
From: Stanislaw Gruszka @ 2023-05-25 10:38 UTC (permalink / raw)
  To: dri-devel
  Cc: Andrzej Kacprowski, Oded Gabbay, Jeffrey Hugo, Jacek Lawrynowicz,
	Stanislaw Gruszka

From: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>

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: a8fed6d1e0b9 ("accel/ivpu: Fix power down sequence")
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
---
 drivers/accel/ivpu/ivpu_hw_mtl.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/accel/ivpu/ivpu_hw_mtl.c b/drivers/accel/ivpu/ivpu_hw_mtl.c
index 3210f1b4a7dd..012a25fae16d 100644
--- a/drivers/accel/ivpu/ivpu_hw_mtl.c
+++ b/drivers/accel/ivpu/ivpu_hw_mtl.c
@@ -743,9 +743,8 @@ static int ivpu_hw_mtl_power_down(struct ivpu_device *vdev)
 {
 	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");
-		ret = -EIO;
 	}
 
 	if (ivpu_pll_disable(vdev)) {
@@ -753,8 +752,10 @@ static int ivpu_hw_mtl_power_down(struct ivpu_device *vdev)
 		ret = -EIO;
 	}
 
-	if (ivpu_hw_mtl_d0i3_enable(vdev))
-		ivpu_warn(vdev, "Failed to enable D0I3\n");
+	if (ivpu_hw_mtl_d0i3_enable(vdev)) {
+		ivpu_err(vdev, "Failed to enter D0I3\n");
+		ret = -EIO;
+	}
 
 	return ret;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-06-08  6:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-25 10:38 [PATCH 1/2] accel/ivpu: Do not trigger extra VPU reset if the VPU is idle Stanislaw Gruszka
2023-05-25 10:38 ` [PATCH 2/2] accel/ivpu: Do not use mutex_lock_interruptible Stanislaw Gruszka
2023-06-02 17:30   ` Jeffrey Hugo
2023-06-06 13:44     ` Stanislaw Gruszka
2023-06-06 14:50       ` Jeffrey Hugo
2023-06-08  6:43         ` Stanislaw Gruszka
2023-06-08  6:21     ` Stanislaw Gruszka
2023-06-02 17:23 ` [PATCH 1/2] accel/ivpu: Do not trigger extra VPU reset if the VPU is idle Jeffrey Hugo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.