Skip to content

Commit 845f8e5

Browse files
gregkhBrian Maly
authored andcommitted
Revert "drm/amdgpu: rework resume handling for display (v2)"
This reverts commit d897650c5897b3d858ca97ab77d10041e8e34231 which is commit 73dae65 upstream. The original patch 73dae65 (drm/amdgpu: rework resume handling for display (v2)), was only targeted at kernels 6.11 and newer. It did not apply cleanly to 6.12 so I backported it and it backport landed as 99a02eab8251 ("drm/amdgpu: rework resume handling for display (v2)"), however there was a bug in the backport that was subsequently fixed in 063d380ca28e ("drm/amdgpu: fix backport of commit 73dae65"). None of this was intended for kernels older than 6.11, however the original backport eventually landed in 6.6, 6.1, and 5.15. Please revert the change from kernels 6.6, 6.1, and 5.15. Link: https://lore.kernel.org/r/BL1PR12MB5144D5363FCE6F2FD3502534F7E72@BL1PR12MB5144.namprd12.prod.outlook.com Link: https://lore.kernel.org/r/BL1PR12MB51449ADCFBF2314431F8BCFDF7132@BL1PR12MB5144.namprd12.prod.outlook.com Reported-by: Salvatore Bonaccorso <[email protected]> Reported-by: Christian König <[email protected]> Reported-by: Alex Deucher <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit d8ebb991790f008687d0d6af5fc20c7a68905792) FOF: 0225 Signed-off-by: Brian Maly <[email protected]>
1 parent d85d484 commit 845f8e5

File tree

1 file changed

+2
-43
lines changed

1 file changed

+2
-43
lines changed

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

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3197,7 +3197,7 @@ static int amdgpu_device_ip_resume_phase1(struct amdgpu_device *adev)
31973197
*
31983198
* @adev: amdgpu_device pointer
31993199
*
3200-
* Second resume function for hardware IPs. The list of all the hardware
3200+
* First resume function for hardware IPs. The list of all the hardware
32013201
* IPs that make up the asic is walked and the resume callbacks are run for
32023202
* all blocks except COMMON, GMC, and IH. resume puts the hardware into a
32033203
* functional state after a suspend and updates the software state as
@@ -3215,7 +3215,6 @@ static int amdgpu_device_ip_resume_phase2(struct amdgpu_device *adev)
32153215
if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_COMMON ||
32163216
adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC ||
32173217
adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_IH ||
3218-
adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_DCE ||
32193218
adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_PSP)
32203219
continue;
32213220
r = adev->ip_blocks[i].version->funcs->resume(adev);
@@ -3239,36 +3238,6 @@ static int amdgpu_device_ip_resume_phase2(struct amdgpu_device *adev)
32393238
return 0;
32403239
}
32413240

3242-
/**
3243-
* amdgpu_device_ip_resume_phase3 - run resume for hardware IPs
3244-
*
3245-
* @adev: amdgpu_device pointer
3246-
*
3247-
* Third resume function for hardware IPs. The list of all the hardware
3248-
* IPs that make up the asic is walked and the resume callbacks are run for
3249-
* all DCE. resume puts the hardware into a functional state after a suspend
3250-
* and updates the software state as necessary. This function is also used
3251-
* for restoring the GPU after a GPU reset.
3252-
*
3253-
* Returns 0 on success, negative error code on failure.
3254-
*/
3255-
static int amdgpu_device_ip_resume_phase3(struct amdgpu_device *adev)
3256-
{
3257-
int i, r;
3258-
3259-
for (i = 0; i < adev->num_ip_blocks; i++) {
3260-
if (!adev->ip_blocks[i].status.valid || adev->ip_blocks[i].status.hw)
3261-
continue;
3262-
if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_DCE) {
3263-
r = adev->ip_blocks[i].version->funcs->resume(adev);
3264-
if (r)
3265-
return r;
3266-
}
3267-
}
3268-
3269-
return 0;
3270-
}
3271-
32723241
/**
32733242
* amdgpu_device_ip_resume - run resume for hardware IPs
32743243
*
@@ -3299,13 +3268,6 @@ static int amdgpu_device_ip_resume(struct amdgpu_device *adev)
32993268

33003269
r = amdgpu_device_ip_resume_phase2(adev);
33013270

3302-
if (r)
3303-
return r;
3304-
3305-
amdgpu_fence_driver_hw_init(adev);
3306-
3307-
r = amdgpu_device_ip_resume_phase3(adev);
3308-
33093271
return r;
33103272
}
33113273

@@ -4198,6 +4160,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
41984160
dev_err(adev->dev, "amdgpu_device_ip_resume failed (%d).\n", r);
41994161
return r;
42004162
}
4163+
amdgpu_fence_driver_hw_init(adev);
42014164

42024165
r = amdgpu_device_ip_late_init(adev);
42034166
if (r)
@@ -4843,10 +4806,6 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,
48434806
if (r)
48444807
goto out;
48454808

4846-
r = amdgpu_device_ip_resume_phase3(tmp_adev);
4847-
if (r)
4848-
goto out;
4849-
48504809
if (vram_lost)
48514810
amdgpu_device_fill_reset_magic(tmp_adev);
48524811

0 commit comments

Comments
 (0)