Skip to contentSkip to conversation

venus: core: remove CNOC voting while device suspend

PATCH In review Mansur Alisha Shaik 3 participants 3 messages Feb 17, 2020 – Apr 9, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 venus: core: remove CNOC voting while device suspend

video driver is voting for CNOC during probe and not clear while device suspend. Because of which XO shutdown is happing(BCM42: VALID: 0x1 VOTE_X: 0x0000 VOTE_Y: 0x0004).

So, clearing CNOC voting while device suspend.

---
 drivers/media/platform/qcom/venus/core.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/media/platform/qcom/venus/core.c +8 -4
index e7995cb..153effe 100644
@@ -244,10 +244,6 @@ static int venus_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = icc_set_bw(core->cpucfg_path, 0, kbps_to_icc(1000));
-	if (ret)
-		return ret;
-
 	ret = hfi_create(core, &venus_core_ops);
 	if (ret)
 		return ret;
@@ -353,6 +349,10 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev)
 	if (ret)
 		return ret;
 
+	ret = icc_set_bw(core->cpucfg_path, 0, 0);
+	if (ret)
+		return ret;
+
 	if (pm_ops->core_power)
 		ret = pm_ops->core_power(dev, POWER_OFF);
 
@@ -371,6 +371,10 @@ static __maybe_unused int venus_runtime_resume(struct device *dev)
 			return ret;
 	}
 
+	ret = icc_set_bw(core->cpucfg_path, 0, kbps_to_icc(1000));
+	if (ret)
+		return ret;
+
 	return hfi_core_resume(core, false);
 }
 
Signature · 1 line
2.7.4
#1 lore raw

Hi Mansur,

The patch looks fine and correct but the description should be better.

Quoted 5 lines · Mansur Alisha Shaik

video driver is voting for CNOC during probe and not clear while device suspend. Because of which XO shutdown is happing(BCM42: VALID: 0x1 VOTE_X: 0x0000 VOTE_Y: 0x0004).

So, clearing CNOC voting while device suspend.

Maybe something like this ?

The Venus driver is voting Configuration NoC during .probe but not clear voting in .suspend. As a consequence the whole device could leak energy while in suspend. Correct this by moving voting in .resume and unvoting in .suspend.

Quoted 44 lines
---
 drivers/media/platform/qcom/venus/core.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/media/platform/qcom/venus/core.c +8 -4
index e7995cb..153effe 100644
@@ -244,10 +244,6 @@ static int venus_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = icc_set_bw(core->cpucfg_path, 0, kbps_to_icc(1000));
-	if (ret)
-		return ret;
-
 	ret = hfi_create(core, &venus_core_ops);
 	if (ret)
 		return ret;
@@ -353,6 +349,10 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev)
 	if (ret)
 		return ret;
 
+	ret = icc_set_bw(core->cpucfg_path, 0, 0);
+	if (ret)
+		return ret;
+
 	if (pm_ops->core_power)
 		ret = pm_ops->core_power(dev, POWER_OFF);
 
@@ -371,6 +371,10 @@ static __maybe_unused int venus_runtime_resume(struct device *dev)
 			return ret;
 	}
 
+	ret = icc_set_bw(core->cpucfg_path, 0, kbps_to_icc(1000));
+	if (ret)
+		return ret;
+
 	return hfi_core_resume(core, false);
 }
 
Signature · 6 lines
regards,
Stan

-- 
regards,
Stan
#2 lore raw
In reply to Mansur Alisha Shaik

Hi Mansur,

do you still intend to land this patch? If so please re-spin it to address Stanimir's feedback.

Thanks

Matthias

Quoted 48 lines · Mansur Alisha Shaik

video driver is voting for CNOC during probe and not clear while device suspend. Because of which XO shutdown is happing(BCM42: VALID: 0x1 VOTE_X: 0x0000 VOTE_Y: 0x0004).

So, clearing CNOC voting while device suspend.

---
 drivers/media/platform/qcom/venus/core.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/media/platform/qcom/venus/core.c +8 -4
index e7995cb..153effe 100644
@@ -244,10 +244,6 @@ static int venus_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = icc_set_bw(core->cpucfg_path, 0, kbps_to_icc(1000));
-	if (ret)
-		return ret;
-
 	ret = hfi_create(core, &venus_core_ops);
 	if (ret)
 		return ret;
@@ -353,6 +349,10 @@ static __maybe_unused int venus_runtime_suspend(struct device *dev)
 	if (ret)
 		return ret;
 
+	ret = icc_set_bw(core->cpucfg_path, 0, 0);
+	if (ret)
+		return ret;
+
 	if (pm_ops->core_power)
 		ret = pm_ops->core_power(dev, POWER_OFF);
 
@@ -371,6 +371,10 @@ static __maybe_unused int venus_runtime_resume(struct device *dev)
 			return ret;
 	}
 
+	ret = icc_set_bw(core->cpucfg_path, 0, kbps_to_icc(1000));
+	if (ret)
+		return ret;
+
 	return hfi_core_resume(core, false);
 }