]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/amdgpu/vi: minor clean up of reset code
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 4 Feb 2021 15:45:40 +0000 (10:45 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Feb 2021 20:29:52 +0000 (15:29 -0500)
Drop duplicate reset method logging, whitespace changes.

Acked-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vi.c

index d56b474b3a219f26767a55c6866a0dbd6cc76599..eafb76aebd004e3b1717d2499a271d5377152001 100644 (file)
@@ -642,11 +642,21 @@ static int vi_read_register(struct amdgpu_device *adev, u32 se_num,
        return -EINVAL;
 }
 
-static int vi_gpu_pci_config_reset(struct amdgpu_device *adev)
+/**
+ * vi_asic_pci_config_reset - soft reset GPU
+ *
+ * @adev: amdgpu_device pointer
+ *
+ * Use PCI Config method to reset the GPU.
+ *
+ * Returns 0 for success.
+ */
+static int vi_asic_pci_config_reset(struct amdgpu_device *adev)
 {
        u32 i;
+       int r = -EINVAL;
 
-       dev_info(adev->dev, "GPU pci config reset\n");
+       amdgpu_atombios_scratch_regs_engine_hung(adev, true);
 
        /* disable BM */
        pci_clear_master(adev->pdev);
@@ -661,29 +671,11 @@ static int vi_gpu_pci_config_reset(struct amdgpu_device *adev)
                        /* enable BM */
                        pci_set_master(adev->pdev);
                        adev->has_hw_reset = true;
-                       return 0;
+                       r = 0;
+                       break;
                }
                udelay(1);
        }
-       return -EINVAL;
-}
-
-/**
- * vi_asic_pci_config_reset - soft reset GPU
- *
- * @adev: amdgpu_device pointer
- *
- * Use PCI Config method to reset the GPU.
- *
- * Returns 0 for success.
- */
-static int vi_asic_pci_config_reset(struct amdgpu_device *adev)
-{
-       int r;
-
-       amdgpu_atombios_scratch_regs_engine_hung(adev, true);
-
-       r = vi_gpu_pci_config_reset(adev);
 
        amdgpu_atombios_scratch_regs_engine_hung(adev, false);