Skip to content

Commit 0dd9c51

Browse files
committed
Merge tag 'amd-drm-fixes-6.5-2023-07-26' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-6.5-2023-07-26: amdgpu: - gfxhub partition fix - Fix error handling in psp_sw_init() - SMU13 fix - DCN 3.1 fix - DCN 3.2 fix - Fix for display PHY programming sequence - DP MST error handling fix - GFX 9.4.3 fix amdkfd: - GFX11 trap handling fix Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 75da46c + bc1688f commit 0dd9c51

File tree

11 files changed

+27
-19
lines changed

11 files changed

+27
-19
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,11 +498,11 @@ static int psp_sw_init(void *handle)
498498
return 0;
499499

500500
failed2:
501-
amdgpu_bo_free_kernel(&psp->fw_pri_bo,
502-
&psp->fw_pri_mc_addr, &psp->fw_pri_buf);
503-
failed1:
504501
amdgpu_bo_free_kernel(&psp->fence_buf_bo,
505502
&psp->fence_buf_mc_addr, &psp->fence_buf);
503+
failed1:
504+
amdgpu_bo_free_kernel(&psp->fw_pri_bo,
505+
&psp->fw_pri_mc_addr, &psp->fw_pri_buf);
506506
return ret;
507507
}
508508

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ MODULE_FIRMWARE("amdgpu/gc_9_4_3_rlc.bin");
4646
#define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L
4747

4848
#define GOLDEN_GB_ADDR_CONFIG 0x2a114042
49+
#define CP_HQD_PERSISTENT_STATE_DEFAULT 0xbe05301
4950

5051
struct amdgpu_gfx_ras gfx_v9_4_3_ras;
5152

@@ -1736,7 +1737,7 @@ static int gfx_v9_4_3_xcc_q_fini_register(struct amdgpu_ring *ring,
17361737

17371738
WREG32_SOC15_RLC(GC, GET_INST(GC, xcc_id), regCP_HQD_IQ_TIMER, 0);
17381739
WREG32_SOC15_RLC(GC, GET_INST(GC, xcc_id), regCP_HQD_IB_CONTROL, 0);
1739-
WREG32_SOC15_RLC(GC, GET_INST(GC, xcc_id), regCP_HQD_PERSISTENT_STATE, 0);
1740+
WREG32_SOC15_RLC(GC, GET_INST(GC, xcc_id), regCP_HQD_PERSISTENT_STATE, CP_HQD_PERSISTENT_STATE_DEFAULT);
17401741
WREG32_SOC15_RLC(GC, GET_INST(GC, xcc_id), regCP_HQD_PQ_DOORBELL_CONTROL, 0x40000000);
17411742
WREG32_SOC15_RLC(GC, GET_INST(GC, xcc_id), regCP_HQD_PQ_DOORBELL_CONTROL, 0);
17421743
WREG32_SOC15_RLC(GC, GET_INST(GC, xcc_id), regCP_HQD_PQ_RPTR, 0);

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,18 +402,15 @@ static void gfxhub_v1_2_xcc_program_invalidation(struct amdgpu_device *adev,
402402
static int gfxhub_v1_2_xcc_gart_enable(struct amdgpu_device *adev,
403403
uint32_t xcc_mask)
404404
{
405-
uint32_t tmp_mask;
406405
int i;
407406

408-
tmp_mask = xcc_mask;
409407
/*
410408
* MC_VM_FB_LOCATION_BASE/TOP is NULL for VF, because they are
411409
* VF copy registers so vbios post doesn't program them, for
412410
* SRIOV driver need to program them
413411
*/
414412
if (amdgpu_sriov_vf(adev)) {
415-
for_each_inst(i, tmp_mask) {
416-
i = ffs(tmp_mask) - 1;
413+
for_each_inst(i, xcc_mask) {
417414
WREG32_SOC15_RLC(GC, GET_INST(GC, i), regMC_VM_FB_LOCATION_BASE,
418415
adev->gmc.vram_start >> 24);
419416
WREG32_SOC15_RLC(GC, GET_INST(GC, i), regMC_VM_FB_LOCATION_TOP,

drivers/gpu/drm/amd/amdkfd/kfd_debug.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,7 @@ static int kfd_dbg_set_queue_workaround(struct queue *q, bool enable)
302302
if (!q)
303303
return 0;
304304

305-
if (KFD_GC_VERSION(q->device) < IP_VERSION(11, 0, 0) ||
306-
KFD_GC_VERSION(q->device) >= IP_VERSION(12, 0, 0))
305+
if (!kfd_dbg_has_cwsr_workaround(q->device))
307306
return 0;
308307

309308
if (enable && q->properties.is_user_cu_masked)
@@ -349,7 +348,7 @@ int kfd_dbg_set_mes_debug_mode(struct kfd_process_device *pdd)
349348
{
350349
uint32_t spi_dbg_cntl = pdd->spi_dbg_override | pdd->spi_dbg_launch_mode;
351350
uint32_t flags = pdd->process->dbg_flags;
352-
bool sq_trap_en = !!spi_dbg_cntl;
351+
bool sq_trap_en = !!spi_dbg_cntl || !kfd_dbg_has_cwsr_workaround(pdd->dev);
353352

354353
if (!kfd_dbg_is_per_vmid_supported(pdd->dev))
355354
return 0;

drivers/gpu/drm/amd/amdkfd/kfd_debug.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ static inline bool kfd_dbg_is_rlc_restore_supported(struct kfd_node *dev)
100100
KFD_GC_VERSION(dev) == IP_VERSION(10, 1, 1));
101101
}
102102

103+
static inline bool kfd_dbg_has_cwsr_workaround(struct kfd_node *dev)
104+
{
105+
return KFD_GC_VERSION(dev) >= IP_VERSION(11, 0, 0) &&
106+
KFD_GC_VERSION(dev) <= IP_VERSION(11, 0, 3);
107+
}
108+
103109
static inline bool kfd_dbg_has_gws_support(struct kfd_node *dev)
104110
{
105111
if ((KFD_GC_VERSION(dev) == IP_VERSION(9, 0, 1)

drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ static int add_queue_mes(struct device_queue_manager *dqm, struct queue *q,
226226
queue_input.paging = false;
227227
queue_input.tba_addr = qpd->tba_addr;
228228
queue_input.tma_addr = qpd->tma_addr;
229-
queue_input.trap_en = KFD_GC_VERSION(q->device) < IP_VERSION(11, 0, 0) ||
230-
KFD_GC_VERSION(q->device) > IP_VERSION(11, 0, 3);
229+
queue_input.trap_en = !kfd_dbg_has_cwsr_workaround(q->device);
231230
queue_input.skip_process_ctx_clear = qpd->pqm->process->debug_trap_enabled;
232231

233232
queue_type = convert_to_mes_queue_type(q->properties.type);
@@ -1806,8 +1805,7 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
18061805
*/
18071806
q->properties.is_evicted = !!qpd->evicted;
18081807
q->properties.is_dbg_wa = qpd->pqm->process->debug_trap_enabled &&
1809-
KFD_GC_VERSION(q->device) >= IP_VERSION(11, 0, 0) &&
1810-
KFD_GC_VERSION(q->device) <= IP_VERSION(11, 0, 3);
1808+
kfd_dbg_has_cwsr_workaround(q->device);
18111809

18121810
if (qd)
18131811
mqd_mgr->restore_mqd(mqd_mgr, &q->mqd, q->mqd_mem_obj, &q->gart_mqd_addr,

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ void dm_handle_mst_sideband_msg_ready_event(
706706

707707
if (retry == 3) {
708708
DRM_ERROR("Failed to ack MST event.\n");
709-
return;
709+
break;
710710
}
711711

712712
drm_dp_mst_hpd_irq_send_new_request(&aconnector->mst_mgr);

drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,10 +1792,13 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
17921792
hws->funcs.edp_backlight_control(edp_link_with_sink, false);
17931793
}
17941794
/*resume from S3, no vbios posting, no need to power down again*/
1795+
clk_mgr_exit_optimized_pwr_state(dc, dc->clk_mgr);
1796+
17951797
power_down_all_hw_blocks(dc);
17961798
disable_vga_and_power_gate_all_controllers(dc);
17971799
if (edp_link_with_sink && !keep_edp_vdd_on)
17981800
dc->hwss.edp_power_control(edp_link_with_sink, false);
1801+
clk_mgr_optimize_pwr_state(dc, dc->clk_mgr);
17991802
}
18001803
bios_set_scratch_acc_mode_change(dc->ctx->dc_bios, 1);
18011804
}

drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dccg.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ static enum phyd32clk_clock_source get_phy_mux_symclk(
8484
struct dcn_dccg *dccg_dcn,
8585
enum phyd32clk_clock_source src)
8686
{
87-
if (dccg_dcn->base.ctx->asic_id.hw_internal_rev == YELLOW_CARP_B0) {
87+
if (dccg_dcn->base.ctx->asic_id.chip_family == FAMILY_YELLOW_CARP &&
88+
dccg_dcn->base.ctx->asic_id.hw_internal_rev == YELLOW_CARP_B0) {
8889
if (src == PHYD32CLKC)
8990
src = PHYD32CLKF;
9091
if (src == PHYD32CLKD)

drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ static void dccg32_trigger_dio_fifo_resync(
4949
uint32_t dispclk_rdivider_value = 0;
5050

5151
REG_GET(DENTIST_DISPCLK_CNTL, DENTIST_DISPCLK_RDIVIDER, &dispclk_rdivider_value);
52-
REG_UPDATE(DENTIST_DISPCLK_CNTL, DENTIST_DISPCLK_WDIVIDER, dispclk_rdivider_value);
52+
53+
/* Not valid for the WDIVIDER to be set to 0 */
54+
if (dispclk_rdivider_value != 0)
55+
REG_UPDATE(DENTIST_DISPCLK_CNTL, DENTIST_DISPCLK_WDIVIDER, dispclk_rdivider_value);
5356
}
5457

5558
static void dccg32_get_pixel_rate_div(

0 commit comments

Comments
 (0)