]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amdgpu: resolve ras recovery vs smi race condition
authorJohn Clements <john.clements@amd.com>
Wed, 20 May 2020 02:28:51 +0000 (10:28 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 21 May 2020 16:46:51 +0000 (12:46 -0400)
during ras recovery block smu access via smi

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: John Clements <john.clements@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c

index cbf70122de9bd41099e6de1a127fff20c3ceacb3..27c5fc9572b27bba60334706e3ab59b83bd00425 100644 (file)
@@ -623,6 +623,9 @@ static int arcturus_print_clk_levels(struct smu_context *smu,
        struct smu_dpm_context *smu_dpm = &smu->smu_dpm;
        struct arcturus_dpm_table *dpm_table = NULL;
 
+       if (amdgpu_ras_intr_triggered())
+               return snprintf(buf, PAGE_SIZE, "unavailable\n");
+
        dpm_table = smu_dpm->dpm_context;
 
        switch (type) {
@@ -998,6 +1001,9 @@ static int arcturus_read_sensor(struct smu_context *smu,
        PPTable_t *pptable = table_context->driver_pptable;
        int ret = 0;
 
+       if (amdgpu_ras_intr_triggered())
+               return 0;
+
        if (!data || !size)
                return -EINVAL;