Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: retire gfx ras query_utcl2_poison_status

Replace it with related interface in gfxhub functions.

v2: replace node id with xcc id.
get node id for query_utcl2_poison_status

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Tao Zhou and committed by
Alex Deucher
71a8d61e 3eb899c4

+30 -21
+4 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
··· 769 769 return 0; 770 770 } 771 771 772 - bool amdgpu_amdkfd_ras_query_utcl2_poison_status(struct amdgpu_device *adev) 772 + bool amdgpu_amdkfd_ras_query_utcl2_poison_status(struct amdgpu_device *adev, 773 + int xcc_id) 773 774 { 774 - if (adev->gfx.ras && adev->gfx.ras->query_utcl2_poison_status) 775 - return adev->gfx.ras->query_utcl2_poison_status(adev); 775 + if (adev->gfxhub.funcs->query_utcl2_poison_status) 776 + return adev->gfxhub.funcs->query_utcl2_poison_status(adev, xcc_id); 776 777 else 777 778 return false; 778 779 }
+2 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
··· 341 341 bool amdgpu_amdkfd_bo_mapped_to_dev(struct amdgpu_device *adev, struct kgd_mem *mem); 342 342 void amdgpu_amdkfd_block_mmu_notifications(void *p); 343 343 int amdgpu_amdkfd_criu_resume(void *p); 344 - bool amdgpu_amdkfd_ras_query_utcl2_poison_status(struct amdgpu_device *adev); 344 + bool amdgpu_amdkfd_ras_query_utcl2_poison_status(struct amdgpu_device *adev, 345 + int xcc_id); 345 346 int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev, 346 347 uint64_t size, u32 alloc_flag, int8_t xcp_id); 347 348 void amdgpu_amdkfd_unreserve_mem_limit(struct amdgpu_device *adev,
-1
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
··· 259 259 struct amdgpu_gfx_ras { 260 260 struct amdgpu_ras_block_object ras_block; 261 261 void (*enable_watchdog_timer)(struct amdgpu_device *adev); 262 - bool (*query_utcl2_poison_status)(struct amdgpu_device *adev); 263 262 int (*rlc_gc_fed_irq)(struct amdgpu_device *adev, 264 263 struct amdgpu_irq_src *source, 265 264 struct amdgpu_iv_entry *entry);
-12
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c
··· 1909 1909 mutex_unlock(&adev->grbm_idx_mutex); 1910 1910 } 1911 1911 1912 - static bool gfx_v9_4_2_query_uctl2_poison_status(struct amdgpu_device *adev) 1913 - { 1914 - u32 status = 0; 1915 - struct amdgpu_vmhub *hub; 1916 1912 1917 - hub = &adev->vmhub[AMDGPU_GFXHUB(0)]; 1918 - status = RREG32(hub->vm_l2_pro_fault_status); 1919 - /* reset page fault status */ 1920 - WREG32_P(hub->vm_l2_pro_fault_cntl, 1, ~1); 1921 - 1922 - return REG_GET_FIELD(status, VM_L2_PROTECTION_FAULT_STATUS, FED); 1923 - } 1924 1913 1925 1914 struct amdgpu_ras_block_hw_ops gfx_v9_4_2_ras_ops = { 1926 1915 .query_ras_error_count = &gfx_v9_4_2_query_ras_error_count, ··· 1923 1934 .hw_ops = &gfx_v9_4_2_ras_ops, 1924 1935 }, 1925 1936 .enable_watchdog_timer = &gfx_v9_4_2_enable_watchdog_timer, 1926 - .query_utcl2_poison_status = gfx_v9_4_2_query_uctl2_poison_status, 1927 1937 };
+12 -2
drivers/gpu/drm/amd/amdkfd/kfd_int_process_v10.c
··· 367 367 client_id == SOC15_IH_CLIENTID_UTCL2) { 368 368 struct kfd_vm_fault_info info = {0}; 369 369 uint16_t ring_id = SOC15_RING_ID_FROM_IH_ENTRY(ih_ring_entry); 370 + uint32_t node_id = SOC15_NODEID_FROM_IH_ENTRY(ih_ring_entry); 371 + uint32_t vmid_type = SOC15_VMID_TYPE_FROM_IH_ENTRY(ih_ring_entry); 372 + int xcc_id = 0; 370 373 struct kfd_hsa_memory_exception_data exception_data; 371 374 372 - if (client_id == SOC15_IH_CLIENTID_UTCL2 && 373 - amdgpu_amdkfd_ras_query_utcl2_poison_status(dev->adev)) { 375 + if (!vmid_type && dev->adev->gfx.funcs->ih_node_to_logical_xcc) { 376 + xcc_id = dev->adev->gfx.funcs->ih_node_to_logical_xcc(dev->adev, 377 + node_id); 378 + if (xcc_id < 0) 379 + xcc_id = 0; 380 + } 381 + 382 + if (client_id == SOC15_IH_CLIENTID_UTCL2 && !vmid_type && 383 + amdgpu_amdkfd_ras_query_utcl2_poison_status(dev->adev, xcc_id)) { 374 384 event_interrupt_poison_consumption(dev, pasid, client_id); 375 385 return; 376 386 }
+12 -2
drivers/gpu/drm/amd/amdkfd/kfd_int_process_v9.c
··· 413 413 client_id == SOC15_IH_CLIENTID_UTCL2) { 414 414 struct kfd_vm_fault_info info = {0}; 415 415 uint16_t ring_id = SOC15_RING_ID_FROM_IH_ENTRY(ih_ring_entry); 416 + uint32_t node_id = SOC15_NODEID_FROM_IH_ENTRY(ih_ring_entry); 417 + uint32_t vmid_type = SOC15_VMID_TYPE_FROM_IH_ENTRY(ih_ring_entry); 418 + int xcc_id = 0; 416 419 struct kfd_hsa_memory_exception_data exception_data; 417 420 418 - if (client_id == SOC15_IH_CLIENTID_UTCL2 && 419 - amdgpu_amdkfd_ras_query_utcl2_poison_status(dev->adev)) { 421 + if (!vmid_type && dev->adev->gfx.funcs->ih_node_to_logical_xcc) { 422 + xcc_id = dev->adev->gfx.funcs->ih_node_to_logical_xcc(dev->adev, 423 + node_id); 424 + if (xcc_id < 0) 425 + xcc_id = 0; 426 + } 427 + 428 + if (client_id == SOC15_IH_CLIENTID_UTCL2 && !vmid_type && 429 + amdgpu_amdkfd_ras_query_utcl2_poison_status(dev->adev, xcc_id)) { 420 430 event_interrupt_poison_consumption_v9(dev, pasid, client_id); 421 431 return; 422 432 }