Skip to content

Commit 67cb860

Browse files
committed
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>
1 parent 37dc473 commit 67cb860

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/etnaviv/etnaviv_perfmon.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ static u32 pipe_perf_reg_read(struct etnaviv_gpu *gpu,
6262
u32 value = 0;
6363
unsigned i;
6464

65+
lockdep_assert_held(&gpu->lock);
66+
6567
for (i = 0; i < gpu->identity.pixel_pipes; i++) {
6668
pipe_select(gpu, clock, i);
6769
value += perf_reg_read(gpu, domain, signal);
@@ -81,6 +83,8 @@ static u32 pipe_reg_read(struct etnaviv_gpu *gpu,
8183
u32 value = 0;
8284
unsigned i;
8385

86+
lockdep_assert_held(&gpu->lock);
87+
8488
for (i = 0; i < gpu->identity.pixel_pipes; i++) {
8589
pipe_select(gpu, clock, i);
8690
value += gpu_read(gpu, signal->data);

0 commit comments

Comments
 (0)