drm/amdgpu/nv: add PCI reset support
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 4 Feb 2021 16:24:00 +0000 (11:24 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Feb 2021 20:30:01 +0000 (15:30 -0500)
Use generic PCI reset for GPU reset if the user specifies
PCI reset as the reset mechanism.  This should in general
only be used for validation.

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

index efacf5f..160fa5f 100644 (file)
@@ -391,7 +391,8 @@ nv_asic_reset_method(struct amdgpu_device *adev)
 
        if (amdgpu_reset_method == AMD_RESET_METHOD_MODE1 ||
            amdgpu_reset_method == AMD_RESET_METHOD_MODE2 ||
-           amdgpu_reset_method == AMD_RESET_METHOD_BACO)
+           amdgpu_reset_method == AMD_RESET_METHOD_BACO ||
+           amdgpu_reset_method == AMD_RESET_METHOD_PCI)
                return amdgpu_reset_method;
 
        if (amdgpu_reset_method != -1)
@@ -423,6 +424,10 @@ static int nv_asic_reset(struct amdgpu_device *adev)
                return 0;
 
        switch (nv_asic_reset_method(adev)) {
+       case AMD_RESET_METHOD_PCI:
+               dev_info(adev->dev, "PCI reset\n");
+               ret = amdgpu_device_pci_reset(adev);
+               break;
        case AMD_RESET_METHOD_BACO:
                dev_info(adev->dev, "BACO reset\n");