Skip to contentSkip to conversation

accel/ivpu: Disable PLL after VPU IP reset during FLR

PATCH Superseded Stanislaw Gruszka 1 participant 1 message Oct 24, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 accel/ivpu: Disable PLL after VPU IP reset during FLR

From: Jacek Lawrynowicz <[email protected]>

IP reset has to followed by ivpu_pll_disable() to properly enter reset state.

Fixes 828d63042aec ("accel/ivpu: Don't enter d0i3 during FLR")
---
 drivers/accel/ivpu/ivpu_hw_37xx.c | 21 +++++++++++++++++++--
 drivers/accel/ivpu/ivpu_hw_40xx.c | 23 ++++++++++++++++++++---
 2 files changed, 39 insertions(+), 5 deletions(-)
drivers/accel/ivpu/ivpu_hw_37xx.c +19 -2
index 7e4e87aa7602..899369a3c5dc 100644
@@ -598,7 +598,7 @@ static int ivpu_hw_37xx_info_init(struct ivpu_device *vdev)
 	return 0;
 }
 
-static int ivpu_hw_37xx_reset(struct ivpu_device *vdev)
+static int ivpu_hw_37xx_ip_reset(struct ivpu_device *vdev)
 {
 	int ret;
 	u32 val;
@@ -623,6 +623,23 @@ static int ivpu_hw_37xx_reset(struct ivpu_device *vdev)
 	return ret;
 }
 
+static int ivpu_hw_37xx_reset(struct ivpu_device *vdev)
+{
+	int ret = 0;
+
+	if (ivpu_hw_37xx_ip_reset(vdev)) {
+		ivpu_err(vdev, "Failed to reset VPU IP\n");
+		ret = -EIO;
+	}
+
+	if (ivpu_pll_disable(vdev)) {
+		ivpu_err(vdev, "Failed to disable PLL\n");
+		ret = -EIO;
+	}
+
+	return ret;
+}
+
 static int ivpu_hw_37xx_d0i3_enable(struct ivpu_device *vdev)
 {
 	int ret;
@@ -722,7 +739,7 @@ static int ivpu_hw_37xx_power_down(struct ivpu_device *vdev)
 {
 	int ret = 0;
 
-	if (!ivpu_hw_37xx_is_idle(vdev) && ivpu_hw_37xx_reset(vdev))
+	if (!ivpu_hw_37xx_is_idle(vdev) && ivpu_hw_37xx_ip_reset(vdev))
 		ivpu_err(vdev, "Failed to reset the VPU\n");
 
 	if (ivpu_pll_disable(vdev)) {
drivers/accel/ivpu/ivpu_hw_40xx.c +20 -3
index e691c49c9841..b25d02dc541b 100644
@@ -742,7 +742,7 @@ static int ivpu_hw_40xx_info_init(struct ivpu_device *vdev)
 	return 0;
 }
 
-static int ivpu_hw_40xx_reset(struct ivpu_device *vdev)
+static int ivpu_hw_40xx_ip_reset(struct ivpu_device *vdev)
 {
 	int ret;
 	u32 val;
@@ -764,6 +764,23 @@ static int ivpu_hw_40xx_reset(struct ivpu_device *vdev)
 	return ret;
 }
 
+static int ivpu_hw_40xx_reset(struct ivpu_device *vdev)
+{
+	int ret = 0;
+
+	if (ivpu_hw_40xx_ip_reset(vdev)) {
+		ivpu_err(vdev, "Failed to reset VPU IP\n");
+		ret = -EIO;
+	}
+
+	if (ivpu_pll_disable(vdev)) {
+		ivpu_err(vdev, "Failed to disable PLL\n");
+		ret = -EIO;
+	}
+
+	return ret;
+}
+
 static int ivpu_hw_40xx_d0i3_enable(struct ivpu_device *vdev)
 {
 	int ret;
@@ -824,7 +841,7 @@ static int ivpu_hw_40xx_power_up(struct ivpu_device *vdev)
 {
 	int ret;
 
-	ret = ivpu_hw_40xx_reset(vdev);
+	ret = ivpu_hw_40xx_ip_reset(vdev);
 	if (ret) {
 		ivpu_err(vdev, "Failed to reset HW: %d\n", ret);
 		return ret;
@@ -902,7 +919,7 @@ static int ivpu_hw_40xx_power_down(struct ivpu_device *vdev)
 {
 	int ret = 0;
 
-	if (!ivpu_hw_40xx_is_idle(vdev) && ivpu_hw_40xx_reset(vdev))
+	if (!ivpu_hw_40xx_is_idle(vdev) && ivpu_hw_40xx_ip_reset(vdev))
 		ivpu_warn(vdev, "Failed to reset the VPU\n");
 
 	if (ivpu_pll_disable(vdev)) {
Signature · 1 line
2.25.1