Skip to content

Commit 74fa02c

Browse files
Lijo Lazaralexdeucher
authored andcommitted
drm/amdgpu: Fix pci state save during mode-1 reset
Cache the PCI state before bus master is disabled. The saved state is later used for other cases like restoring config space after mode-2 reset. Fixes: 5c03e58 ("drm/amdgpu:add smu mode1/2 support for aldebaran") Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Feifei Xu <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent f6f49dd commit 74fa02c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5220,11 +5220,14 @@ int amdgpu_device_mode1_reset(struct amdgpu_device *adev)
52205220

52215221
dev_info(adev->dev, "GPU mode1 reset\n");
52225222

5223+
/* Cache the state before bus master disable. The saved config space
5224+
* values are used in other cases like restore after mode-2 reset.
5225+
*/
5226+
amdgpu_device_cache_pci_state(adev->pdev);
5227+
52235228
/* disable BM */
52245229
pci_clear_master(adev->pdev);
52255230

5226-
amdgpu_device_cache_pci_state(adev->pdev);
5227-
52285231
if (amdgpu_dpm_is_mode1_reset_supported(adev)) {
52295232
dev_info(adev->dev, "GPU smu mode1 reset\n");
52305233
ret = amdgpu_dpm_mode1_reset(adev);

0 commit comments

Comments
 (0)