Commit af484df8 authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu: add generic pci reset as an option

This allows us to use generic PCI reset mechanisms (FLR, SBR) as
a reset mechanism to verify that the generic PCI reset mechanisms
are working properly.
Acked-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d5ab0669
...@@ -579,7 +579,8 @@ enum amd_reset_method { ...@@ -579,7 +579,8 @@ enum amd_reset_method {
AMD_RESET_METHOD_MODE0, AMD_RESET_METHOD_MODE0,
AMD_RESET_METHOD_MODE1, AMD_RESET_METHOD_MODE1,
AMD_RESET_METHOD_MODE2, AMD_RESET_METHOD_MODE2,
AMD_RESET_METHOD_BACO AMD_RESET_METHOD_BACO,
AMD_RESET_METHOD_PCI,
}; };
/* /*
...@@ -1228,6 +1229,7 @@ bool amdgpu_device_should_recover_gpu(struct amdgpu_device *adev); ...@@ -1228,6 +1229,7 @@ bool amdgpu_device_should_recover_gpu(struct amdgpu_device *adev);
int amdgpu_device_gpu_recover(struct amdgpu_device *adev, int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
struct amdgpu_job* job); struct amdgpu_job* job);
void amdgpu_device_pci_config_reset(struct amdgpu_device *adev); void amdgpu_device_pci_config_reset(struct amdgpu_device *adev);
int amdgpu_device_pci_reset(struct amdgpu_device *adev);
bool amdgpu_device_need_post(struct amdgpu_device *adev); bool amdgpu_device_need_post(struct amdgpu_device *adev);
void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes, void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes,
......
...@@ -929,6 +929,18 @@ void amdgpu_device_pci_config_reset(struct amdgpu_device *adev) ...@@ -929,6 +929,18 @@ void amdgpu_device_pci_config_reset(struct amdgpu_device *adev)
pci_write_config_dword(adev->pdev, 0x7c, AMDGPU_ASIC_RESET_DATA); pci_write_config_dword(adev->pdev, 0x7c, AMDGPU_ASIC_RESET_DATA);
} }
/**
* amdgpu_device_pci_reset - reset the GPU using generic PCI means
*
* @adev: amdgpu_device pointer
*
* Resets the GPU using generic pci reset interfaces (FLR, SBR, etc.).
*/
int amdgpu_device_pci_reset(struct amdgpu_device *adev)
{
return pci_reset_function(adev->pdev);
}
/* /*
* GPU doorbell aperture helpers function. * GPU doorbell aperture helpers function.
*/ */
......
...@@ -793,9 +793,9 @@ module_param_named(tmz, amdgpu_tmz, int, 0444); ...@@ -793,9 +793,9 @@ module_param_named(tmz, amdgpu_tmz, int, 0444);
/** /**
* DOC: reset_method (int) * DOC: reset_method (int)
* GPU reset method (-1 = auto (default), 0 = legacy, 1 = mode0, 2 = mode1, 3 = mode2, 4 = baco) * GPU reset method (-1 = auto (default), 0 = legacy, 1 = mode0, 2 = mode1, 3 = mode2, 4 = baco, 5 = pci)
*/ */
MODULE_PARM_DESC(reset_method, "GPU reset method (-1 = auto (default), 0 = legacy, 1 = mode0, 2 = mode1, 3 = mode2, 4 = baco/bamaco)"); MODULE_PARM_DESC(reset_method, "GPU reset method (-1 = auto (default), 0 = legacy, 1 = mode0, 2 = mode1, 3 = mode2, 4 = baco/bamaco, 5 = pci)");
module_param_named(reset_method, amdgpu_reset_method, int, 0444); module_param_named(reset_method, amdgpu_reset_method, int, 0444);
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment