drm/amdgpu: Add UTCL2 Retry fault interrupt for GFX 12.1
Subsystems (3)
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: Add UTCL2 Retry fault interrupt for GFX 12.1
From: Mukul Joshi <[email protected]>
Add the UTCL2 retry fault interrupt for both GCVM and MMVM for GFX 12.1.
--- drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 19 +++++++++++++++++-- .../amd/include/ivsrcid/vmc/irqsrcs_vmc_1_0.h | 2 ++ 2 files changed, 19 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c +17 -2
@@ -656,6 +656,7 @@ static int gmc_v12_0_early_init(struct amdgpu_ip_block *ip_block) adev->gmc.private_aperture_start =0x1000000000000000ULL ; adev->gmc.private_aperture_end = adev->gmc.private_aperture_start + (4ULL <<30 ) -1 ; + adev->gmc.noretry_flags =AMDGPU_VM_NORETRY_FLAGS_TF ;return 0 ; }
@@ -822,14 +823,28 @@ static int gmc_v12_0_sw_init(struct amdgpu_ip_block *ip_block)if (r)return r; -if (amdgpu_ip_version (adev,GC_HWIP ,0 ) ==IP_VERSION (12 ,1 ,0 )) +if (amdgpu_ip_version (adev,GC_HWIP ,0 ) ==IP_VERSION (12 ,1 ,0 )) { r =amdgpu_irq_add_id (adev,SOC21_IH_CLIENTID_UTCL2 ,UTCL2_1_0__SRCID__FAULT , &adev->gmc.vm_fault); -else +if (r) +return r; +/* Add GCVM UTCL2 Retry fault */ + r =amdgpu_irq_add_id (adev,SOC21_IH_CLIENTID_UTCL2 , +UTCL2_1_0__SRCID__RETRY , + &adev->gmc.vm_fault); +if (r) +return r; + +/* Add MMVM UTCL2 Retry fault */ + r =amdgpu_irq_add_id (adev,SOC21_IH_CLIENTID_VMC , +VMC_1_0__SRCID__VM_RETRY , + &adev->gmc.vm_fault); + }else { r =amdgpu_irq_add_id (adev,SOC21_IH_CLIENTID_GFX ,UTCL2_1_0__SRCID__FAULT , &adev->gmc.vm_fault); + }if (r)return r;
drivers/gpu/drm/amd/include/ivsrcid/vmc/irqsrcs_vmc_1_0.h +2 -0
@@ -28,10 +28,12 @@#define VMC_1_0__SRCID__VM_FAULT 0 +#define VMC_1_0__SRCID__VM_RETRY 1#define VMC_1_0__SRCID__VM_CONTEXT0_ALL 256#define VMC_1_0__SRCID__VM_CONTEXT1_ALL 257#define UTCL2_1_0__SRCID__FAULT 0/* UTC L2 has encountered a fault or retry scenario */ +#define UTCL2_1_0__SRCID__RETRY 1/* UTC L2 has encountered a retry scenario (GFX12.1) */ #endif /* __IRQSRCS_VMC_1_0_H__ */
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: Enable retry faults for GFX 12.1
From: Mukul Joshi <[email protected]>
Enable retry faults in both GCVM/MMVM Context1 Control and L2_PROTECTION_FAULT_CNTL2 registers for GFX 12.1.
--- drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c | 4 +++- drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +3 -1
@@ -200,6 +200,8 @@ static void gfxhub_v12_1_xcc_init_system_aperture_regs(struct amdgpu_device *ade regGCVM_L2_PROTECTION_FAULT_CNTL2); tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 ,ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT ,0x1 );WREG32_SOC15 (GC ,GET_INST (GC , i), regGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }
@@ -429,7 +431,7 @@ static void gfxhub_v12_1_xcc_setup_vmid_config(struct amdgpu_device *adev,/* Send no-retry XNACK on fault to suppress VM fault storm */ tmp =REG_SET_FIELD (tmp,GCVM_CONTEXT1_CNTL ,RETRY_PERMISSION_OR_INVALID_PAGE_FAULT , - !amdgpu_noretry); +1 );WREG32_SOC15_OFFSET (GC ,GET_INST (GC , j), regGCVM_CONTEXT1_CNTL, i * hub->ctx_distance, tmp); WREG32_SOC15_OFFSET(GC, GET_INST(GC, j),
drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c +2 -0
@@ -247,6 +247,8 @@ static void mmhub_v4_2_0_mid_init_system_aperture_regs(struct amdgpu_device *ade regMMVM_L2_PROTECTION_FAULT_CNTL2); tmp =REG_SET_FIELD (tmp,MMVM_L2_PROTECTION_FAULT_CNTL2 ,ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,MMVM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT ,0x1 );WREG32_SOC15 (MMHUB ,GET_INST (MMHUB , i), regMMVM_L2_PROTECTION_FAULT_CNTL2, tmp); }
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: Add interrupt handler for GFX 12.1.0
In reply to Alex DeucherFrom: Mukul Joshi <[email protected]>
Add a separate interrupt handler for handling interrupts, both retry and no-retry, for GFX 12.1.0.
--- drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 6 +- drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c | 213 ++++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/gmc_v12_1.h | 1 + drivers/gpu/drm/amd/amdkfd/kfd_device.c | 7 +- 4 files changed, 224 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c +4 -2
@@ -639,15 +639,16 @@ static int gmc_v12_0_early_init(struct amdgpu_ip_block *ip_block)switch (amdgpu_ip_version (adev,GC_HWIP ,0 )) {case IP_VERSION (12 ,1 ,0 ):gmc_v12_1_set_gmc_funcs (adev); +gmc_v12_1_set_irq_funcs (adev); adev->gmc.init_pte_flags =AMDGPU_PTE_IS_PTE ;break ;default :gmc_v12_0_set_gmc_funcs (adev); +gmc_v12_0_set_irq_funcs (adev);break ; }gmc_v12_0_set_gfxhub_funcs (adev);gmc_v12_0_set_mmhub_funcs (adev); -gmc_v12_0_set_irq_funcs (adev);gmc_v12_0_set_umc_funcs (adev); adev->gmc.shared_aperture_start =0x2000000000000000ULL ;
@@ -848,7 +849,8 @@ static int gmc_v12_0_sw_init(struct amdgpu_ip_block *ip_block)if (r)return r; -if (!amdgpu_sriov_vf (adev)) { +if ((amdgpu_ip_version (adev,GC_HWIP ,0 ) !=IP_VERSION (12 ,1 ,0 )) && + !amdgpu_sriov_vf (adev)) {/* interrupt sent to DF. */ r =amdgpu_irq_add_id (adev,SOC21_IH_CLIENTID_DF ,0 , &adev->gmc.ecc_irq);
drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c +213 -0
222 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/gmc_v12_1.h +1 -0
@@ -25,5 +25,6 @@#define __GMC_V12_1_H__void gmc_v12_1_set_gmc_funcs (struct amdgpu_device *adev); +void gmc_v12_1_set_irq_funcs (struct amdgpu_device *adev);#endif
drivers/gpu/drm/amd/amdkfd/kfd_device.c +6 -1
@@ -1685,6 +1685,10 @@ bool kgd2kfd_vmfault_fast_path(struct amdgpu_device *adev, struct amdgpu_iv_entr {struct kfd_process *p;u32 cam_index; +u32 src_data_idx; + + src_data_idx = (amdgpu_ip_version (adev,GC_HWIP ,0 ) ==IP_VERSION (12 ,1 ,0 )) ? +3 :2 ;if (entry->ih == &adev->irq.ih_soft || entry->ih == &adev->irq.ih1) { p =kfd_lookup_process_by_pasid (entry->pasid,NULL );
@@ -1693,7 +1697,8 @@ bool kgd2kfd_vmfault_fast_path(struct amdgpu_device *adev, struct amdgpu_iv_entrif (p->gpu_page_fault && !p->debug_trap_enabled) {if (retry_fault && adev->irq.retry_cam_enabled) { - cam_index = entry->src_data[2 ] &0x3ff ; + cam_index = entry->src_data[src_data_idx] &0x3ff ; +WDOORBELL32 (adev->irq.retry_cam_doorbell_index, cam_index); }
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: Add IH node-id to XCC mapping
In reply to Alex DeucherFrom: Mukul Joshi <[email protected]>
Add a generic function to map IH node-id to XCC instance.
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 33 ++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +29 -4
@@ -692,6 +692,18 @@ static void gfx_v12_1_select_me_pipe_q(struct amdgpu_device *adev,soc_v1_0_grbm_select (adev, me, pipe, q, vm,GET_INST (GC , xcc_id)); } +static int gfx_v12_1_ih_to_xcc_inst (struct amdgpu_device *adev,int ih_node) +{ +int xcc = (ih_node &0x7 ) -2 + (ih_node >>3 ) *4 ; + +if (xcc <0 || xcc >=hweight8 (adev->gfx.xcc_mask)) { +dev_err (adev->dev,"Couldn't find xcc mapping from IH node" ); +return -EINVAL ; + } + +return xcc; +} +static const struct amdgpu_gfx_funcs gfx_v12_1_gfx_funcs = { .get_gpu_clock_counter = &gfx_v12_1_get_gpu_clock_counter, .select_se_sh = &gfx_v12_1_xcc_select_se_sh,
@@ -700,6 +712,7 @@ static const struct amdgpu_gfx_funcs gfx_v12_1_gfx_funcs = { .read_wave_vgprs = &gfx_v12_1_read_wave_vgprs, .select_me_pipe_q = &gfx_v12_1_select_me_pipe_q, .update_perfmon_mgcg = &gfx_v12_1_update_perf_clk, + .ih_node_to_logical_xcc = &gfx_v12_1_ih_to_xcc_inst, };static int gfx_v12_1_gpu_early_init (struct amdgpu_device *adev)
@@ -3407,7 +3420,7 @@ static int gfx_v12_1_eop_irq(struct amdgpu_device *adev,struct amdgpu_irq_src *source, struct amdgpu_iv_entry *entry) { - int i; + int i, xcc_id;u8 me_id, pipe_id, queue_id;struct amdgpu_ring *ring;uint32_t mes_queue_id = entry->src_data[0 ];
@@ -3430,6 +3443,10 @@ static int gfx_v12_1_eop_irq(struct amdgpu_device *adev, me_id = (entry->ring_id &0x0c ) >>2 ; pipe_id = (entry->ring_id &0x03 ) >>0 ; queue_id = (entry->ring_id &0x70 ) >>4 ; + xcc_id =gfx_v12_1_ih_to_xcc_inst (adev, entry->node_id); + +if (xcc_id == -EINVAL ) +return -EINVAL ;switch (me_id) {case 0 :
@@ -3441,7 +3458,9 @@ static int gfx_v12_1_eop_irq(struct amdgpu_device *adev,case 1 :case 2 :for (i =0 ; i < adev->gfx.num_compute_rings; i++) { - ring = &adev->gfx.compute_ring[i]; + ring = &adev->gfx.compute_ring + [i + + xcc_id * adev->gfx.num_compute_rings];/* Per-queue interrupt is supported for MEC starting from VI. * The interrupt can only be enabled/disabled per pipe instead * of per queue.
@@ -3509,11 +3528,15 @@ static void gfx_v12_1_handle_priv_fault(struct amdgpu_device *adev, {u8 me_id, pipe_id, queue_id;struct amdgpu_ring *ring; -int i; +int i, xcc_id; me_id = (entry->ring_id &0x0c ) >>2 ; pipe_id = (entry->ring_id &0x03 ) >>0 ; queue_id = (entry->ring_id &0x70 ) >>4 ; + xcc_id =gfx_v12_1_ih_to_xcc_inst (adev, entry->node_id); + +if (xcc_id == -EINVAL ) +return ;switch (me_id) {case 0 :
@@ -3527,7 +3550,9 @@ static void gfx_v12_1_handle_priv_fault(struct amdgpu_device *adev,case 1 :case 2 :for (i =0 ; i < adev->gfx.num_compute_rings; i++) { - ring = &adev->gfx.compute_ring[i]; + ring = &adev->gfx.compute_ring + [i + + xcc_id * adev->gfx.num_compute_rings];if (ring->me == me_id && ring->pipe == pipe_id && ring->queue == queue_id)drm_sched_fault (&ring->sched);
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: Update MES VM_CNTX_CNTL for XNACK off for GFX 12.1
In reply to Alex DeucherFrom: Mukul Joshi <[email protected]>
Currently, we do not turn off retry faults in VM_CONTEXT_CNTL value when passing it to MES if XNACK is off. This creates a situation where XNACK is disabled in SQ but enabled in UTCL2, which is not recommended. As a result, turn off/on retry faults in both SQ and UTCL2 when passing vm_context_cntl value to MES if XNACK is disabled/enabled.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 1 + drivers/gpu/drm/amd/amdgpu/mes_v12_1.c | 5 +---- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 1 + .../drm/amd/amdkfd/kfd_device_queue_manager_v12_1.c | 12 ++++++++++-- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 1 + 5 files changed, 14 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h +1 -0
@@ -254,6 +254,7 @@ struct mes_add_queue_input {uint32_t queue_size;uint32_t exclusively_scheduled;uint32_t sh_mem_config_data; +uint32_t vm_cntx_cntl; };struct mes_remove_queue_input {
drivers/gpu/drm/amd/amdgpu/mes_v12_1.c +1 -4
@@ -286,10 +286,7 @@ static int convert_to_mes_queue_type(int queue_type)static int mes_v12_1_add_hw_queue (struct amdgpu_mes *mes,struct mes_add_queue_input *input) { -struct amdgpu_device *adev = mes->adev;union MESAPI__ADD_QUEUE mes_add_queue_pkt; -struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_GFXHUB (0 )]; -uint32_t vm_cntx_cntl = hub->vm_cntx_cntl;int xcc_id = input->xcc_id;int inst =MES_PIPE_INST (xcc_id,AMDGPU_MES_SCHED_PIPE );
@@ -322,7 +319,7 @@ static int mes_v12_1_add_hw_queue(struct amdgpu_mes *mes, mes_add_queue_pkt.queue_type =convert_to_mes_queue_type (input->queue_type); mes_add_queue_pkt.paging = input->paging; - mes_add_queue_pkt.vm_context_cntl = vm_cntx_cntl; + mes_add_queue_pkt.vm_context_cntl = input->vm_cntx_cntl; mes_add_queue_pkt.gws_base = input->gws_base; mes_add_queue_pkt.gws_size = input->gws_size; mes_add_queue_pkt.trap_handler_addr = input->tba_addr;
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +1 -0
@@ -256,6 +256,7 @@ static int add_queue_mes(struct device_queue_manager *dqm, struct queue *q, queue_input.exclusively_scheduled = q->properties.is_gws; queue_input.sh_mem_config_data = qpd->sh_mem_config; + queue_input.vm_cntx_cntl = qpd->vm_cntx_cntl;amdgpu_mes_lock (&adev->mes); r = adev->mes.funcs->add_hw_queue (&adev->mes, &queue_input);
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v12_1.c +10 -2
@@ -52,8 +52,11 @@ static int update_qpd_v12_1(struct device_queue_manager *dqm, struct qcm_process_device *qpd) {struct kfd_process_device *pdd; +struct amdgpu_device *adev = dqm->dev->adev; +struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_GFXHUB (0 )]; pdd =qpd_to_pdd (qpd); + qpd->vm_cntx_cntl = hub->vm_cntx_cntl;/* check if sh_mem_config register already configured */ if (qpd->sh_mem_config ==0 ) {
@@ -69,10 +72,15 @@ static int update_qpd_v12_1(struct device_queue_manager *dqm, }if (KFD_SUPPORT_XNACK_PER_PROCESS (dqm->dev)) { -if (!pdd->process->xnack_enabled) +if (!pdd->process->xnack_enabled) { qpd->sh_mem_config |=1 <<SH_MEM_CONFIG__RETRY_DISABLE__SHIFT ; -else + qpd->vm_cntx_cntl &= + ~(1 <<GCVM_CONTEXT0_CNTL__RETRY_PERMISSION_OR_INVALID_PAGE_FAULT__SHIFT ); + }else { qpd->sh_mem_config &= ~(1 <<SH_MEM_CONFIG__RETRY_DISABLE__SHIFT ); + qpd->vm_cntx_cntl |= + (1 <<GCVM_CONTEXT0_CNTL__RETRY_PERMISSION_OR_INVALID_PAGE_FAULT__SHIFT ); + } } qpd->sh_mem_bases =compute_sh_mem_bases_64bit (pdd);
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 -0
@@ -697,6 +697,7 @@ struct qcm_process_device {uint32_t num_gws;uint32_t num_oac;uint32_t sh_hidden_private_base; +uint32_t vm_cntx_cntl;/* CWSR memory */ struct kgd_mem *cwsr_mem;
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdkfd: Enable per-process XNACK for GFX 12.1.0
In reply to Alex DeucherFrom: Mukul Joshi <[email protected]>
GFX 12.1.0 will support enabling/disabling XNACK on a per- process basis. This change enables the per process XNACK feature.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h | 1 + drivers/gpu/drm/amd/amdgpu/mes_v12_1.c | 2 ++ drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 1 + drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 3 ++- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 3 ++- 5 files changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h +1 -0
@@ -253,6 +253,7 @@ struct mes_add_queue_input {uint32_t is_aql_queue;uint32_t queue_size;uint32_t exclusively_scheduled; +uint32_t sh_mem_config_data; };struct mes_remove_queue_input {
drivers/gpu/drm/amd/amdgpu/mes_v12_1.c +2 -0
@@ -339,6 +339,8 @@ static int mes_v12_1_add_hw_queue(struct amdgpu_mes *mes, mes_add_queue_pkt.is_aql_queue = input->is_aql_queue; mes_add_queue_pkt.gds_size = input->queue_size; + mes_add_queue_pkt.full_sh_mem_config_data = input->sh_mem_config_data; + return mes_v12_1_submit_pkt_and_poll_completion(mes, xcc_id, AMDGPU_MES_SCHED_PIPE, &mes_add_queue_pkt, sizeof(mes_add_queue_pkt),
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +1 -0
@@ -255,6 +255,7 @@ static int add_queue_mes(struct device_queue_manager *dqm, struct queue *q, queue_input.queue_type = (uint32_t )queue_type; queue_input.exclusively_scheduled = q->properties.is_gws; + queue_input.sh_mem_config_data = qpd->sh_mem_config;amdgpu_mes_lock (&adev->mes); r = adev->mes.funcs->add_hw_queue (&adev->mes, &queue_input);
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +2 -1
@@ -215,7 +215,8 @@ enum cache_policy { ((KFD_GC_VERSION (dev) ==IP_VERSION (9 ,4 ,2 )) || \ (KFD_GC_VERSION (dev) ==IP_VERSION (9 ,4 ,3 )) || \ (KFD_GC_VERSION (dev) ==IP_VERSION (9 ,4 ,4 )) || \ - (KFD_GC_VERSION(dev) == IP_VERSION(9, 5, 0))) + (KFD_GC_VERSION (dev) ==IP_VERSION (9 ,5 ,0 )) || \ + (KFD_GC_VERSION(dev) == IP_VERSION(12, 1, 0)))struct kfd_node ;
drivers/gpu/drm/amd/amdkfd/kfd_process.c +2 -1
@@ -1558,7 +1558,8 @@ bool kfd_process_xnack_mode(struct kfd_process *p, bool supported)* management and memory-manager-related preemptions or * even deadlocks. */ -if (KFD_GC_VERSION (dev) >=IP_VERSION (10 ,1 ,1 )) +if (KFD_GC_VERSION (dev) >=IP_VERSION (10 ,1 ,1 ) && +KFD_GC_VERSION (dev) <IP_VERSION (12 ,1 ,0 ))return false;if (dev->kfd->noretry)
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: Enable atomics for all the available xcc
In reply to Alex DeucherFrom: Hawking Zhang <[email protected]>
Apply TCP_UTCL0_CNTL1 settings to all the available xcc
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +14 -5
@@ -2511,15 +2511,24 @@ static void gfx_v12_1_xcc_disable_gpa_mode(struct amdgpu_device *adev,WREG32_SOC15 (GC ,GET_INST (GC , xcc_id), regCPG_PSP_DEBUG, data); } -static void gfx_v12_1_init_golden_registers (struct amdgpu_device *adev) +static void gfx_v12_1_xcc_enable_atomics (struct amdgpu_device *adev, +int xcc_id) { -uint32_t val; +uint32_t data;/* Set the TCP UTCL0 register to enable atomics */ - val =RREG32_SOC15 (GC ,0 , regTCP_UTCL0_CNTL1); - val =REG_SET_FIELD (val,TCP_UTCL0_CNTL1 ,ATOMIC_REQUESTER_EN ,0x1 ); + data =RREG32_SOC15 (GC ,GET_INST (GC , xcc_id), regTCP_UTCL0_CNTL1); + data =REG_SET_FIELD (data,TCP_UTCL0_CNTL1 ,ATOMIC_REQUESTER_EN ,0x1 ); + +WREG32_SOC15 (GC ,GET_INST (GC , xcc_id), regTCP_UTCL0_CNTL1, data); +} + +static void gfx_v12_1_init_golden_registers (struct amdgpu_device *adev) +{ +int i; -WREG32_SOC15 (GC ,0 , regTCP_UTCL0_CNTL1, val); +for (i =0 ; i <NUM_XCC (adev->gfx.xcc_mask); i++) +gfx_v12_1_xcc_enable_atomics (adev, i); }static int gfx_v12_1_hw_init (struct amdgpu_ip_block *ip_block)
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: support rlc autoload for muti-xcc
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
Support rlc autload for muti-xcc on gfx v12_1.
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 57 +++++++++++++++++--------- 1 file changed, 38 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +38 -19
@@ -1059,6 +1059,7 @@ static int gfx_v12_1_rlc_backdoor_autoload_enable(struct amdgpu_device *adev)uint32_t rlc_g_offset, rlc_g_size;uint64_t gpu_addr;uint32_t data; +int i, num_xcc;/* RLC autoload sequence 2: copy ucode */ gfx_v12_1_rlc_backdoor_autoload_copy_sdma_ucode (adev);
@@ -1070,13 +1071,18 @@ static int gfx_v12_1_rlc_backdoor_autoload_enable(struct amdgpu_device *adev) rlc_g_size = rlc_autoload_info[SOC24_FIRMWARE_ID_RLC_G_UCODE ].size; gpu_addr = adev->gfx.rlc.rlc_autoload_gpu_addr + rlc_g_offset - adev->gmc.vram_start; -WREG32_SOC15 (GC ,GET_INST (GC ,0 ), - regGFX_IMU_RLC_BOOTLOADER_ADDR_HI,upper_32_bits (gpu_addr)); -WREG32_SOC15 (GC ,GET_INST (GC ,0 ), - regGFX_IMU_RLC_BOOTLOADER_ADDR_LO,lower_32_bits (gpu_addr)); - -WREG32_SOC15 (GC ,GET_INST (GC ,0 ), - regGFX_IMU_RLC_BOOTLOADER_SIZE, rlc_g_size); + num_xcc =NUM_XCC (adev->gfx.xcc_mask); +for (i =0 ; i < num_xcc; i++) { +WREG32_SOC15 (GC ,GET_INST (GC , i), + regGFX_IMU_RLC_BOOTLOADER_ADDR_HI, +upper_32_bits (gpu_addr)); +WREG32_SOC15 (GC ,GET_INST (GC , i), + regGFX_IMU_RLC_BOOTLOADER_ADDR_LO, +lower_32_bits (gpu_addr)); +WREG32_SOC15 (GC ,GET_INST (GC , i), + regGFX_IMU_RLC_BOOTLOADER_SIZE, + rlc_g_size); + }if (adev->gfx.imu.funcs) {/* RLC autoload sequence 3: load IMU fw */
@@ -1085,11 +1091,13 @@ static int gfx_v12_1_rlc_backdoor_autoload_enable(struct amdgpu_device *adev) }/* unhalt rlc to start autoload */ - data =RREG32_SOC15 (GC ,GET_INST (GC ,0 ), regRLC_GPM_THREAD_ENABLE); - data =REG_SET_FIELD (data,RLC_GPM_THREAD_ENABLE ,THREAD0_ENABLE ,1 ); - data =REG_SET_FIELD (data,RLC_GPM_THREAD_ENABLE ,THREAD1_ENABLE ,1 ); -WREG32_SOC15 (GC ,GET_INST (GC ,0 ), regRLC_GPM_THREAD_ENABLE, data); -WREG32_SOC15 (GC ,GET_INST (GC ,0 ), regRLC_CNTL,RLC_CNTL__RLC_ENABLE_F32_MASK ); +for (i =0 ; i < num_xcc; i++) { + data =RREG32_SOC15 (GC ,GET_INST (GC , i), regRLC_GPM_THREAD_ENABLE); + data =REG_SET_FIELD (data,RLC_GPM_THREAD_ENABLE ,THREAD0_ENABLE ,1 ); + data =REG_SET_FIELD (data,RLC_GPM_THREAD_ENABLE ,THREAD1_ENABLE ,1 ); +WREG32_SOC15 (GC ,GET_INST (GC , i), regRLC_GPM_THREAD_ENABLE, data); +WREG32_SOC15 (GC ,GET_INST (GC , i), regRLC_CNTL,RLC_CNTL__RLC_ENABLE_F32_MASK ); + }return 0 ; }
@@ -1793,15 +1801,16 @@ static void gfx_v12_1_xcc_set_mec_ucode_start_addr(struct amdgpu_device *adev,mutex_unlock (&adev->srbm_mutex); } -static int gfx_v12_1_wait_for_rlc_autoload_complete (struct amdgpu_device *adev) +static int gfx_v12_1_xcc_wait_for_rlc_autoload_complete (struct amdgpu_device *adev, +int xcc_id) {uint32_t cp_status;uint32_t bootload_status; -int i, xcc_id; +int i;for (i =0 ; i < adev->usec_timeout; i++) { - cp_status =RREG32_SOC15 (GC ,GET_INST (GC ,0 ), regCP_STAT); - bootload_status =RREG32_SOC15 (GC ,GET_INST (GC ,0 ), + cp_status =RREG32_SOC15 (GC ,GET_INST (GC , xcc_id), regCP_STAT); + bootload_status =RREG32_SOC15 (GC ,GET_INST (GC , xcc_id), regRLC_RLCS_BOOTLOAD_STATUS); if ((cp_status == 0) &&
@@ -1815,18 +1824,28 @@ static int gfx_v12_1_wait_for_rlc_autoload_complete(struct amdgpu_device *adev) }if (i >= adev->usec_timeout) { -dev_err (adev->dev,"rlc autoload: gc ucode autoload timeout\n" ); +dev_err (adev->dev, +"rlc autoload: xcc%d gc ucode autoload timeout\n" , xcc_id);return -ETIMEDOUT ; }if (adev->firmware.load_type ==AMDGPU_FW_LOAD_RLC_BACKDOOR_AUTO ) { -for (xcc_id =0 ; xcc_id <NUM_XCC (adev->gfx.xcc_mask); xcc_id++) -gfx_v12_1_xcc_set_mec_ucode_start_addr (adev, xcc_id); +gfx_v12_1_xcc_set_mec_ucode_start_addr (adev, xcc_id); }return 0 ; } +static int gfx_v12_1_wait_for_rlc_autoload_complete (struct amdgpu_device *adev) +{ +int xcc_id; + +for (xcc_id =0 ; xcc_id <NUM_XCC (adev->gfx.xcc_mask); xcc_id++) +gfx_v12_1_xcc_wait_for_rlc_autoload_complete (adev, xcc_id); + +return 0 ; +} +static void gfx_v12_1_xcc_cp_compute_enable (struct amdgpu_device *adev,bool enable,int xcc_id) {
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: Initialize memory partition callbacks for gmc v12_1
In reply to Alex DeucherFrom: Hawking Zhang <[email protected]>
Initialize memory partition callbacks for gmv v12_1
--- drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c +2 -0
@@ -578,6 +578,8 @@ static const struct amdgpu_gmc_funcs gmc_v12_1_gmc_funcs = { .emit_pasid_mapping = gmc_v12_1_emit_pasid_mapping, .get_vm_pde = gmc_v12_1_get_vm_pde, .get_vm_pte = gmc_v12_1_get_vm_pte, + .query_mem_partition_mode = &amdgpu_gmc_query_memory_partition, + .request_mem_partition_mode = &amdgpu_gmc_request_memory_partition, };void gmc_v12_1_set_gmc_funcs (struct amdgpu_device *adev)
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: Initialize memory ranges for gmc v12_1
In reply to Alex DeucherFrom: Hawking Zhang <[email protected]>
Initialize memory ranges for gmc v12_1
--- drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c +8 -0
@@ -878,6 +878,14 @@ static int gmc_v12_0_sw_init(struct amdgpu_ip_block *ip_block)amdgpu_gmc_get_vbios_allocations (adev); +#ifdef HAVE_ACPI_DEV_GET_FIRST_MATCH_DEV +if (amdgpu_ip_version (adev,GC_HWIP ,0 ) ==IP_VERSION (12 ,1 ,0 )) { + r =amdgpu_gmc_init_mem_ranges (adev); +if (r) +return r; + } +#endif +/* Memory manager */ r =amdgpu_bo_init (adev);if (r)
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: Init partition_mode and xcc_mask for GFX_IMU_PARTITION_SWITCH
In reply to Alex DeucherFrom: Hawking Zhang <[email protected]>
Set partition_mode and physical xcc mask fields in GFX_IMU_PARTITION_SWITCH register
v2: cleanup (Alex)
--- drivers/gpu/drm/amd/amdgpu/amdgpu_imu.h | 3 ++- drivers/gpu/drm/amd/amdgpu/imu_v12_1.c | 4 +++- drivers/gpu/drm/amd/amdgpu/soc_v1_0.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_imu.h +2 -1
@@ -38,7 +38,8 @@ struct amdgpu_imu_funcs {int (*wait_for_reset_status)(struct amdgpu_device *adev);int (*get_xccs_per_xcp)(struct amdgpu_device *adev);int (*switch_compute_partition)(struct amdgpu_device *adev, -int num_xccs_per_xcp); +int num_xccs_per_xcp, +int compute_partition_mode); };struct imu_rlc_ram_golden {
drivers/gpu/drm/amd/amdgpu/imu_v12_1.c +3 -1
@@ -144,11 +144,13 @@ static int imu_v12_1_get_xccs_per_xcp(struct amdgpu_device *adev) }static int imu_v12_1_switch_compute_partition (struct amdgpu_device *adev, -int num_xccs_per_xcp) +int num_xccs_per_xcp, +int compute_partition_mode) {int ret;if (adev->psp.funcs) { +/*TODO: revisit asp interface once it's avaialble */ ret =psp_spatial_partition (&adev->psp,NUM_XCC (adev->gfx.xcc_mask) / num_xccs_per_xcp);
drivers/gpu/drm/amd/amdgpu/soc_v1_0.c +1 -1
@@ -652,7 +652,7 @@ static int soc_v1_0_switch_partition_mode(struct amdgpu_xcp_mgr *xcp_mgr, num_xcc_per_xcp =__soc_v1_0_get_xcc_per_xcp (xcp_mgr, mode);if (adev->gfx.imu.funcs && adev->gfx.imu.funcs->switch_compute_partition) - adev->gfx.imu.funcs->switch_compute_partition (xcp_mgr->adev, num_xcc_per_xcp); + adev->gfx.imu.funcs->switch_compute_partition (xcp_mgr->adev, num_xcc_per_xcp, mode);/* Init info about new xcps */ *num_xcps = num_xcc / num_xcc_per_xcp;
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: Use AMDGPU_IS_GFXHUB to screen out GFXHUB for GMC v12.1
In reply to Alex DeucherFrom: Le Ma <[email protected]>
There're multiple gfxhubs on GMC v12.1
--- drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c +3 -3
@@ -255,7 +255,7 @@ static void gmc_v12_1_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,unsigned int i;unsigned char hub_ip =0 ; - hub_ip = (vmhub ==AMDGPU_GFXHUB (0 )) ? + hub_ip = (AMDGPU_IS_GFXHUB (vmhub)) ?GC_HWIP :MMHUB_HWIP ;spin_lock (&adev->gmc.invalidate_lock);
@@ -274,7 +274,7 @@ static void gmc_v12_1_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid, }/* Issue additional private vm invalidation to MMHUB */ -if ((vmhub !=AMDGPU_GFXHUB (0 )) && +if (!AMDGPU_IS_GFXHUB (vmhub) && (hub->vm_l2_bank_select_reserved_cid2) && !amdgpu_sriov_vf (adev)) { inv_req =RREG32_NO_KIQ (hub->vm_l2_bank_select_reserved_cid2);
@@ -307,7 +307,7 @@ static void gmc_v12_1_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,static void gmc_v12_1_flush_gpu_tlb (struct amdgpu_device *adev,uint32_t vmid,uint32_t vmhub,uint32_t flush_type) { -if ((vmhub ==AMDGPU_GFXHUB (0 )) && !adev->gfx.is_poweron) +if (AMDGPU_IS_GFXHUB (vmhub) && !adev->gfx.is_poweron)return ;/* This is necessary for SRIOV as well as for GFXOFF to function
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: Set xcp id for mes ring
In reply to Alex DeucherFrom: Hawking Zhang <[email protected]>
Set xcp id for mes ring
--- drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c +1 -0
@@ -540,6 +540,7 @@ static void amdgpu_set_xcp_id(struct amdgpu_device *adev,case AMDGPU_HW_IP_GFX :case AMDGPU_RING_TYPE_COMPUTE :case AMDGPU_RING_TYPE_KIQ : +case AMDGPU_RING_TYPE_MES : ip_blk =AMDGPU_XCP_GFX ;break ;case AMDGPU_RING_TYPE_SDMA :
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: Initialize vram_info for gmc v12_1
In reply to Alex DeucherFrom: Hawking Zhang <[email protected]>
Initialize vram_info for gmc v12_1
--- drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 15 +++++++++------ drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c | 7 +++++++ drivers/gpu/drm/amd/amdgpu/gmc_v12_1.h | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c +9 -6
@@ -781,12 +781,15 @@ static int gmc_v12_0_sw_init(struct amdgpu_ip_block *ip_block)spin_lock_init (&adev->gmc.invalidate_lock); - r =amdgpu_atomfirmware_get_vram_info (adev, - &vram_width, &vram_type, &vram_vendor); - adev->gmc.vram_width = vram_width; - - adev->gmc.vram_type = vram_type; - adev->gmc.vram_vendor = vram_vendor; +if (amdgpu_ip_version (adev,GC_HWIP ,0 ) ==IP_VERSION (12 ,1 ,0 )) { +gmc_v12_1_init_vram_info (adev); + }else { + r =amdgpu_atomfirmware_get_vram_info (adev, + &vram_width, &vram_type, &vram_vendor); + adev->gmc.vram_width = vram_width; + adev->gmc.vram_type = vram_type; + adev->gmc.vram_vendor = vram_vendor; + }switch (amdgpu_ip_version (adev,GC_HWIP ,0 )) {case IP_VERSION (12 ,0 ,0 ):
drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c +7 -0
@@ -597,3 +597,10 @@ void gmc_v12_1_set_irq_funcs(struct amdgpu_device *adev) adev->gmc.vm_fault.num_types =1 ; adev->gmc.vm_fault.funcs = &gmc_v12_1_irq_funcs; } + +void gmc_v12_1_init_vram_info (struct amdgpu_device *adev) +{ +/* TODO: query vram_info from ip discovery binary */ + adev->gmc.vram_type =AMDGPU_VRAM_TYPE_HBM4 ; + adev->gmc.vram_width =384 *64 ; +}
drivers/gpu/drm/amd/amdgpu/gmc_v12_1.h +1 -1
@@ -26,5 +26,5 @@void gmc_v12_1_set_gmc_funcs (struct amdgpu_device *adev);void gmc_v12_1_set_irq_funcs (struct amdgpu_device *adev); - +void gmc_v12_1_init_vram_info (struct amdgpu_device *adev);#endif
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: only copy ucode for enabled xcc
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
Only copy ucode for enabled xcc instead of copy for all 8 xcc for rlc autoload on gfx v12_1 to save time.
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +6 -4
@@ -898,11 +898,13 @@ static void gfx_v12_1_rlc_backdoor_autoload_copy_ucode(struct amdgpu_device *ade fw_size = toc_fw_inst_size;for (i =0 ; i < num_inst; i++) { -memcpy (ptr + toc_offset + i * toc_fw_inst_size, fw_data, fw_size); +if ((1 << (i /2 )) & adev->gfx.xcc_mask) { +memcpy (ptr + toc_offset + i * toc_fw_inst_size, fw_data, fw_size); -if (fw_size < toc_fw_inst_size) -memset (ptr + toc_offset + fw_size + i * toc_fw_inst_size, -0 , toc_fw_inst_size - fw_size); +if (fw_size < toc_fw_inst_size) +memset (ptr + toc_offset + fw_size + i * toc_fw_inst_size, +0 , toc_fw_inst_size - fw_size); + } } }
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amd/include : Update MES v12 API header
In reply to Alex DeucherFrom: Shaoyun Liu <[email protected]>
Add LDS out of range reporting support in mes API
--- drivers/gpu/drm/amd/include/mes_v12_api_def.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/include/mes_v12_api_def.h +2 -1
@@ -775,7 +775,8 @@ struct SET_SHADER_DEBUGGER {struct {uint32_t single_memop :1 ;// SQ_DEBUG.single_memop uint32_t single_alu_op :1 ;// SQ_DEBUG.single_alu_op -uint32_t reserved :30 ; +uint32_t lds_oor_reporting :1 ;/* SQ_DEBUG.ADDR_OUT_OF_RANGE_REPORTING */ +uint32_t reserved :29 ; };uint32_t u32all; } flags;
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: flush tlb properly for GMC v12.1 in early phase
In reply to Alex DeucherFrom: Le Ma <[email protected]>
Flush tlb properly for GMC v12.1
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 7 +++++-- drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +5 -2
@@ -2486,7 +2486,7 @@ static int gfx_v12_1_cp_resume(struct amdgpu_device *adev)static int gfx_v12_1_gfxhub_enable (struct amdgpu_device *adev) { -int r; +int r, i;bool value; r = adev->gfxhub.funcs->gart_enable (adev);
@@ -2499,7 +2499,10 @@ static int gfx_v12_1_gfxhub_enable(struct amdgpu_device *adev) adev->gfxhub.funcs->set_fault_enable_default (adev, value);/* TODO investigate why TLB flush is needed, * are we missing a flush somewhere else? */ - adev->gmc.gmc_funcs->flush_gpu_tlb (adev,0 ,AMDGPU_GFXHUB (0 ),0 ); +for_each_set_bit (i, adev->vmhubs_mask,AMDGPU_MAX_VMHUBS ) { +if (AMDGPU_IS_GFXHUB (i)) + adev->gmc.gmc_funcs->flush_gpu_tlb (adev,0 ,AMDGPU_GFXHUB (i),0 ); + }return 0 ; }
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c +1 -1
@@ -974,7 +974,7 @@ static int gmc_v12_0_gart_enable(struct amdgpu_device *adev) value = amdgpu_vm_fault_stop !=AMDGPU_VM_FAULT_STOP_ALWAYS ; adev->mmhub.funcs->set_fault_enable_default (adev, value); -gmc_v12_0_flush_gpu_tlb (adev,0 ,AMDGPU_MMHUB0 (0 ),0 ); + adev->gmc.gmc_funcs->flush_gpu_tlb (adev,0 ,AMDGPU_MMHUB0 (0 ),0 ); dev_info(adev->dev, "PCIE GART of %uM enabled (table at 0x%016llX).\n", (unsigned)(adev->gmc.gart_size >> 20),
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdkfd: allow debug subscription to lds violations on gfx 1250
In reply to Alex DeucherFrom: Jonathan Kim <[email protected]>
GFX 1250 allows the debugger to subcribe to LDS out-of-range read/write memory violations.
Bump IOCTL minor version and flag KFD capabilities for enablement hint.
--- drivers/gpu/drm/amd/amdkfd/kfd_debug.c | 7 +++++++ drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 4 ++++ include/uapi/linux/kfd_ioctl.h | 4 +++- include/uapi/linux/kfd_sysfs.h | 3 ++- 4 files changed, 16 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_debug.c +7 -0
@@ -519,6 +519,7 @@ int kfd_dbg_trap_set_flags(struct kfd_process *target, uint32_t *flags)struct kfd_topology_device *topo_dev =kfd_topology_device_by_id (target->pdds[i]->dev->id);uint32_t caps = topo_dev->node_props.capability; +uint32_t caps2 = topo_dev->node_props.capability2;if (!(caps &HSA_CAP_TRAP_DEBUG_PRECISE_MEMORY_OPERATIONS_SUPPORTED ) && (*flags &KFD_DBG_TRAP_FLAG_SINGLE_MEM_OP )) {
@@ -531,6 +532,12 @@ int kfd_dbg_trap_set_flags(struct kfd_process *target, uint32_t *flags) *flags = prev_flags;return -EACCES ; } + +if (!(caps2 &HSA_CAP2_TRAP_DEBUG_LDS_OUT_OF_ADDR_RANGE_SUPPORTED ) && + (*flags &KFD_DBG_TRAP_FLAG_LDS_OUT_OF_ADDR_RANGE )) { + *flags = prev_flags; +return -EACCES ; + } } target->dbg_flags = *flags;
drivers/gpu/drm/amd/amdkfd/kfd_topology.c +4 -0
@@ -2028,6 +2028,10 @@ static void kfd_topology_set_capabilities(struct kfd_topology_device *dev)if (KFD_GC_VERSION (dev->gpu) >=IP_VERSION (12 ,0 ,0 )) dev->node_props.capability |=HSA_CAP_TRAP_DEBUG_PRECISE_ALU_OPERATIONS_SUPPORTED ; + +if (KFD_GC_VERSION (dev->gpu) >=IP_VERSION (12 ,1 ,0 )) + dev->node_props.capability2 |= +HSA_CAP2_TRAP_DEBUG_LDS_OUT_OF_ADDR_RANGE_SUPPORTED ; }kfd_topology_set_dbg_firmware_support (dev);
include/uapi/linux/kfd_ioctl.h +3 -1
@@ -46,9 +46,10 @@* - 1.18 - Rename pad in set_memory_policy_args to misc_process_flag * - 1.19 - Add a new ioctl to craete secondary kfd processes * - 1.20 - Trap handler support for expert scheduling mode available +* - 1.21 - Debugger support to subscribe to LDS out-of-address exceptions */ #define KFD_IOCTL_MAJOR_VERSION 1 -#define KFD_IOCTL_MINOR_VERSION 20 +#define KFD_IOCTL_MINOR_VERSION 21struct kfd_ioctl_get_version_args {__u32 major_version;/* from KFD */
@@ -947,6 +948,7 @@ enum kfd_dbg_trap_address_watch_mode {enum kfd_dbg_trap_flags {KFD_DBG_TRAP_FLAG_SINGLE_MEM_OP =1 ,KFD_DBG_TRAP_FLAG_SINGLE_ALU_OP =2 , +KFD_DBG_TRAP_FLAG_LDS_OUT_OF_ADDR_RANGE =4 };/* Trap exceptions */
include/uapi/linux/kfd_sysfs.h +2 -1
@@ -64,7 +64,8 @@#define HSA_CAP_RESERVED 0x000f8000#define HSA_CAP2_PER_SDMA_QUEUE_RESET_SUPPORTED 0x00000001 -#define HSA_CAP2_RESERVED 0xfffffffe +#define HSA_CAP2_TRAP_DEBUG_LDS_OUT_OF_ADDR_RANGE_SUPPORTED 0x00000002 +#define HSA_CAP2_RESERVED 0xfffffffc/* debug_prop bits in node properties */ #define HSA_DBG_WATCH_ADDR_MASK_LO_BIT_MASK 0x0000000f
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: enable gpu tlb flush for gfxhub
In reply to Alex DeucherFrom: Likun Gao <[email protected]>
Enable gpu tlb flush for gfxhub without check gfx.is_poweron as gfx is power on by default for gfx v12_1 ASIC.
--- drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c +0 -3
@@ -307,9 +307,6 @@ static void gmc_v12_1_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,static void gmc_v12_1_flush_gpu_tlb (struct amdgpu_device *adev,uint32_t vmid,uint32_t vmhub,uint32_t flush_type) { -if (AMDGPU_IS_GFXHUB (vmhub) && !adev->gfx.is_poweron) -return ; -/* This is necessary for SRIOV as well as for GFXOFF to function * properly under bare metal */
Signature · 1 line
2.51.1
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: Init compute partition mode for gfx v12_1
In reply to Alex DeucherFrom: Hawking Zhang <[email protected]>
Init compute partition mode for gfx v12_1
--- drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 34 +++++++++++++++++++++----- 1 file changed, 28 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +28 -6
@@ -2447,17 +2447,39 @@ static int gfx_v12_1_xcc_cp_resume(struct amdgpu_device *adev,static int gfx_v12_1_cp_resume (struct amdgpu_device *adev) { -int i, r, num_xcc; +int num_xcc, num_xcp, num_xcc_per_xcp; +int r =0 ; num_xcc =NUM_XCC (adev->gfx.xcc_mask); +if (amdgpu_sriov_vf (adev)) { +enum amdgpu_gfx_partition mode; -for (i =0 ; i < num_xcc; i++) { - r =gfx_v12_1_xcc_cp_resume (adev, i); -if (r) -return r; + mode =amdgpu_xcp_query_partition_mode (adev->xcp_mgr, +AMDGPU_XCP_FL_NONE ); +if (mode ==AMDGPU_UNKNOWN_COMPUTE_PARTITION_MODE ) +return -EINVAL ; +if (adev->gfx.imu.funcs && + adev->gfx.imu.funcs->get_xccs_per_xcp) { + num_xcc_per_xcp = adev->gfx.imu.funcs->get_xccs_per_xcp (adev); + adev->gfx.num_xcc_per_xcp = num_xcc_per_xcp; + num_xcp = num_xcc / num_xcc_per_xcp; + }else { +return -EINVAL ; + } + r =amdgpu_xcp_init (adev->xcp_mgr, num_xcp, mode); + + }else { +if (amdgpu_xcp_query_partition_mode (adev->xcp_mgr, +AMDGPU_XCP_FL_NONE ) == +AMDGPU_UNKNOWN_COMPUTE_PARTITION_MODE ) + r =amdgpu_xcp_switch_partition_mode (adev->xcp_mgr, + amdgpu_user_partt_mode); } -return 0 ; +if (r) +return r; + +return gfx_v12_1_xcc_cp_resume (adev, adev->gfx.xcc_mask); }static int gfx_v12_1_gfxhub_enable (struct amdgpu_device *adev)
Signature · 1 line
2.51.1