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

drm/etnaviv: assert GPU lock held in perfmon pipe_*_read functions

The perf counter read functions don't just read registers, but they
also mutate state to direct the reads towards the correct pipe and
engine. Assert that the GPU mutex is held at this point, so that
those state changes don't interfere with others.

Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

+4
+4
drivers/gpu/drm/etnaviv/etnaviv_perfmon.c
··· 62 62 u32 value = 0; 63 63 unsigned i; 64 64 65 + lockdep_assert_held(&gpu->lock); 66 + 65 67 for (i = 0; i < gpu->identity.pixel_pipes; i++) { 66 68 pipe_select(gpu, clock, i); 67 69 value += perf_reg_read(gpu, domain, signal); ··· 82 80 u32 clock = gpu_read(gpu, VIVS_HI_CLOCK_CONTROL); 83 81 u32 value = 0; 84 82 unsigned i; 83 + 84 + lockdep_assert_held(&gpu->lock); 85 85 86 86 for (i = 0; i < gpu->identity.pixel_pipes; i++) { 87 87 pipe_select(gpu, clock, i);