1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

amd-drm-fixes-6.14-2025-02-13:

amdgpu:
 - Fix shutdown regression on old APUs
 - Fix compute queue hang on gfx9 APUs
 - Fix possible invalid access in PSP failure path
 - Avoid possible buffer overflow in pptable override
 
 amdkfd:
 - Properly free gang bo in failure path
 - GFX12 trap handler fix
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQgO5Idg2tXNTSZAr293/aFa7yZ2AUCZ64QYgAKCRC93/aFa7yZ
 2E4uAPoCIug8zq4eyn2FIke05YUsKIleaWqnyfx5lOxE0liX6AEAqVjST+WNWmjx
 6vC1MAOUitiVjOjLcsGIHG+xXK2T0Ak=
 =H/SZ
 -----END PGP SIGNATURE-----

Merge tag 'amd-drm-fixes-6.14-2025-02-13' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes

amd-drm-fixes-6.14-2025-02-13:

amdgpu:
- Fix shutdown regression on old APUs
- Fix compute queue hang on gfx9 APUs
- Fix possible invalid access in PSP failure path
- Avoid possible buffer overflow in pptable override

amdkfd:
- Properly free gang bo in failure path
- GFX12 trap handler fix

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250213153843.242640-1-alexander.deucher@amd.com
This commit is contained in:
Dave Airlie 2025-02-14 11:54:19 +10:00
commit 981724b463
8 changed files with 49 additions and 9 deletions

View file

@ -120,9 +120,10 @@
* - 3.58.0 - Add GFX12 DCC support
* - 3.59.0 - Cleared VRAM
* - 3.60.0 - Add AMDGPU_TILING_GFX12_DCC_WRITE_COMPRESS_DISABLE (Vulkan requirement)
* - 3.61.0 - Contains fix for RV/PCO compute queues
*/
#define KMS_DRIVER_MAJOR 3
#define KMS_DRIVER_MINOR 60
#define KMS_DRIVER_MINOR 61
#define KMS_DRIVER_PATCHLEVEL 0
/*

View file

@ -3815,9 +3815,10 @@ int psp_init_cap_microcode(struct psp_context *psp, const char *chip_name)
if (err == -ENODEV) {
dev_warn(adev->dev, "cap microcode does not exist, skip\n");
err = 0;
goto out;
} else {
dev_err(adev->dev, "fail to initialize cap microcode\n");
}
dev_err(adev->dev, "fail to initialize cap microcode\n");
goto out;
}
info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CAP];

View file

@ -7437,6 +7437,38 @@ static void gfx_v9_0_ring_emit_cleaner_shader(struct amdgpu_ring *ring)
amdgpu_ring_write(ring, 0); /* RESERVED field, programmed to zero */
}
static void gfx_v9_0_ring_begin_use_compute(struct amdgpu_ring *ring)
{
struct amdgpu_device *adev = ring->adev;
struct amdgpu_ip_block *gfx_block =
amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_GFX);
amdgpu_gfx_enforce_isolation_ring_begin_use(ring);
/* Raven and PCO APUs seem to have stability issues
* with compute and gfxoff and gfx pg. Disable gfx pg during
* submission and allow again afterwards.
*/
if (gfx_block && amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 1, 0))
gfx_v9_0_set_powergating_state(gfx_block, AMD_PG_STATE_UNGATE);
}
static void gfx_v9_0_ring_end_use_compute(struct amdgpu_ring *ring)
{
struct amdgpu_device *adev = ring->adev;
struct amdgpu_ip_block *gfx_block =
amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_GFX);
/* Raven and PCO APUs seem to have stability issues
* with compute and gfxoff and gfx pg. Disable gfx pg during
* submission and allow again afterwards.
*/
if (gfx_block && amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 1, 0))
gfx_v9_0_set_powergating_state(gfx_block, AMD_PG_STATE_GATE);
amdgpu_gfx_enforce_isolation_ring_end_use(ring);
}
static const struct amd_ip_funcs gfx_v9_0_ip_funcs = {
.name = "gfx_v9_0",
.early_init = gfx_v9_0_early_init,
@ -7613,8 +7645,8 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = {
.emit_wave_limit = gfx_v9_0_emit_wave_limit,
.reset = gfx_v9_0_reset_kcq,
.emit_cleaner_shader = gfx_v9_0_ring_emit_cleaner_shader,
.begin_use = amdgpu_gfx_enforce_isolation_ring_begin_use,
.end_use = amdgpu_gfx_enforce_isolation_ring_end_use,
.begin_use = gfx_v9_0_ring_begin_use_compute,
.end_use = gfx_v9_0_ring_end_use_compute,
};
static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_kiq = {

View file

@ -4121,7 +4121,8 @@ static const uint32_t cwsr_trap_gfx12_hex[] = {
0x0000ffff, 0x8bfe7e7e,
0x8bea6a6a, 0xb97af804,
0xbe804ec2, 0xbf94fffe,
0xbe804a6c, 0xbfb10000,
0xbe804a6c, 0xbe804ec2,
0xbf94fffe, 0xbfb10000,
0xbf9f0000, 0xbf9f0000,
0xbf9f0000, 0xbf9f0000,
0xbf9f0000, 0x00000000,

View file

@ -1049,6 +1049,10 @@ L_SKIP_BARRIER_RESTORE:
s_rfe_b64 s_restore_pc_lo //Return to the main shader program and resume execution
L_END_PGM:
// Make sure that no wave of the workgroup can exit the trap handler
// before the workgroup barrier state is saved.
s_barrier_signal -2
s_barrier_wait -2
s_endpgm_saved
end

View file

@ -300,7 +300,7 @@ static int init_user_queue(struct process_queue_manager *pqm,
return 0;
free_gang_ctx_bo:
amdgpu_amdkfd_free_gtt_mem(dev->adev, (*q)->gang_ctx_bo);
amdgpu_amdkfd_free_gtt_mem(dev->adev, &(*q)->gang_ctx_bo);
cleanup:
uninit_queue(*q);
*q = NULL;

View file

@ -78,7 +78,7 @@ int amdgpu_dpm_set_powergating_by_smu(struct amdgpu_device *adev,
int ret = 0;
const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
enum ip_power_state pwr_state = gate ? POWER_STATE_OFF : POWER_STATE_ON;
bool is_vcn = (block_type == AMD_IP_BLOCK_TYPE_UVD || block_type == AMD_IP_BLOCK_TYPE_VCN);
bool is_vcn = block_type == AMD_IP_BLOCK_TYPE_VCN;
if (atomic_read(&adev->pm.pwr_state[block_type]) == pwr_state &&
(!is_vcn || adev->vcn.num_vcn_inst == 1)) {

View file

@ -612,7 +612,8 @@ static int smu_sys_set_pp_table(void *handle,
return -EIO;
}
if (!smu_table->hardcode_pptable) {
if (!smu_table->hardcode_pptable || smu_table->power_play_table_size < size) {
kfree(smu_table->hardcode_pptable);
smu_table->hardcode_pptable = kzalloc(size, GFP_KERNEL);
if (!smu_table->hardcode_pptable)
return -ENOMEM;