From eaa55ead5a41ab5fb3ef0561935ffe04453b56a7 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 24 Nov 2021 13:41:30 -0800 Subject: [PATCH] drm/msm/gpu: Add some WARN_ON()s We don't expect either of these conditions to ever be true, so let's get shouty if they are. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20211124214151.1427022-6-robdclark@gmail.com Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c index 7d1ff20..47cb40b 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c @@ -504,6 +504,9 @@ int adreno_gpu_state_get(struct msm_gpu *gpu, struct msm_gpu_state *state) struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); int i, count = 0; + WARN_ON(gpu->needs_hw_init); + WARN_ON(!mutex_is_locked(&gpu->lock)); + kref_init(&state->ref); ktime_get_real_ts64(&state->time); -- 2.7.4