[PATCH] drm/amdkfd: Ensure gpu_id is unique

2024-05-09 Thread Harish Kasiviswanathan
crc16 as suggested-by: Lijo Lazar Ensure that gpu_id != 0 Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 40 +++ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu

Re: [PATCH] drm/amdkfd: Ensure gpu_id is unique

2024-05-06 Thread Harish Kasiviswanathan
On 2024-05-06 16:30, Felix Kuehling wrote: > > On 2024-05-03 18:06, Harish Kasiviswanathan wrote: >> gpu_id needs to be unique for user space to identify GPUs via KFD >> interface. In the current implementation there is a very small >> probability of having non uniqu

[PATCH] drm/amdkfd: Ensure gpu_id is unique

2024-05-03 Thread Harish Kasiviswanathan
-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 26 ++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index b93913934b03..01d4c2e10c6d 100644

[PATCH 2/2] drm/amdkfd: Improve chances of unique gpu_id

2024-05-01 Thread Harish Kasiviswanathan
gpu_id needs to be unique for user space to identify GPUs via KFD interface. Do a single pass search to detect collision. If detected, increment gpu_id by one. Probability of collisons are very rare. Hence, no more complexity is added to ensure uniqueness. Signed-off-by: Harish Kasiviswanathan

[PATCH 1/2] drm/amdkfd: Use dev_error intead of pr_error

2024-05-01 Thread Harish Kasiviswanathan
No functional change. This will help in moving gpu_id creation to next step while still being able to identify the correct GPU Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff

[PATCH] drm/amdkfd: Enforce queue BO's adev

2024-04-24 Thread Harish Kasiviswanathan
Queue buffer, though it is in system memory, has to be created using the correct amdgpu device. Enforce this as the BO needs to mapped to the GART for MES Hardware scheduler to access it. Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 5 + 1 file

[PATCH] drm/amdkfd: Reset GPU on queue preemption failure

2024-03-26 Thread Harish Kasiviswanathan
-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c index 151fabf84040..c08b6ee25289 100644 --- a/drivers

[PATCH] drm/amdgpu: Removed used parameter

2024-02-27 Thread Harish Kasiviswanathan
Also passing adev is misleading if BO is associated with different adev. In this case BO is mapped to a different device Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 4 ++-- drivers/gpu/drm

[PATCH] drm/amdkfd: Insert missing TLB flush on GFX10 and later

2023-09-11 Thread Harish Kasiviswanathan
Heavy-weight TLB flush is required after unmap on all GPUs for correctness and security. Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm

[PATCH] drm/amdkfd: Add missing gfx11 MQD manager callbacks

2023-08-25 Thread Harish Kasiviswanathan
From: Jay Cornwall mqd_stride function was introduced in commit 129c7b6a0217 ("drm/amdkfd: Update MQD management on multi XCC setup") but not assigned for gfx11. Fixes a NULL dereference in debugfs. Signed-off-by: Jay Cornwall Signed-off-by: Harish Kasiviswanathan --- drivers/g

[PATCH] drm/amdkfd: ratelimited SQ interrupt messages

2023-08-10 Thread Harish Kasiviswanathan
No functional change. Use ratelimited version of pr_ to avoid overflowing of dmesg buffer Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdkfd/kfd_int_process_v10.c | 6 +++--- drivers/gpu/drm/amd/amdkfd/kfd_int_process_v11.c | 6 +++--- drivers/gpu/drm/amd/amdkfd

[PATCH] drm/amdgpu: Add decode_iv_ts helper for ih_v6 block

2022-08-15 Thread Harish Kasiviswanathan
Signed-off-by: Harish Kasiviswanathan Reviewed-by: Hawking Zhang --- drivers/gpu/drm/amd/amdgpu/ih_v6_0.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c b/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c index 92dc60a9d209..085e613f3646 100644 --- a/drivers/gpu

[PATCH] drm/amdgpu: Set correct DMA mask for aldebaran

2022-02-28 Thread Harish Kasiviswanathan
Aldebaran has 48-bit physical address support Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c index

[PATCH v2] drm/amdkfd: Print bdf in peer map failure message

2022-02-22 Thread Harish Kasiviswanathan
Print alloc node, peer node and memory domain when peer map fails. This is more useful v2: use dev_err instead of pr_err use bdf for identify peer gpu Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 11 +-- 1 file changed, 9 insertions(+), 2

[PATCH] drm/amdgpu: Print node id in peer map failure message

2022-02-15 Thread Harish Kasiviswanathan
Print alloc node, peer node and memory domain when peer map fails. This is more useful Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers

[PATCH] drm/amdkfd: Add Aldebaran gws support

2021-04-27 Thread Harish Kasiviswanathan
v2: updated MEC FW version after validating gws with debugger Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd

[PATCH] drm/amd/pm: Use correct typecast

2021-04-26 Thread Harish Kasiviswanathan
Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c index 1f02e4ee2909

[PATCH] drm/amd/pm: Update energy_accumulator in gpu metrics

2021-04-23 Thread Harish Kasiviswanathan
Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c index dcbe3a72da09

[PATCH] drm/amdkfd: Add Aldebaran gws support

2021-04-21 Thread Harish Kasiviswanathan
Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index b31bae91fbd0..bc57b07523e0 100644 --- a/drivers/gpu

[PATCH 4/4] Revert "drm/amdgpu: workaround the TMR MC address issue (v2)"

2021-04-09 Thread Harish Kasiviswanathan
From: Oak Zeng This reverts commit 34a33d4683cba7ba63c894132efb1998c0217631. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 9 - drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 10 -- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 21 ++---

[PATCH 3/4] drm/amdgpu: Introduce new SETUP_TMR interface

2021-04-09 Thread Harish Kasiviswanathan
From: Oak Zeng This new interface passes both virtual and physical address to PSP. It is backward compatible with old interface. v2: use a function to simplify tmr physical address calc (Lijo) Signed-off-by: Oak Zeng Reviewed-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdgpu

[PATCH 2/4] drm/amdgpu: Calling address translation functions to simplify codes

2021-04-09 Thread Harish Kasiviswanathan
From: Oak Zeng Use amdgpu_gmc_vram_pa and amdgpu_gmc_vram_cpu_pa to simplify codes. No logic change. Signed-off-by: Oak Zeng Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 4 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 3 +-- drivers/gpu/drm/amd

[PATCH 1/4] drm/amdgpu: Introduce functions for vram physical addr calculation

2021-04-09 Thread Harish Kasiviswanathan
From: Oak Zeng Add one function to calculate BO's GPU physical address. And another function to calculate BO's CPU physical address. v2: Use functions vs macros (Christian) Use more proper function names (Christian) Signed-off-by: Oak Zeng Suggested-by: Lijo Lazar Reviewed-by: Christian

[PATCH] Revert "drm/amdgpu: During compute disable GFXOFF for Sienna_Cichlid"

2021-03-09 Thread Harish Kasiviswanathan
This reverts commit 73bf5cad2696fe3a21f70101821405db839ea18e. Fixed in newer firmware Signed-off-by: Harish Kasiviswanathan --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd

[PATCH] drm/amdkfd: PCIe atomics required for gfx10

2020-12-16 Thread Harish Kasiviswanathan
Signed-off-by: Harish Kasiviswanathan Change-Id: Ic139a8b9c8bef1df183804e543103be206405dca --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd

[PATCH] drm/amdgpu: During compute disable GFXOFF for Sienna_Cichlid

2020-10-22 Thread Harish Kasiviswanathan
Signed-off-by: Harish Kasiviswanathan Change-Id: Ia9f8872b7654b99864bbef1afb9998d0cf39b7e5 --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c index

[PATCH v3] drm/amdgpu: Sync KFD fence only for move/evict

2017-10-20 Thread Harish Kasiviswanathan
are identified by the fence owner AMDGPU_FENCE_OWNER_UNDEFINED v2: Always sync to exclusive fence v3: avoid unncessary diverge from amd-staging-drm-next Change-Id: I8752d1cf6b2a1c4f2a57292b7c2cd308d5b6f9b7 Signed-off-by: Harish Kasiviswanathan <harish.kasiviswanat...@amd.com> --- drivers/g

[PATCH v2] drm/amdgpu: Sync KFD fence only for move/evict

2017-10-20 Thread Harish Kasiviswanathan
are identified by the fence owner AMDGPU_FENCE_OWNER_UNDEFINED v2: Always sync to exclusive fence Change-Id: I8752d1cf6b2a1c4f2a57292b7c2cd308d5b6f9b7 Signed-off-by: Harish Kasiviswanathan <harish.kasiviswanat...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 8 1 file chan

[PATCH] drm/amdgpu: Sync KFD fence only for move/evict

2017-10-19 Thread Harish Kasiviswanathan
are identified by the fence owner AMDGPU_FENCE_OWNER_UNDEFINED Change-Id: I8752d1cf6b2a1c4f2a57292b7c2cd308d5b6f9b7 Signed-off-by: Harish Kasiviswanathan <harish.kasiviswanat...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-)

[PATCH v2 2/2] drm/amdgpu: Add amdgpu_find_mm_node()

2017-10-11 Thread Harish Kasiviswanathan
v2: Use amdgpu_find_mm_node() in amdgpu_ttm_io_mem_pfn() Change-Id: I12231e18bb60152843cd0e0213ddd0d0e04e7497 Signed-off-by: Harish Kasiviswanathan <harish.kasiviswanat...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 49 ++--- 1 file changed, 27 inse

[PATCH v2 1/2] drm/amdgpu: Refactor amdgpu_move_blit

2017-10-11 Thread Harish Kasiviswanathan
nged amdgpu_copy_ttm_mem_to_mem() function parameters to use the struct v3: Minor function name change Change-Id: I848d541a84a1c2d12827d9dcf6d9054d854b4159 Signed-off-by: Harish Kasiviswanathan <harish.kasiviswanat...@amd.com> Reviewed-by: Christian König <christian.koe...@amd.com> --- dri

[PATCH v2 2/2] drm/amdgpu: Add amdgpu_find_mm_node()

2017-10-06 Thread Harish Kasiviswanathan
Change-Id: I12231e18bb60152843cd0e0213ddd0d0e04e7497 Signed-off-by: Harish Kasiviswanathan <harish.kasiviswanat...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 36 +++-- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/d

[PATCH v2 1/2] drm/amdgpu: Refactor amdgpu_move_blit

2017-10-06 Thread Harish Kasiviswanathan
nged amdgpu_copy_ttm_mem_to_mem() function parameters to use the struct Change-Id: I848d541a84a1c2d12827d9dcf6d9054d854b4159 Signed-off-by: Harish Kasiviswanathan <harish.kasiviswanat...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 169 +++- drivers/gpu/drm/

[PATCH] drm/amdgpu: Refactor amdgpu_move_blit

2017-10-05 Thread Harish Kasiviswanathan
4159 Signed-off-by: Harish Kasiviswanathan <harish.kasiviswanat...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 159 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 7 ++ 2 files changed, 107 insertions(+), 59 deletions(-) diff --git a/drivers/gpu/drm/

[PATCH 1/2] drm/amdgpu: vm_update_ptes remove code duplication

2017-06-09 Thread Harish Kasiviswanathan
Signed-off-by: Harish Kasiviswanathan <harish.kasiviswanat...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 73 -- 1 file changed, 16 insertions(+), 57 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/

[PATCH 2/2] drm/amdgpu: Fix compiler warnings

2017-06-09 Thread Harish Kasiviswanathan
Signed-off-by: Harish Kasiviswanathan <harish.kasiviswanat...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index c308047..9

[PATCH 4/4] drm/amdgpu: Support page table update via CPU

2017-05-11 Thread Harish Kasiviswanathan
Signed-off-by: Harish Kasiviswanathan <harish.kasiviswanat...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 82 +- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgp

[PATCH 1/4] drm/amdgpu: Return EINVAL if no PT BO

2017-05-11 Thread Harish Kasiviswanathan
This change is also useful for the upcoming changes where page tables can be updated by CPU. Change-Id: I07510ed60c94cf1944ee96bb4b16c40ec88ea17c Signed-off-by: Harish Kasiviswanathan <harish.kasiviswanat...@amd.com> Reviewed-by: Christian König <christian.koe...@amd.com> --- drivers

[PATCH 3/4] drm/amdgpu: Support page directory update via CPU

2017-05-11 Thread Harish Kasiviswanathan
If amdgpu.vm_update_context param is set to use CPU, then Page Directories will be updated by CPU instead of SDMA Signed-off-by: Harish Kasiviswanathan <harish.kasiviswanat...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 141 +++-- 1 file chang