All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>,
	Oded Gabbay <ogabbay@kernel.org>,
	Jeffrey Hugo <quic_jhugo@quicinc.com>,
	Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Subject: [PATCH 4/7] accel/ivpu: Fix power down sequence
Date: Wed, 22 Mar 2023 10:18:57 +0100	[thread overview]
Message-ID: <20230322091900.1982453-5-stanislaw.gruszka@linux.intel.com> (raw)
In-Reply-To: <20230322091900.1982453-1-stanislaw.gruszka@linux.intel.com>

Remove FPGA WA on power_down to skip checking for noc quiescent state.

Put VPU in reset before powering it down and skip manipulating
registers that are reset by the VPU reset.

This fixes power down errors there VPU is powered down just after VPU
is booted.

Co-developed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
---
 drivers/accel/ivpu/ivpu_hw_mtl.c | 37 ++------------------------------
 1 file changed, 2 insertions(+), 35 deletions(-)

diff --git a/drivers/accel/ivpu/ivpu_hw_mtl.c b/drivers/accel/ivpu/ivpu_hw_mtl.c
index 62bfaa9081c4..70ca6de78060 100644
--- a/drivers/accel/ivpu/ivpu_hw_mtl.c
+++ b/drivers/accel/ivpu/ivpu_hw_mtl.c
@@ -403,11 +403,6 @@ static int ivpu_boot_host_ss_axi_enable(struct ivpu_device *vdev)
 	return ivpu_boot_host_ss_axi_drive(vdev, true);
 }
 
-static int ivpu_boot_host_ss_axi_disable(struct ivpu_device *vdev)
-{
-	return ivpu_boot_host_ss_axi_drive(vdev, false);
-}
-
 static int ivpu_boot_host_ss_top_noc_drive(struct ivpu_device *vdev, bool enable)
 {
 	int ret;
@@ -441,11 +436,6 @@ static int ivpu_boot_host_ss_top_noc_enable(struct ivpu_device *vdev)
 	return ivpu_boot_host_ss_top_noc_drive(vdev, true);
 }
 
-static int ivpu_boot_host_ss_top_noc_disable(struct ivpu_device *vdev)
-{
-	return ivpu_boot_host_ss_top_noc_drive(vdev, false);
-}
-
 static void ivpu_boot_pwr_island_trickle_drive(struct ivpu_device *vdev, bool enable)
 {
 	u32 val = REGV_RD32(MTL_VPU_HOST_SS_AON_PWR_ISLAND_TRICKLE_EN0);
@@ -504,16 +494,6 @@ static void ivpu_boot_dpu_active_drive(struct ivpu_device *vdev, bool enable)
 	REGV_WR32(MTL_VPU_HOST_SS_AON_DPU_ACTIVE, val);
 }
 
-static int ivpu_boot_pwr_domain_disable(struct ivpu_device *vdev)
-{
-	ivpu_boot_dpu_active_drive(vdev, false);
-	ivpu_boot_pwr_island_isolation_drive(vdev, true);
-	ivpu_boot_pwr_island_trickle_drive(vdev, false);
-	ivpu_boot_pwr_island_drive(vdev, false);
-
-	return ivpu_boot_wait_for_pwr_island_status(vdev, 0x0);
-}
-
 static int ivpu_boot_pwr_domain_enable(struct ivpu_device *vdev)
 {
 	int ret;
@@ -797,21 +777,8 @@ static int ivpu_hw_mtl_power_down(struct ivpu_device *vdev)
 {
 	int ret = 0;
 
-	/* FPGA requires manual clearing of IP_Reset bit by enabling quiescent state */
-	if (ivpu_is_fpga(vdev)) {
-		if (ivpu_boot_host_ss_top_noc_disable(vdev)) {
-			ivpu_err(vdev, "Failed to disable TOP NOC\n");
-			ret = -EIO;
-		}
-
-		if (ivpu_boot_host_ss_axi_disable(vdev)) {
-			ivpu_err(vdev, "Failed to disable AXI\n");
-			ret = -EIO;
-		}
-	}
-
-	if (ivpu_boot_pwr_domain_disable(vdev)) {
-		ivpu_err(vdev, "Failed to disable power domain\n");
+	if (ivpu_hw_mtl_reset(vdev)) {
+		ivpu_err(vdev, "Failed to reset the VPU\n");
 		ret = -EIO;
 	}
 
-- 
2.25.1


  parent reply	other threads:[~2023-03-22  9:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22  9:18 [PATCH 0/7] acell/ivpu: Fixes for 6.3 Stanislaw Gruszka
2023-03-22  9:18 ` [PATCH 1/7] accel/ivpu: Do not access HW registers after unbind Stanislaw Gruszka
2023-03-22 14:16   ` Jeffrey Hugo
2023-03-22  9:18 ` [PATCH 2/7] accel/ivpu: Cancel recovery work Stanislaw Gruszka
2023-03-22 14:21   ` Jeffrey Hugo
2023-03-22 14:55     ` Stanislaw Gruszka
2023-03-22  9:18 ` [PATCH 3/7] accel/ivpu: Do not use SSID 1 Stanislaw Gruszka
2023-03-22 14:25   ` Jeffrey Hugo
2023-03-22 15:10     ` Stanislaw Gruszka
2023-03-22  9:18 ` Stanislaw Gruszka [this message]
2023-03-22 14:28   ` [PATCH 4/7] accel/ivpu: Fix power down sequence Jeffrey Hugo
2023-03-22  9:18 ` [PATCH 5/7] accel/ivpu: Disable buttress on device removal Stanislaw Gruszka
2023-03-22 14:33   ` Jeffrey Hugo
2023-03-22  9:18 ` [PATCH 6/7] accel/ivpu: Remove support for 1 tile SKUs Stanislaw Gruszka
2023-03-22 14:36   ` Jeffrey Hugo
2023-03-22  9:19 ` [PATCH 7/7] accel/ivpu: Fix VPU clock calculation Stanislaw Gruszka
2023-03-22 14:52   ` Jeffrey Hugo
2023-03-22 16:28     ` Stanislaw Gruszka
2023-03-23 11:00       ` Stanislaw Gruszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230322091900.1982453-5-stanislaw.gruszka@linux.intel.com \
    --to=stanislaw.gruszka@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jacek.lawrynowicz@linux.intel.com \
    --cc=ogabbay@kernel.org \
    --cc=quic_jhugo@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.