Skip to content

Commit b57b477

Browse files
committed
Merge tag 'amd-drm-fixes-6.18-2025-11-06' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-6.18-2025-11-06: amdgpu: - Reset fixes - Misc fixes - Panel scaling fixes - HDMI fix - S0ix fixes - Hibernation fix - Secure display fix - Suspend fix - MST fix amdkfd: - Process cleanup fix Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patch.msgid.link/20251106201326.807230-1-alexander.deucher@amd.com
2 parents 6ec8a47 + 3c6a743 commit b57b477

File tree

18 files changed

+84
-35
lines changed

18 files changed

+84
-35
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,10 @@ static int unmap_bo_from_gpuvm(struct kgd_mem *mem,
12671267

12681268
(void)amdgpu_vm_bo_unmap(adev, bo_va, entry->va);
12691269

1270+
/* VM entity stopped if process killed, don't clear freed pt bo */
1271+
if (!amdgpu_vm_ready(vm))
1272+
return 0;
1273+
12701274
(void)amdgpu_vm_clear_freed(adev, vm, &bo_va->last_pt_update);
12711275

12721276
(void)amdgpu_sync_fence(sync, bo_va->last_pt_update, GFP_KERNEL);

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5243,10 +5243,6 @@ int amdgpu_device_suspend(struct drm_device *dev, bool notify_clients)
52435243
if (amdgpu_sriov_vf(adev))
52445244
amdgpu_virt_release_full_gpu(adev, false);
52455245

5246-
r = amdgpu_dpm_notify_rlc_state(adev, false);
5247-
if (r)
5248-
return r;
5249-
52505246
return 0;
52515247
}
52525248

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,9 +2632,14 @@ static int amdgpu_pmops_suspend_noirq(struct device *dev)
26322632
{
26332633
struct drm_device *drm_dev = dev_get_drvdata(dev);
26342634
struct amdgpu_device *adev = drm_to_adev(drm_dev);
2635+
int r;
26352636

2636-
if (amdgpu_acpi_should_gpu_reset(adev))
2637-
return amdgpu_asic_reset(adev);
2637+
if (amdgpu_acpi_should_gpu_reset(adev)) {
2638+
amdgpu_device_lock_reset_domain(adev->reset_domain);
2639+
r = amdgpu_asic_reset(adev);
2640+
amdgpu_device_unlock_reset_domain(adev->reset_domain);
2641+
return r;
2642+
}
26382643

26392644
return 0;
26402645
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2355,8 +2355,11 @@ static int psp_securedisplay_initialize(struct psp_context *psp)
23552355
if (!ret && !psp->securedisplay_context.context.resp_status) {
23562356
psp->securedisplay_context.context.initialized = true;
23572357
mutex_init(&psp->securedisplay_context.mutex);
2358-
} else
2358+
} else {
2359+
/* don't try again */
2360+
psp->securedisplay_context.context.bin_desc.size_bytes = 0;
23592361
return ret;
2362+
}
23602363

23612364
mutex_lock(&psp->securedisplay_context.mutex);
23622365

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,8 @@ static int aqua_vanjaram_switch_partition_mode(struct amdgpu_xcp_mgr *xcp_mgr,
407407
return -EINVAL;
408408
}
409409

410-
if (adev->kfd.init_complete && !amdgpu_in_reset(adev))
410+
if (adev->kfd.init_complete && !amdgpu_in_reset(adev) &&
411+
!adev->in_suspend)
411412
flags |= AMDGPU_XCP_OPS_KFD;
412413

413414
if (flags & AMDGPU_XCP_OPS_KFD) {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3102,6 +3102,11 @@ static int gfx_v6_0_sw_init(struct amdgpu_ip_block *ip_block)
31023102
return r;
31033103
}
31043104

3105+
adev->gfx.gfx_supported_reset =
3106+
amdgpu_get_soft_full_reset_mask(&adev->gfx.gfx_ring[0]);
3107+
adev->gfx.compute_supported_reset =
3108+
amdgpu_get_soft_full_reset_mask(&adev->gfx.compute_ring[0]);
3109+
31053110
return r;
31063111
}
31073112

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4399,6 +4399,11 @@ static int gfx_v7_0_sw_init(struct amdgpu_ip_block *ip_block)
43994399

44004400
gfx_v7_0_gpu_early_init(adev);
44014401

4402+
adev->gfx.gfx_supported_reset =
4403+
amdgpu_get_soft_full_reset_mask(&adev->gfx.gfx_ring[0]);
4404+
adev->gfx.compute_supported_reset =
4405+
amdgpu_get_soft_full_reset_mask(&adev->gfx.compute_ring[0]);
4406+
44024407
return r;
44034408
}
44044409

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,6 +2023,11 @@ static int gfx_v8_0_sw_init(struct amdgpu_ip_block *ip_block)
20232023
if (r)
20242024
return r;
20252025

2026+
adev->gfx.gfx_supported_reset =
2027+
amdgpu_get_soft_full_reset_mask(&adev->gfx.gfx_ring[0]);
2028+
adev->gfx.compute_supported_reset =
2029+
amdgpu_get_soft_full_reset_mask(&adev->gfx.compute_ring[0]);
2030+
20262031
return 0;
20272032
}
20282033

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2292,7 +2292,9 @@ static int gfx_v9_4_3_cp_resume(struct amdgpu_device *adev)
22922292
r = amdgpu_xcp_init(adev->xcp_mgr, num_xcp, mode);
22932293

22942294
} else {
2295-
if (amdgpu_xcp_query_partition_mode(adev->xcp_mgr,
2295+
if (adev->in_suspend)
2296+
amdgpu_xcp_restore_partition_mode(adev->xcp_mgr);
2297+
else if (amdgpu_xcp_query_partition_mode(adev->xcp_mgr,
22962298
AMDGPU_XCP_FL_NONE) ==
22972299
AMDGPU_UNKNOWN_COMPUTE_PARTITION_MODE)
22982300
r = amdgpu_xcp_switch_partition_mode(

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,37 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)
142142
return err;
143143
}
144144

145-
static int psp_v11_0_wait_for_bootloader(struct psp_context *psp)
145+
static int psp_v11_wait_for_tos_unload(struct psp_context *psp)
146146
{
147147
struct amdgpu_device *adev = psp->adev;
148+
uint32_t sol_reg1, sol_reg2;
149+
int retry_loop;
148150

151+
/* Wait for the TOS to be unloaded */
152+
for (retry_loop = 0; retry_loop < 20; retry_loop++) {
153+
sol_reg1 = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81);
154+
usleep_range(1000, 2000);
155+
sol_reg2 = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81);
156+
if (sol_reg1 == sol_reg2)
157+
return 0;
158+
}
159+
dev_err(adev->dev, "TOS unload failed, C2PMSG_33: %x C2PMSG_81: %x",
160+
RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_33),
161+
RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81));
162+
163+
return -ETIME;
164+
}
165+
166+
static int psp_v11_0_wait_for_bootloader(struct psp_context *psp)
167+
{
168+
struct amdgpu_device *adev = psp->adev;
149169
int ret;
150170
int retry_loop;
151171

172+
/* For a reset done at the end of S3, only wait for TOS to be unloaded */
173+
if (adev->in_s3 && !(adev->flags & AMD_IS_APU) && amdgpu_in_reset(adev))
174+
return psp_v11_wait_for_tos_unload(psp);
175+
152176
for (retry_loop = 0; retry_loop < 20; retry_loop++) {
153177
/* Wait for bootloader to signify that is
154178
ready having bit 31 of C2PMSG_35 set to 1 */

0 commit comments

Comments
 (0)