Skip to content

Commit

Permalink
drm/amdgpu: Fix pci state save during mode-1 reset
Browse files Browse the repository at this point in the history
[ Upstream commit 74fa02c ]

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 <lijo.lazar@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Lijo Lazar authored and gregkh committed Jul 5, 2024
1 parent 87a2448 commit 09f64e7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -4763,11 +4763,14 @@ int amdgpu_device_mode1_reset(struct amdgpu_device *adev)

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

/* Cache the state before bus master disable. The saved config space
* values are used in other cases like restore after mode-2 reset.
*/
amdgpu_device_cache_pci_state(adev->pdev);

/* disable BM */
pci_clear_master(adev->pdev);

amdgpu_device_cache_pci_state(adev->pdev);

if (amdgpu_dpm_is_mode1_reset_supported(adev)) {
dev_info(adev->dev, "GPU smu mode1 reset\n");
ret = amdgpu_dpm_mode1_reset(adev);
Expand Down

0 comments on commit 09f64e7

Please sign in to comment.