Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/rockchip: Fix up bug in psr state machine

The ->set() callback would always be called when transitioning
from FLUSH->DISABLE since we assign state to psr->state right
above the skip condition.

Reported-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>

+5 -3
+5 -3
drivers/gpu/drm/rockchip/rockchip_drm_psr.c
··· 71 71 if (state == psr->state || !psr->active) 72 72 return; 73 73 74 - psr->state = state; 75 - 76 74 /* Already disabled in flush, change the state, but not the hardware */ 77 - if (state == PSR_DISABLE && psr->state == PSR_FLUSH) 75 + if (state == PSR_DISABLE && psr->state == PSR_FLUSH) { 76 + psr->state = state; 78 77 return; 78 + } 79 + 80 + psr->state = state; 79 81 80 82 /* Actually commit the state change to hardware */ 81 83 switch (psr->state) {