]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amd/amdgpu: Remove double lock from gfx v6
authorTom St Denis <tom.stdenis@amd.com>
Wed, 7 Sep 2016 12:03:28 +0000 (08:03 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 14 Sep 2016 13:43:41 +0000 (09:43 -0400)
The function gfx_v6_0_get_cu_info() was taking the
grbm_idx_mutex which was then taken by a dependent
function gfx_v6_0_get_cu_active_bitmap().

This patch removes the select from the parent function
to avoid the double lock.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c

index a6b76170b9c50562e7156220117676300f31efe5..a1484b8f7eb24871fa956ebc7d8ebde96572d3d8 100644 (file)
@@ -3193,13 +3193,11 @@ static void gfx_v6_0_get_cu_info(struct amdgpu_device *adev)
 
        memset(cu_info, 0, sizeof(*cu_info));
 
-       mutex_lock(&adev->grbm_idx_mutex);
        for (i = 0; i < adev->gfx.config.max_shader_engines; i++) {
                for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) {
                        mask = 1;
                        ao_bitmap = 0;
                        counter = 0;
-                       gfx_v6_0_select_se_sh(adev, i, j, 0xffffffff);
                        bitmap = gfx_v6_0_get_cu_active_bitmap(adev, i, j);
                        cu_info->bitmap[i][j] = bitmap;
 
@@ -3215,8 +3213,6 @@ static void gfx_v6_0_get_cu_info(struct amdgpu_device *adev)
                        ao_cu_mask |= (ao_bitmap << (i * 16 + j * 8));
                }
        }
-       gfx_v6_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
-       mutex_unlock(&adev->grbm_idx_mutex);
 
        cu_info->number = active_cu_number;
        cu_info->ao_cu_mask = ao_cu_mask;