Skip to contentSkip to conversation

drm/panfrost: fix power transition timeout warnings

PATCH Applied Christian Hewitt 3 participants 6 messages Mar 22, 2024 – Mar 28, 2024

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

PATCH 1/1 drm/panfrost: fix power transition timeout warnings

Increase the timeout value to prevent system logs on Amlogic boards flooding with power transition warnings:

[   13.047638] panfrost ffe40000.gpu: shader power transition timeout
[   13.048674] panfrost ffe40000.gpu: l2 power transition timeout
[   13.937324] panfrost ffe40000.gpu: shader power transition timeout
[   13.938351] panfrost ffe40000.gpu: l2 power transition timeout
...
[39829.506904] panfrost ffe40000.gpu: shader power transition timeout
[39829.507938] panfrost ffe40000.gpu: l2 power transition timeout
[39949.508369] panfrost ffe40000.gpu: shader power transition timeout
[39949.509405] panfrost ffe40000.gpu: l2 power transition timeout

The 2000 value has been found through trial and error testing with devices using G52 and G31 GPUs.

Fixes 22aa1a209018 ("drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off()")
---
 drivers/gpu/drm/panfrost/panfrost_gpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/panfrost/panfrost_gpu.c +3 -3
index 9063ce254642..fd8e44992184 100644
@@ -441,19 +441,19 @@ void panfrost_gpu_power_off(struct panfrost_device *pfdev)
 
 	gpu_write(pfdev, SHADER_PWROFF_LO, pfdev->features.shader_present);
 	ret = readl_relaxed_poll_timeout(pfdev->iomem + SHADER_PWRTRANS_LO,
-					 val, !val, 1, 1000);
+					 val, !val, 1, 2000);
 	if (ret)
 		dev_err(pfdev->dev, "shader power transition timeout");
 
 	gpu_write(pfdev, TILER_PWROFF_LO, pfdev->features.tiler_present);
 	ret = readl_relaxed_poll_timeout(pfdev->iomem + TILER_PWRTRANS_LO,
-					 val, !val, 1, 1000);
+					 val, !val, 1, 2000);
 	if (ret)
 		dev_err(pfdev->dev, "tiler power transition timeout");
 
 	gpu_write(pfdev, L2_PWROFF_LO, pfdev->features.l2_present);
 	ret = readl_poll_timeout(pfdev->iomem + L2_PWRTRANS_LO,
-				 val, !val, 0, 1000);
+				 val, !val, 0, 2000);
 	if (ret)
 		dev_err(pfdev->dev, "l2 power transition timeout");
 }
Signature · 1 line
2.34.1
#1 lore raw

Il 22/03/24 17:45, Christian Hewitt ha scritto:

Quoted 29 lines

Increase the timeout value to prevent system logs on Amlogic boards flooding with power transition warnings:

[   13.047638] panfrost ffe40000.gpu: shader power transition timeout
[   13.048674] panfrost ffe40000.gpu: l2 power transition timeout
[   13.937324] panfrost ffe40000.gpu: shader power transition timeout
[   13.938351] panfrost ffe40000.gpu: l2 power transition timeout
...
[39829.506904] panfrost ffe40000.gpu: shader power transition timeout
[39829.507938] panfrost ffe40000.gpu: l2 power transition timeout
[39949.508369] panfrost ffe40000.gpu: shader power transition timeout
[39949.509405] panfrost ffe40000.gpu: l2 power transition timeout

The 2000 value has been found through trial and error testing with devices using G52 and G31 GPUs.

Fixes 22aa1a209018 ("drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off()")
---
  drivers/gpu/drm/panfrost/panfrost_gpu.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/panfrost/panfrost_gpu.c +0 -0
index 9063ce254642..fd8e44992184 100644
@@ -441,19 +441,19 @@ void panfrost_gpu_power_off(struct panfrost_device *pfdev)
 
  	gpu_write(pfdev, SHADER_PWROFF_LO, pfdev->features.shader_present);

drivers/gpu/drm/panfrost/panfrost_gpu.c void panfrost_gpu_power_off(struct panfrost_device *pfdev) · line 450

Quoted 10 lines
drivers/gpu/drm/panfrost/panfrost_gpu.c +2 -2
  	ret = readl_relaxed_poll_timeout(pfdev->iomem + SHADER_PWRTRANS_LO,
-					 val, !val, 1, 1000);
+					 val, !val, 1, 2000);
  	if (ret)
  		dev_err(pfdev->dev, "shader power transition timeout");
 
  	gpu_write(pfdev, TILER_PWROFF_LO, pfdev->features.tiler_present);
  	ret = readl_relaxed_poll_timeout(pfdev->iomem + TILER_PWRTRANS_LO,
-					 val, !val, 1, 1000);
+					 val, !val, 1, 2000);

Are you sure that you need to raise the timeout for TILER as well?

Cheers,
Angelo

Quoted 10 lines
drivers/gpu/drm/panfrost/panfrost_gpu.c +1 -1
  	if (ret)
  		dev_err(pfdev->dev, "tiler power transition timeout");
 
  	gpu_write(pfdev, L2_PWROFF_LO, pfdev->features.l2_present);
  	ret = readl_poll_timeout(pfdev->iomem + L2_PWRTRANS_LO,
-				 val, !val, 0, 1000);
+				 val, !val, 0, 2000);
  	if (ret)
  		dev_err(pfdev->dev, "l2 power transition timeout");
  }
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Christian Hewitt
Quoted 13 lines · Christian Hewitt

Increase the timeout value to prevent system logs on Amlogic boards flooding with power transition warnings:

[   13.047638] panfrost ffe40000.gpu: shader power transition timeout
[   13.048674] panfrost ffe40000.gpu: l2 power transition timeout
[   13.937324] panfrost ffe40000.gpu: shader power transition timeout
[   13.938351] panfrost ffe40000.gpu: l2 power transition timeout
...
[39829.506904] panfrost ffe40000.gpu: shader power transition timeout
[39829.507938] panfrost ffe40000.gpu: l2 power transition timeout
[39949.508369] panfrost ffe40000.gpu: shader power transition timeout
[39949.509405] panfrost ffe40000.gpu: l2 power transition timeout
Quoted 2 lines

The 2000 value has been found through trial and error testing with devices using G52 and G31 GPUs.

How close to 2ms did you need in your trial and error testing? I'm wondering if we should increase it further in case this might still trigger occasionally?

kbase seems to have a 5s (5000ms!) timeout before it will actually complain. But equally it doesn't busy wait on the registers in the same way as panfrost, so the impact to the rest of the system of a long wait is less.

But 2ms doesn't sound an unreasonable timeout so:

Quoted 14 lines
Fixes 22aa1a209018 ("drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off()")
 drivers/gpu/drm/panfrost/panfrost_gpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/panfrost/panfrost_gpu.c +0 -1
index 9063ce254642..fd8e44992184 100644
@@ -441,19 +441,19 @@ void panfrost_gpu_power_off(struct panfrost_device *pfdev)
 
 	gpu_write(pfdev, SHADER_PWROFF_LO, pfdev->features.shader_present);
 	ret = readl_relaxed_poll_timeout(pfdev->iomem + SHADER_PWRTRANS_LO,
-					 val, !val, 1, 1000);

drivers/gpu/drm/panfrost/panfrost_gpu.c void panfrost_gpu_power_off(struct panfrost_device *pfdev) · line 452

Quoted 10 lines
drivers/gpu/drm/panfrost/panfrost_gpu.c +2 -1
+					 val, !val, 1, 2000);
 	if (ret)
 		dev_err(pfdev->dev, "shader power transition timeout");
 
 	gpu_write(pfdev, TILER_PWROFF_LO, pfdev->features.tiler_present);
 	ret = readl_relaxed_poll_timeout(pfdev->iomem + TILER_PWRTRANS_LO,
-					 val, !val, 1, 1000);
+					 val, !val, 1, 2000);
 	if (ret)
 		dev_err(pfdev->dev, "tiler power transition timeout");

As Angelo points out the tiler probably doesn't need such a long timeout, but I can't see the harm in consistency so I'm happy with this change. If my memory of the hardware is correct then the tiler power off actually does very little and so I wouldn't expect it to take very long.

Steve

Quoted 7 lines
drivers/gpu/drm/panfrost/panfrost_gpu.c +1 -1
 	gpu_write(pfdev, L2_PWROFF_LO, pfdev->features.l2_present);
 	ret = readl_poll_timeout(pfdev->iomem + L2_PWRTRANS_LO,
-				 val, !val, 0, 1000);
+				 val, !val, 0, 2000);
 	if (ret)
 		dev_err(pfdev->dev, "l2 power transition timeout");
 }
#3 lore raw
Quoted 16 lines · Steven Price
Quoted 13 lines · Christian Hewitt

Increase the timeout value to prevent system logs on Amlogic boards flooding with power transition warnings:

[   13.047638] panfrost ffe40000.gpu: shader power transition timeout
[   13.048674] panfrost ffe40000.gpu: l2 power transition timeout
[   13.937324] panfrost ffe40000.gpu: shader power transition timeout
[   13.938351] panfrost ffe40000.gpu: l2 power transition timeout
...
[39829.506904] panfrost ffe40000.gpu: shader power transition timeout
[39829.507938] panfrost ffe40000.gpu: l2 power transition timeout
[39949.508369] panfrost ffe40000.gpu: shader power transition timeout
[39949.509405] panfrost ffe40000.gpu: l2 power transition timeout
Quoted 6 lines
Quoted 2 lines

The 2000 value has been found through trial and error testing with devices using G52 and G31 GPUs.

How close to 2ms did you need in your trial and error testing? I'm wondering if we should increase it further in case this might still trigger occasionally?

I backed it off progressively but still saw occasional messages at 1.6ms so padded it a little with 2ms, and those systems haven’t shown errors since so I currently see it as a ’safe’ value. The one possible wildcard is testing with older T820/T628 boards; but that needs to wait until I’m back home from a long trip and able to test them. The possible theory being that older/slower systems might require more time. Worst case I’ll have to send another change.

Quoted 27 lines

kbase seems to have a 5s (5000ms!) timeout before it will actually complain. But equally it doesn't busy wait on the registers in the same way as panfrost, so the impact to the rest of the system of a long wait is less.

But 2ms doesn't sound an unreasonable timeout so:

Quoted 18 lines
Fixes 22aa1a209018 ("drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off()")

drivers/gpu/drm/panfrost/panfrost_gpu.c | 6 +++---

1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/panfrost/panfrost_gpu.c +1 -1
index 9063ce254642..fd8e44992184 100644
@@ -441,19 +441,19 @@ void panfrost_gpu_power_off(struct panfrost_device *pfdev)
 
 gpu_write(pfdev, SHADER_PWROFF_LO, pfdev->features.shader_present);
 ret = readl_relaxed_poll_timeout(pfdev->iomem + SHADER_PWRTRANS_LO,
-  val, !val, 1, 1000);
+  val, !val, 1, 2000);
 if (ret)
 dev_err(pfdev->dev, "shader power transition timeout");
 
Quoted 11 lines

drivers/gpu/drm/panfrost/panfrost_gpu.c void panfrost_gpu_power_off(struct panfrost_device *pfdev) · line 452

Quoted 6 lines
drivers/gpu/drm/panfrost/panfrost_gpu.c +1 -1
 gpu_write(pfdev, TILER_PWROFF_LO, pfdev->features.tiler_present);
 ret = readl_relaxed_poll_timeout(pfdev->iomem + TILER_PWRTRANS_LO,
-  val, !val, 1, 1000);
+  val, !val, 1, 2000);
 if (ret)
 dev_err(pfdev->dev, "tiler power transition timeout");

As Angelo points out the tiler probably doesn't need such a long timeout, but I can't see the harm in consistency so I'm happy with this change. If my memory of the hardware is correct then the tiler power off actually does very little and so I wouldn't expect it to take very long.

I’ve seen tiler timeouts once I think and thus included it, but not since the values were increased. As long as it’s acceptable I won’t over-think it but if more testing is needed I can look at it more.

Quoted 9 lines

Steve

Quoted 7 lines
drivers/gpu/drm/panfrost/panfrost_gpu.c +1 -1
 gpu_write(pfdev, L2_PWROFF_LO, pfdev->features.l2_present);
 ret = readl_poll_timeout(pfdev->iomem + L2_PWRTRANS_LO,
-  val, !val, 0, 1000);
+  val, !val, 0, 2000);
 if (ret)
 dev_err(pfdev->dev, "l2 power transition timeout");
 }

Christian

#4 lore raw

Il 25/03/24 12:36, Christian Hewitt ha scritto:

Quoted 70 lines
Quoted 16 lines · Steven Price
Quoted 13 lines · Christian Hewitt

Increase the timeout value to prevent system logs on Amlogic boards flooding with power transition warnings:

[   13.047638] panfrost ffe40000.gpu: shader power transition timeout
[   13.048674] panfrost ffe40000.gpu: l2 power transition timeout
[   13.937324] panfrost ffe40000.gpu: shader power transition timeout
[   13.938351] panfrost ffe40000.gpu: l2 power transition timeout
...
[39829.506904] panfrost ffe40000.gpu: shader power transition timeout
[39829.507938] panfrost ffe40000.gpu: l2 power transition timeout
[39949.508369] panfrost ffe40000.gpu: shader power transition timeout
[39949.509405] panfrost ffe40000.gpu: l2 power transition timeout
Quoted 6 lines
Quoted 2 lines

The 2000 value has been found through trial and error testing with devices using G52 and G31 GPUs.

How close to 2ms did you need in your trial and error testing? I'm wondering if we should increase it further in case this might still trigger occasionally?

I backed it off progressively but still saw occasional messages at 1.6ms so padded it a little with 2ms, and those systems haven’t shown errors since so I currently see it as a ’safe’ value. The one possible wildcard is testing with older T820/T628 boards; but that needs to wait until I’m back home from a long trip and able to test them. The possible theory being that older/slower systems might require more time. Worst case I’ll have to send another change.

Quoted 27 lines

kbase seems to have a 5s (5000ms!) timeout before it will actually complain. But equally it doesn't busy wait on the registers in the same way as panfrost, so the impact to the rest of the system of a long wait is less.

But 2ms doesn't sound an unreasonable timeout so:

Quoted 18 lines
Fixes 22aa1a209018 ("drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off()")

drivers/gpu/drm/panfrost/panfrost_gpu.c | 6 +++---

1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/panfrost/panfrost_gpu.c +1 -1
index 9063ce254642..fd8e44992184 100644
@@ -441,19 +441,19 @@ void panfrost_gpu_power_off(struct panfrost_device *pfdev)
 
 gpu_write(pfdev, SHADER_PWROFF_LO, pfdev->features.shader_present);
 ret = readl_relaxed_poll_timeout(pfdev->iomem + SHADER_PWRTRANS_LO,
-  val, !val, 1, 1000);
+  val, !val, 1, 2000);
 if (ret)
 dev_err(pfdev->dev, "shader power transition timeout");
 
Quoted 11 lines

drivers/gpu/drm/panfrost/panfrost_gpu.c void panfrost_gpu_power_off(struct panfrost_device *pfdev) · line 452

Quoted 6 lines
drivers/gpu/drm/panfrost/panfrost_gpu.c +1 -1
 gpu_write(pfdev, TILER_PWROFF_LO, pfdev->features.tiler_present);
 ret = readl_relaxed_poll_timeout(pfdev->iomem + TILER_PWRTRANS_LO,
-  val, !val, 1, 1000);
+  val, !val, 1, 2000);
 if (ret)
 dev_err(pfdev->dev, "tiler power transition timeout");

As Angelo points out the tiler probably doesn't need such a long timeout, but I can't see the harm in consistency so I'm happy with this change. If my memory of the hardware is correct then the tiler power off actually does very little and so I wouldn't expect it to take very long.

Quoted 4 lines

I’ve seen tiler timeouts once I think and thus included it, but not since the values were increased. As long as it’s acceptable I won’t over-think it but if more testing is needed I can look at it more.

Thanks for clarifying.

maintainer Applied
#5 lore raw
In reply to Christian Hewitt
Quoted 13 lines · Christian Hewitt

Increase the timeout value to prevent system logs on Amlogic boards flooding with power transition warnings:

[   13.047638] panfrost ffe40000.gpu: shader power transition timeout
[   13.048674] panfrost ffe40000.gpu: l2 power transition timeout
[   13.937324] panfrost ffe40000.gpu: shader power transition timeout
[   13.938351] panfrost ffe40000.gpu: l2 power transition timeout
...
[39829.506904] panfrost ffe40000.gpu: shader power transition timeout
[39829.507938] panfrost ffe40000.gpu: l2 power transition timeout
[39949.508369] panfrost ffe40000.gpu: shader power transition timeout
[39949.509405] panfrost ffe40000.gpu: l2 power transition timeout
Quoted 5 lines

The 2000 value has been found through trial and error testing with devices using G52 and G31 GPUs.

Fixes 22aa1a209018 ("drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off()")

Queued to drm-misc-fixes.

Thanks,

Steve

Quoted 31 lines
---
 drivers/gpu/drm/panfrost/panfrost_gpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/panfrost/panfrost_gpu.c +3 -3
index 9063ce254642..fd8e44992184 100644
@@ -441,19 +441,19 @@ void panfrost_gpu_power_off(struct panfrost_device *pfdev)
 
 	gpu_write(pfdev, SHADER_PWROFF_LO, pfdev->features.shader_present);
 	ret = readl_relaxed_poll_timeout(pfdev->iomem + SHADER_PWRTRANS_LO,
-					 val, !val, 1, 1000);
+					 val, !val, 1, 2000);
 	if (ret)
 		dev_err(pfdev->dev, "shader power transition timeout");
 
 	gpu_write(pfdev, TILER_PWROFF_LO, pfdev->features.tiler_present);
 	ret = readl_relaxed_poll_timeout(pfdev->iomem + TILER_PWRTRANS_LO,
-					 val, !val, 1, 1000);
+					 val, !val, 1, 2000);
 	if (ret)
 		dev_err(pfdev->dev, "tiler power transition timeout");
 
 	gpu_write(pfdev, L2_PWROFF_LO, pfdev->features.l2_present);
 	ret = readl_poll_timeout(pfdev->iomem + L2_PWRTRANS_LO,
-				 val, !val, 0, 1000);
+				 val, !val, 0, 2000);
 	if (ret)
 		dev_err(pfdev->dev, "l2 power transition timeout");
 }