MGS-6197 [#imx-2532] GPU crash when changing gpu_govern mode
authorNicușor Cîțu <nicusor.citu@nxp.com>
Wed, 21 Apr 2021 07:54:20 +0000 (10:54 +0300)
committerNicușor Cîțu <nicusor.citu@nxp.com>
Wed, 12 May 2021 11:27:24 +0000 (14:27 +0300)
commitea9443b6f8fa426975a428fd7078f11c9c3998a0
tree78bf90a2e512e7e763011585e7b2dc219729192c
parent68407e8f621548a25914112355799a6f864a1c2a
MGS-6197 [#imx-2532] GPU crash when changing gpu_govern mode

The suspend will acquire the global semaphore, and a later gcvPOWER_ON_AUTO
determined by a new commit will wait for global semaphore until a GPU resume
(power ON) release the global semaphore, then the gcvPOWER_ON_AUTO will
continue to run. But during the stress test, the sequence might change.
For example:
1. GPU goes to suspend; if a new commit comes then gcvPOWER_ON_AUTO will
wait for global semaphore.
2. GPU goes to resume, a global power ON will release the global semaphore,
gcvPOWER_ON_AUTO acquire the global semaphore successfully but will release
it by itself because gcvPOWER_ON_AUTO is not a global state and it won't
occupy a global semaphore.
3. The next GPU suspend will also acquire the global semaphore successfully.
As the GPU suspend and gcvPOWER_ON_AUTO are in two threads, there is a certain
probability that suspend is executed first, then gcvPOWER_ON_AUTO, so that the
later GPU stall (from suspend) will occur at the same time with new
commit abd will cause the GPU hang.

Suggested-by: Zhe Pan <Zhe.Pan@verisilicon.com>
Signed-off-by: Nicușor Cîțu <nicusor.citu@nxp.com>
drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c