drm/panthor: Wait for _READY register when powering on
Subsystems (3)
Steven Price
maintainerPATCH 1/1 drm/panthor: Wait for _READY register when powering on
panthor_gpu_block_power_on() takes a register offset (rdy_reg) for the purpose of waiting for the power transition to complete. However, a copy/paste error converting to use the new 64 register functions switched it to using the pwrtrans_reg register instead. Fix the function to use the correct register.
--- drivers/gpu/drm/panthor/panthor_gpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/panthor/panthor_gpu.c +3 -2
@@ -297,8 +297,9 @@ int panthor_gpu_block_power_on(struct panthor_device *ptdev,gpu_write64 (ptdev, pwron_reg, mask); - ret =gpu_read64_relaxed_poll_timeout (ptdev, pwrtrans_reg, val, - !(mask & val),100 , timeout_us); + ret =gpu_read64_relaxed_poll_timeout (ptdev, rdy_reg, val, + (mask & val) == val, +100 , timeout_us);if (ret) {drm_err (&ptdev->base,"timeout waiting on %s:%llx readiness" , blk_name, mask);
Signature · 1 line
2.39.5
Quoted 5 lines · Steven Price
panthor_gpu_block_power_on()takes a register offset (rdy_reg) for the purpose of waiting for the power transition to complete. However, a copy/paste error converting to use the new 64 register functions switched it to using thepwrtrans_regregister instead. Fix the function to use the correct register.
Good catch!
Quoted 3 lines
Fixes 4d230aa209ed ("drm/panthor: Add 64-bit and poll register accessors")Signed-off-by Steven Price <[email protected]>
Best regards,
Liviu
Quoted 23 lines
--- drivers/gpu/drm/panthor/panthor_gpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/panthor/panthor_gpu.c +3
-2@@ -297,8 +297,9 @@ int panthor_gpu_block_power_on(struct panthor_device *ptdev,gpu_write64 (ptdev, pwron_reg, mask); - ret =gpu_read64_relaxed_poll_timeout (ptdev, pwrtrans_reg, val, - !(mask & val),100 , timeout_us); + ret =gpu_read64_relaxed_poll_timeout (ptdev, rdy_reg, val, + (mask & val) == val, +100 , timeout_us);if (ret) {drm_err (&ptdev->base,"timeout waiting on %s:%llx readiness" , blk_name, mask);Signature · 1 line
2.39.5
Signature · 8 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯Quoted 8 lines · On Mon, 30 Jun 2025 15:07:02 +0100 Steven Price <[email protected]> wrote:
panthor_gpu_block_power_on()takes a register offset (rdy_reg) for the purpose of waiting for the power transition to complete. However, a copy/paste error converting to use the new 64 register functions switched it to using thepwrtrans_regregister instead. Fix the function to use the correct register.Fixes 4d230aa209ed ("drm/panthor: Add 64-bit and poll register accessors")Signed-off-by Steven Price <[email protected]>
Quoted 20 lines
--- drivers/gpu/drm/panthor/panthor_gpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/panthor/panthor_gpu.c +3
-2@@ -297,8 +297,9 @@ int panthor_gpu_block_power_on(struct panthor_device *ptdev,gpu_write64 (ptdev, pwron_reg, mask); - ret =gpu_read64_relaxed_poll_timeout (ptdev, pwrtrans_reg, val, - !(mask & val),100 , timeout_us); + ret =gpu_read64_relaxed_poll_timeout (ptdev, rdy_reg, val, + (mask & val) == val, +100 , timeout_us);if (ret) {drm_err (&ptdev->base,"timeout waiting on %s:%llx readiness" , blk_name, mask);
Quoted 8 lines · Steven Price
panthor_gpu_block_power_on()takes a register offset (rdy_reg) for the purpose of waiting for the power transition to complete. However, a copy/paste error converting to use the new 64 register functions switched it to using thepwrtrans_regregister instead. Fix the function to use the correct register.Fixes 4d230aa209ed ("drm/panthor: Add 64-bit and poll register accessors")Signed-off-by Steven Price <[email protected]>
Pushed to drm-misc-next.
Thanks,
Steve
Quoted 20 lines
--- drivers/gpu/drm/panthor/panthor_gpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/panthor/panthor_gpu.c +3
-2@@ -297,8 +297,9 @@ int panthor_gpu_block_power_on(struct panthor_device *ptdev,gpu_write64 (ptdev, pwron_reg, mask); - ret =gpu_read64_relaxed_poll_timeout (ptdev, pwrtrans_reg, val, - !(mask & val),100 , timeout_us); + ret =gpu_read64_relaxed_poll_timeout (ptdev, rdy_reg, val, + (mask & val) == val, +100 , timeout_us);if (ret) {drm_err (&ptdev->base,"timeout waiting on %s:%llx readiness" , blk_name, mask);