Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] drm/panthor: AW state machine wedges in STOPPED_IDLE on ENOSPC --
commit fc59dcd4da161e6f76c5425461851d01153db172 Author: Karunika Choo <[email protected]> drm/panthor: Release GPU access immediately for out-of-band grants This commit modifies the window-opened IRQ handler to immediately release the GPU access when a late grant arrives for a request that has already timed out and returned to the READY state. > 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); [Severity: High] If panthor_aw_send_msg() drops the message due to the 4-entry message FIFO being full (-ENOSPC), does the state machine become permanently wedged in PANTHOR_AW_STATE_STOPPED_IDLE? Looking at panthor_aw_send_msg(), if the send FIFO is full, it returns -ENOSPC and simply logs an error without retrying. Because this runs in the atomic context of panthor_aw_irq_raw_hander(), it lacks the wait-and-revert timeout fallback that thread-context callers use. Since the state was already transitioned to PANTHOR_AW_STATE_STOPPED_IDLE before the message was sent, dropping the message means the hardware is never told to stop and the software state never reverts to PANTHOR_AW_STATE_READY. This could cause all future GPU requests to timeout indefinitely under heavy GPU load. > } > > static irqreturn_t panthor_aw_irq_raw_hander(int irq, void *data) -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=27
