A late grant can arrive after the request has timed out and the access window has returned to READY. Report GPU_STOPPED so the arbiter can release the unused grant.
Signed-off-by: Karunika Choo <[email protected]> --- drivers/gpu/drm/panthor/panthor_aw.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panthor/panthor_aw.c b/drivers/gpu/drm/panthor/panthor_aw.c index 7ef13db4acf50..27787c0b2f3a2 100644 --- a/drivers/gpu/drm/panthor/panthor_aw.c +++ b/drivers/gpu/drm/panthor/panthor_aw.c @@ -282,8 +282,13 @@ static void panthor_aw_handle_window_opened(struct panthor_aw *aw) return; /* Window opened due to GPU_REQUEST */ - panthor_aw_state_try_set(aw, PANTHOR_AW_STATE_GPU_REQUEST, - PANTHOR_AW_STATE_GPU_GRANTED); + if (panthor_aw_state_try_set(aw, PANTHOR_AW_STATE_GPU_REQUEST, + PANTHOR_AW_STATE_GPU_GRANTED)) + return; + + if (panthor_aw_state_try_set(aw, PANTHOR_AW_STATE_READY, + PANTHOR_AW_STATE_STOPPED_IDLE)) + panthor_aw_send_msg(aw, VM_ARB_GPU_STOPPED); } static irqreturn_t panthor_aw_irq_raw_hander(int irq, void *data) -- 2.43.0
