[PATCH 4/5] drm/amdkfd: Set priv_queue to NULL after it is freed

2021-07-16 Thread Oak Zeng
This variable will be used to determine whether packet manager is initialized or not, in a future patch. Signed-off-by: Oak Zeng Acked-by: Christian Konig Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 0/5] MISC fixes

2021-07-16 Thread Oak Zeng
Oak Zeng (5): drm/amdgpu: Fix a printing message drm/amdgpu: Change a few function names drm/amdkfd: Renaming dqm->packets to dqm->packet_mgr drm/amdkfd: Set priv_queue to NULL after it is freed drm/amdkfd: Fix a concurrency issue during kfd recovery drivers/gpu/drm/amd/

[PATCH 1/5] drm/amdgpu: Fix a printing message

2021-07-16 Thread Oak Zeng
ck hw_init. Fix the printing message Signed-off-by: Oak Zeng Reviewed-by: Christian Konig --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +- 4 files changed, 4

[PATCH 2/5] drm/amdgpu: Change a few function names

2021-07-16 Thread Oak Zeng
Function name "psp_np_fw_load" is not proper as people don't know _np_fw_ means "non psp firmware". Change the function name to psp_load_non_psp_fw for better understanding. Same thing for function psp_execute_np_fw_load. Signed-off-by: Oak Zeng Reviewed-by: Alex Deucher Re

[PATCH 5/5] drm/amdkfd: Fix a concurrency issue during kfd recovery

2021-07-16 Thread Oak Zeng
moves pm_init/uninit inside the dpm lock and check packet manager is initialized before using packet manager function. Signed-off-by: Oak Zeng Acked-by: Christian Konig --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 8 +--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c

[PATCH 3/5] drm/amdkfd: Renaming dqm->packets to dqm->packet_mgr

2021-07-16 Thread Oak Zeng
Renaming packets to packet_mgr to reflect the real meaning of this variable. Signed-off-by: Oak Zeng Acked-by: Christian Konig --- drivers/gpu/drm/amd/amdkfd/kfd_device.c| 2 +- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 26 +++--- .../gpu/drm/amd/amdkfd

[PATCH 1/5] drm/amdgpu: Fix a printing message

2021-07-15 Thread Oak Zeng
ck hw_init. Fix the printing message Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)

[PATCH 4/5] drm/amdkfd: Set priv_queue to NULL after it is freed

2021-07-15 Thread Oak Zeng
This variable will be used to determine whether packet manager is initialized or not, in a future patch. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c b/drivers/gpu

[PATCH 2/5] drm/amdgpu: Change a few function names

2021-07-15 Thread Oak Zeng
Function name "psp_np_fw_load" is not proper as people don't know _np_fw_ means "non psp firmware". Change the function name to psp_load_non_psp_fw for better understanding. Same thing for function psp_execute_np_fw_load. Signed-off-by: Oak Zeng Reviewed-by: Alex Deucher

[PATCH 5/5] drm/amdkfd: Fix a concurrency issue during kfd recovery

2021-07-15 Thread Oak Zeng
moves pm_init/uninit inside the dpm lock and check packet manager is initialized before using packet manager function. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 8 +--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 10 -- drivers

[PATCH 0/5] MISC fixes

2021-07-15 Thread Oak Zeng
Oak Zeng (5): drm/amdgpu: Fix a printing message drm/amdgpu: Change a few function names drm/amdkfd: Renaming dqm->packets to dqm->dpm drm/amdkfd: Set priv_queue to NULL after it is freed drm/amdkfd: Fix a concurrency issue during kfd recovery drivers/gpu/drm/amd/amdgpu/amdgpu

[PATCH 3/5] drm/amdkfd: Renaming dqm->packets to dqm->dpm

2021-07-15 Thread Oak Zeng
Renaming packets to dpm (device packet manager) to reflect the real meaning of this variable. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdkfd/kfd_device.c| 2 +- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 26 +++--- .../gpu/drm/amd/amdkfd

[PATCH 4/5] drm/amdkfd: Set priv_queue to NULL after it is freed

2021-07-15 Thread Oak Zeng
This variable will be used to determine whether packet manager is initialized or not, in a future patch. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c b/drivers/gpu

[PATCH 2/5] drm/amdgpu: Change a few function names

2021-07-15 Thread Oak Zeng
Function name "psp_np_fw_load" is not proper as people don't know _np_fw_ means "non psp firmware". Change the function name to psp_load_non_psp_fw for better understanding. Same thing for function psp_execute_np_fw_load. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdg

[PATCH 3/5] drm/amdkfd: Renaming dqm->packets to dqm->dpm

2021-07-15 Thread Oak Zeng
Renaming packets to dpm (device packet manager) to reflect the real meaning of this variable. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdkfd/kfd_device.c| 2 +- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 26 +++--- .../gpu/drm/amd/amdkfd

[PATCH 5/5] drm/amdkfd: Fix a concurrency issue during kfd recovery

2021-07-15 Thread Oak Zeng
moves pm_init/uninit inside the dpm lock and check packet manager is initialized before using packet manager function. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 8 +--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 10 -- drivers

[PATCH 1/5] drm/amdgpu: Fix a printing message

2021-07-15 Thread Oak Zeng
ck hw_init. Fix the printing message Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)

[PATCH 0/5] MISC fixes

2021-07-15 Thread Oak Zeng
Oak Zeng (5): drm/amdgpu: Fix a printing message drm/amdgpu: Change a few function names drm/amdkfd: Renaming dqm->packets to dqm->dpm drm/amdkfd: Set priv_queue to NULL after it is freed drm/amdkfd: Fix a concurrency issue during kfd recovery drivers/gpu/drm/amd/amdgpu/amdgpu

[PATCH 2/3] drm/amdgpu: Fix a printing message

2021-07-14 Thread Oak Zeng
ck hw_init. Fix the printing message Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 +- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)

[PATCH 1/3] drm/amdkfd: Disallow debugfs to hang hws when GPU is resetting

2021-07-14 Thread Oak Zeng
234508] __x64_sys_write+0x1a/0x20 [12808.234511] do_syscall_64+0x57/0x190 [12808.234514] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/d

[PATCH 3/3] drm/amdgpu: Change a few function names

2021-07-14 Thread Oak Zeng
Function name "psp_np_fw_load" is not proper as people don't know _np_fw_ means "non psp firmware". Change the function name to psp_load_non_psp_fw for better understanding. Same thing for function psp_execute_np_fw_load. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdg

[PATCH 0/3] MISC fixes

2021-07-14 Thread Oak Zeng
Oak Zeng (3): drm/amdkfd: Disallow debugfs to hang hws when GPU is resetting drm/amdgpu: Fix a printing message drm/amdgpu: Change a few function names drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 16 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdkfd: Disallow debugfs to hang hws when GPU is resetting

2021-07-07 Thread Oak Zeng
If GPU is during a resetting cycle, writing to GPU can cause unpredictable protection fault. Disallow using kfd debugfs hang_hws to hang hws if GPU is resetting. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers

[PATCH] drm/amdgpu: Set ttm caching flags during bo allocation

2021-06-28 Thread Oak Zeng
moves the ttm caching flags setting to function amdgpu_vram_mgr_new - this function is called during the first step of a buffer object create (eg, DRM_AMDGPU_GEM_CREATE) so the later both CPU and GPU mapping function calls will pick up this flag for CPU/GPU page table set up. Signed-off-by: Oak Zeng

[PATCH 2/4] drm/amdkfd: Don't create crat memory sub-table if node has no memory

2021-06-01 Thread Oak Zeng
In some configuration, there is CPU-only (no memory) numa node. Don't create crat memory sub-table for such node. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd

[PATCH 4/4] drm/amdkfd: Patch memory parameters for all CPU nodes

2021-06-01 Thread Oak Zeng
There can be more than one CPU nodes. Patch memory width and clock info for all CPU nodes, instead of only the first one. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd

[PATCH 3/4] drm/amdkfd: Use simd_count to determine whether it is a GPU node

2021-06-01 Thread Oak Zeng
Previously we used cpu_cores_count==0 to determine whether a node is a GPU node. This is not correct any more since we introduced memory only numa node. For memory only numa node, cpu_cores_count is also 0 but it is not a GPU node. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdkfd

[PATCH 1/4] drm/amdkfd: Create node in kfd sysfs for memory only numa node

2021-06-01 Thread Oak Zeng
Previously kfd driver assumes all CPU numa nodes are associated with system memory and there is no memory only numa node. This is not true anymore for ALDEBARAN A+A set up. This patch creates memory only node in kfd sysfs. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 73

[PATCH 2/4] drm/amdkfd: Don't create crat memory sub-table if node has no memory

2021-06-01 Thread Oak Zeng
In some configuration, there is CPU-only (no memory) numa node. Don't create crat memory sub-table for such node. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd

[PATCH] drm/amdgpu: Quit RAS initialization earlier if RAS is disabled

2021-05-06 Thread Oak Zeng
If RAS is disabled through amdgpu_ras_enable kernel parameter, we should quit the RAS initialization eariler to avoid initialization of some RAS data structure such as sysfs etc. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +- 1 file changed, 1 insertion(+), 1

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

2021-04-01 Thread Oak Zeng
This reverts commit 34a33d4683cba7ba63c894132efb1998c0217631. 34a33d4683cba7ba63c894132efb1998c0217631 was a driver workaround when PSP firmware was not ready. Now the PSP fw is ready so we revert this driver workaround. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 9

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

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

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

2021-04-01 Thread 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 --- drivers/gpu/drm/amd/amdgpu

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

2021-04-01 Thread 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 ++--- drivers/gpu/drm/amd

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

2021-04-01 Thread Oak Zeng
This new interface passes both virtual and physical address to PSP. It is backword compatible with old interface. v2: use a function to simply tmr physical address calc (Lijo) Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 12 +--- drivers/gpu/drm/amd/amdgpu

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

2021-03-30 Thread 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 ++--- drivers/gpu/drm/amd

[PATCH 2/4] drm/amdgpu: use macros to simplify codes

2021-03-30 Thread Oak Zeng
Use amdgpu_gmc_gpu_pa and amdgpu_gmc_cpu_pa to simplify codes. No logic change. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 4 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 3 +-- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 3 +-- drivers/gpu/drm/amd/amdgpu

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

2021-03-30 Thread Oak Zeng
This new interface passes both virtual and physical address to PSP. It is backword compatible with old interface. v2: use a macro to simply tmr physical address calc (Lijo) Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 12 +--- drivers/gpu/drm/amd/amdgpu

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

2021-03-30 Thread Oak Zeng
Add one macro to calculate BO's GPU physical address. And another one to calculate BO's CPU physical address. Signed-off-by: Oak Zeng Suggested-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu

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

2021-03-25 Thread Oak Zeng
This new interface passes both virtual and physical address to PSP. It is backword compatible with old interface. v2: use a macro to simply tmr physical address calc (Lijo) Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 12 +--- drivers/gpu/drm/amd/amdgpu

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

2021-03-25 Thread 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 ++--- drivers/gpu/drm/amd

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

2021-03-25 Thread Oak Zeng
Add one macro to calculate BO's GPU physical address. And another one to calculate BO's CPU physical address. Signed-off-by: Oak Zeng Suggested-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH 2/4] drm/amdgpu: use macros to simplify codes

2021-03-25 Thread Oak Zeng
Use amdgpu_gmc_gpu_pa and amdgpu_gmc_cpu_pa to simplify codes. No logic change. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 4 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 +--- drivers/gpu

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

2021-03-12 Thread 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 ++--- drivers/gpu/drm/amd

[PATCH 2/2] drm/amdgpu: Introduce new SETUP_TMR interface

2021-03-12 Thread Oak Zeng
This new interface passes both virtual and physical address to PSP. It is backword compatible with old interface. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 13 ++--- drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h | 11 ++- 2 files changed, 20 insertions

[PATCH 2/2] drm/amdgpu: fix a few compiler warnings

2021-03-10 Thread Oak Zeng
1. make function mmhub_v1_7_setup_vm_pt_regs static 2. indent a if statement Signed-off-by: Oak Zeng Reported-by: kernel test robot Reported-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_1.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/mmhub_v1_7.c | 2 +- 2 files changed, 3 insertions

[PATCH 1/2] drm/amdgpu: fix compile error on architecture s390

2021-03-10 Thread Oak Zeng
ioremap_cache is not supported on some architecture such as s390. Put the codes into a #ifdef to fix some compile error reported by test robot. Signed-off-by: Oak Zeng Reported-by: Kernel test robot --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] drm/ttm: ioremap buffer according to TTM mem caching setting

2021-03-04 Thread Oak Zeng
-by: Oak Zeng Reviewed-by: Christian Konig --- drivers/gpu/drm/ttm/ttm_bo_util.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 031e581..7429464 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers

[PATCH] drm/ttm: ioremap buffer according to TTM mem caching setting

2021-03-03 Thread Oak Zeng
-by: Oak Zeng Reviewed-by: Christian Konig --- drivers/gpu/drm/ttm/ttm_bo_util.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 031e581..7c848e2 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers

[PATCH] drm/ttm: ioremap buffer according to TTM mem caching setting

2021-03-01 Thread Oak Zeng
-by: Oak Zeng Reviewed-by: Christian Konig --- drivers/gpu/drm/ttm/ttm_bo_util.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 031e581..8c65a13 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm

[PATCH] drm/amdgpu: Use free system memory size for kfd memory accounting

2021-01-20 Thread Oak Zeng
applications only 1GB of system memory. In many cases, this leads to OOM killer. This patch changed the KFD system memory accounting scheme. 15/16 of free system memory when kfd driver load. This deduct the system memory that OS already use. Signed-off-by: Oak Zeng Suggested-by: Philip Yang

[PATCH] drm/amdgpu: use function pointer for gfxhub functions

2020-09-17 Thread Oak Zeng
gfxhub functions are now called from function pointers, instead of from asic-specific functions. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 4 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c | 3 +- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c

[PATCH 2/2] drm/amdgpu: More accurate description of a function param

2020-09-11 Thread Oak Zeng
Add more accurate description of the pe parameter of function amdgpu_vm_sdma_udpate and amdgpu_vm_cpu_update Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions

[PATCH 1/2] drm/amdgpu: Add comment to function amdgpu_ttm_alloc_gart

2020-09-11 Thread Oak Zeng
Add comments to refect what function does Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 63e5414..8b70445

[PATCH] drm/amdgpu: Use function pointer for some mmhub functions

2020-08-11 Thread Oak Zeng
: I65ba660c69b74c7e779190c4f92e9d7138f7c7d4 Signed-off-by: Oak Zeng --- .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_arcturus.c| 21 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.h | 3 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.h | 13 ++ drivers

[PATCH] drm/amdgpu: Print UTCL2 client ID on a gpuvm fault

2020-04-06 Thread Oak Zeng
UTCL2 client ID is useful information to get which UTCL2 client caused the gpuvm fault. Print it out for debug purpose Change-Id: I733d0127b0ee53aa788f194cefa53cbb55b49c11 Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 +++ drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 3

[PATCH] drm/amdgpu: Apply noretry setting for mmhub9.4

2019-11-22 Thread Oak Zeng
Config the translation retry behavior according to noretry kernel parameter Change-Id: I5b91ea77715137cf8cb84e258ccdfbb19c7a4ed1 Signed-off-by: Oak Zeng Suggested-by: Jay Cornwall --- drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git

[PATCH] drm/amdgpu: Apply noretry setting for gfx10 and mmhub9.4

2019-11-22 Thread Oak Zeng
Config the translation retry behavior according to noretry kernel parameter Change-Id: I5b91ea77715137cf8cb84e258ccdfbb19c7a4ed1 Signed-off-by: Oak Zeng Suggested-by: Jay Cornwall --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 +++- drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.c | 5 +++-- 2 files

[PATCH] drm/amdgpu: Fix num_doorbell calculation issue

2018-11-30 Thread Oak Zeng
), not *2. Change-Id: I62023bb91da33ca5532b22b263771b587b796d59 Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

[PATCH 3/8] drm/amdgpu: Vega10 doorbell index initialization

2018-11-26 Thread Oak Zeng
v2: Use enum definition instead of hardcoded value v3: Remove unused enum definition Change-Id: Ib72058337f0aa53adfc6c6aae5341a7cd665111a Signed-off-by: Oak Zeng Suggested-by: Felix Kuehling Suggested-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 14

[PATCH 7/8] drm/amdgpu: Use asic specific doorbell index instead of macro definition

2018-11-26 Thread Oak Zeng
Change-Id: I84475efcfb482c474fccb133010abb5df5f4 Signed-off-by: Oak Zeng Suggested-by: Felix Kuehling Suggested-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 27 --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- drivers/gpu/drm/amd/amdgpu

[PATCH 3/8] drm/amdgpu: Vega10 doorbell index initialization

2018-11-26 Thread Oak Zeng
v2: Use enum definition instead of hardcoded value Change-Id: Ib72058337f0aa53adfc6c6aae5341a7cd665111a Signed-off-by: Oak Zeng Suggested-by: Felix Kuehling Suggested-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/soc15.c | 1 + drivers/gpu/drm/amd/amdgpu/soc15.h | 1

[PATCH 5/8] drm/amdgpu: Doorbell layout for vega20 and future asic

2018-11-26 Thread Oak Zeng
v2: Use enum definition instead of hardcoded value Change-Id: I04d22fb717ac50483c0835f160a2e860e344f358 Signed-off-by: Oak Zeng Suggested-by: Felix Kuehling Suggested-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 50 drivers/gpu/drm/amd

[PATCH 4/8] drm/amdgpu: Doorbell index initialization for ASICs before vega10

2018-11-26 Thread Oak Zeng
v2: Use enum definition instead of hardcoded number Change-Id: Id64eb98f5b1c24b51eb2fd5a083086fc3515813d Signed-off-by: Oak Zeng Suggested-by: Felix Kuehling Suggested-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/cik.c | 1 + drivers/gpu/drm/amd/amdgpu/cik.h | 1 + drivers/gpu/drm/amd

[PATCH 8/8] drm/amdgpu: Moved doorbell structures to seperate file

2018-11-26 Thread Oak Zeng
Move doorbell structures, enum definitions and helper functions from amdgpu.h to amdgpu_doorbell.h. No functional change Change-Id: I09f7b84869b6d3c688b7a2506ff78d62b3de23f5 Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 227 +--- drivers/gpu/drm

[PATCH 6/8] drm/amdgpu: Call doorbell index init on device initialization

2018-11-26 Thread Oak Zeng
Also call functioin amdgpu_device_doorbell_init after amdgpu_device_ip_early_init because the former depends on the later to set up asic-specific init_doorbell_index function Change-Id: I2f004bbbe2565035460686f4fc16e86b77a2a9b5 Signed-off-by: Oak Zeng Suggested-by: Felix Kuehling Suggested

[PATCH 2/8] drm/amdgpu: Add asic func interface to init doorbell index

2018-11-26 Thread Oak Zeng
Change-Id: I7e8a9c9dfd4f3bd0902679a1771c1a043ece2674 Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index b7ee4ef..719da32 100644 --- a/drivers/gpu

[PATCH] drm/amdgpu: Moved doorbell structures to seperate file

2018-11-23 Thread Oak Zeng
Move doorbell structures, enum definitions and helper functions from amdgpu.h to amdgpu_doorbell.h. No functional change Change-Id: I09f7b84869b6d3c688b7a2506ff78d62b3de23f5 Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 227 +--- drivers/gpu/drm

[PATCH 4/7] drm/amdgpu: Doorbell index initialization for ASICs before vega10

2018-11-21 Thread Oak Zeng
v2: Use enum definition instead of hardcoded number Change-Id: Id64eb98f5b1c24b51eb2fd5a083086fc3515813d Signed-off-by: Oak Zeng Suggested-by: Felix Kuehling Suggested-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/Makefile | 2 +- drivers/gpu/drm/amd/amdgpu/vi.h | 2

[PATCH 7/7] drm/amdgpu: Use new doorbell layout for vega20 and future asic

2018-11-21 Thread Oak Zeng
v2: Use enum definition instead of hardcoded value Change-Id: I04d22fb717ac50483c0835f160a2e860e344f358 Signed-off-by: Oak Zeng Suggested-by: Felix Kuehling Suggested-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 50 drivers/gpu/drm/amd

[PATCH 6/7] drm/amdgpu: Use asic specific doorbell index instead of macro definition

2018-11-21 Thread Oak Zeng
Change-Id: I84475efcfb482c474fccb133010abb5df5f4 Signed-off-by: Oak Zeng Suggested-by: Felix Kuehling Suggested-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 27 --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- drivers/gpu/drm/amd/amdgpu

[PATCH 5/7] drm/amdgpu: Call doorbell index init on device initialization

2018-11-21 Thread Oak Zeng
Change-Id: I2f004bbbe2565035460686f4fc16e86b77a2a9b5 Signed-off-by: Oak Zeng Suggested-by: Felix Kuehling Suggested-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers

[PATCH 1/7] drm/amdgpu: Add field in amdgpu_dev to hold reserved doorbell index

2018-11-21 Thread Oak Zeng
This is a preparation work to make reserved doorbell index per device, instead of using a global macro definition. By doing this, we can easily change doorbell layout for future ASICs while not affecting ASICs in production. Change-Id: If08e2bc9d0749748ed4083ba4eb32a4698763085 Signed-off-by: Oak

[PATCH 3/7] drm/amdgpu: Vega12 doorbell index initialization

2018-11-21 Thread Oak Zeng
v2: Changed file name for consistency Change-Id: Ib2c570224321bb7002d2ed01f43ac70203e86f88 Signed-off-by: Oak Zeng Suggested-by: Felix Kuehling Suggested-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/Makefile | 2 +- drivers/gpu/drm/amd/amdgpu/soc15.h | 1 + drivers/gpu

[PATCH 4/7] drm/amdgpu: Doorbell index initialization for ASICs before vega10

2018-11-21 Thread Oak Zeng
Change-Id: Id64eb98f5b1c24b51eb2fd5a083086fc3515813d Signed-off-by: Oak Zeng Suggested-by: Felix Kuehling Suggested-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/Makefile| 3 +- drivers/gpu/drm/amd/amdgpu/vi.h| 2 +- .../gpu/drm/amd/amdgpu

[PATCH 7/7] drm/amdgpu: Use new doorbell layout for vega20 and future asic

2018-11-21 Thread Oak Zeng
Change-Id: I04d22fb717ac50483c0835f160a2e860e344f358 Signed-off-by: Oak Zeng Suggested-by: Felix Kuehling Suggested-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/Makefile| 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +- drivers/gpu/drm/amd/amdgpu/soc15.h

[PATCH 6/7] drm/amdgpu: Use asic specific doorbell index instead of macro definition

2018-11-21 Thread Oak Zeng
Also deleted doorbell index macro definition Change-Id: I84475efcfb482c474fccb133010abb5df5f4 Signed-off-by: Oak Zeng Suggested-by: Felix Kuehling Suggested-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 106 - drivers/gpu/drm/amd/amdgpu

[PATCH 2/7] drm/amdgpu: Vega10 doorbell index initialization

2018-11-21 Thread Oak Zeng
Change-Id: Ib72058337f0aa53adfc6c6aae5341a7cd665111a Signed-off-by: Oak Zeng Suggested-by: Felix Kuehling Suggested-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/Makefile| 2 +- drivers/gpu/drm/amd/amdgpu/soc15.h | 1 + .../drm/amd/amdgpu

[PATCH 1/7] drm/amdgpu: Add field in amdgpu_dev to hold reserved doorbell index

2018-11-21 Thread Oak Zeng
This is a preparation work to make reserved doorbell index per device, instead of using a global macro definition. By doing this, we can easily change doorbell layout for future ASICs while not affecting ASICs in production. Change-Id: If08e2bc9d0749748ed4083ba4eb32a4698763085 Signed-off-by: Oak

[PATCH 3/4] drm/amdkfd: Allocate SDMA queue on specif engine

2018-11-13 Thread Oak Zeng
From: Oak Zeng Change-Id: I32e0304cdf6ceeed12ea8d0af62f44e1ab20bffb Signed-off-by: Oak Zeng Reviewd-by: Felix Kuehling --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 26 +-- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 30 +++--- 2 files

[PATCH 4/4] drm/amdkfd: Add sdma allocation debug message

2018-11-13 Thread Oak Zeng
From: Oak Zeng Change-Id: I47ec79eceac810f7031eaf88d267fc8370501c27 Signed-off-by: Oak Zeng Reviewd-by: Felix Kuehling --- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b

[PATCH] drm/amdgpu: Expose an IP function to get register offset

2018-10-30 Thread Oak Zeng
Expose get_reg_offset function of sdma_v4_0 for kfd to use Change-Id: Ib687b390d6d3f8c8a35651e064e35aacf6722f98 Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 7 +++ drivers/gpu/drm/amd/include/amd_shared.h | 3 +++ 2 files changed, 10 insertions(+) diff --git

[PATCH] drm/amdgpu: Added a few comments for gart

2018-10-24 Thread Oak Zeng
Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_gart.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c index 9a212aa..6d11e17 100644

[PATCH 2/2] drm/amdgpu: Deleted faults kfifo

2018-09-07 Thread Oak Zeng
With the change of making fault hash per vm, this is not needed anymore. Change-Id: I9427ff1786deaf1f5b7d121a6f7f75f00acfc9b7 Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 - drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 3 --- drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 9

[PATCH 1/2] drm/amdgpu: Moved fault hash table to amdgpu vm

2018-09-07 Thread Oak Zeng
In stead of share one fault hash table per device, make it per vm. This can avoid inter-process lock issue when fault hash table is full. Change-Id: I5d1281b7c41eddc8e26113e010516557588d3708 Signed-off-by: Oak Zeng Suggested-by: Christian Konig Suggested-by: Felix Kuehling --- drivers/gpu/drm

[PATCH 2/2] drm/amdkfd: Release an acquired process vm

2018-08-28 Thread Oak Zeng
For compute vm acquired from amdgpu, vm.pasid is managed by kfd. Decouple pasid from such vm on process destroy to avoid duplicate pasid release. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | 1

[PATCH 1/2] drm/amdgpu: Set pasid for compute vm

2018-08-28 Thread Oak Zeng
To make a amdgpu vm to a compute vm, the old pasid will be freed and replaced with a pasid managed by kfd. Kfd can't reuse original pasid allocated by amdgpu because kfd uses different pasid policy with amdgpu. For example, all graphic devices share one same pasid in a process. Signed-off-by: Oak

[PATCH 1/2] drm/amdgpu: Set pasid for compute vm

2018-08-28 Thread Oak Zeng
To make a amdgpu vm to a compute vm, the old pasid will be freed and replaced with a pasid managed by kfd. Kfd can't reuse original pasid allocated by amdgpu because kfd uses different pasid policy with amdgpu. For example, all graphic devices share one same pasid in a process. Signed-off-by: Oak

[PATCH 2/2] drm/amdkfd: Release an acquired process vm

2018-08-28 Thread Oak Zeng
For compute vm acquired from amdgpu, vm.pasid is managed by kfd. Decouple pasid from such vm on process destroy to avoid duplicate pasid release. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | 1

[PATCH 1/2] drm/amdgpu: Set pasid for compute vm

2018-08-27 Thread Oak Zeng
To make a amdgpu vm to a compute vm, the old pasid will be freed and replaced with a pasid managed by kfd. Kfd can't reuse original pasid allocated by amdgpu because kfd uses different pasid policy with amdgpu. For example, all graphic devices share one same pasid in a process. Signed-off-by: Oak

[PATCH 2/2] drm/amdkfd: Release an acquired process vm

2018-08-27 Thread Oak Zeng
For compute vm acquired from amdgpu, vm.pasid is managed by kfd. Decouple pasid from such vm on process destroy to avoid duplicate pasid release. Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | 1

[PATCH] drm/amdgpu: Set pasid for compute vm

2018-08-22 Thread Oak Zeng
Signed-off-by: Oak Zeng --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 8 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 20 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 2 +- drivers

[PATCH] drm/amdgpu: Move IH clientid defs to separate file

2018-03-11 Thread Oak Zeng
This is preparation for sharing client ID definitions between amdgpu and amdkfd Change-Id: Ie0b7b14c9c2366fd896745a51b74a9ba97ee3224 Signed-off-by: Oak Zeng <oak.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h | 43 + drivers/gpu/drm/amd/amdgpu/gfx_

[PATCH] drm/amdgpu: Move IH clientid defs to separate file

2018-03-08 Thread Oak Zeng
This is preparation for sharing client ID definitions between amdgpu and amdkfd Change-Id: Ie0b7b14c9c2366fd896745a51b74a9ba97ee3224 Signed-off-by: Oak Zeng <oak.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h | 44 +-- drivers/gpu/drm/amd/i

[PATCH] drm/amdgpu: Properly allocate VM invalidate eng v2

2017-11-14 Thread Oak Zeng
From: ozeng <oak.z...@amd.com> v1: Properly allocate TLB invalidation engine to avoid conflict. v2: Added comments to codes Change-Id: I9a32cbcb133c07d7efad1a7bd07c6e2098c747e7 Signed-off-by: Oak Zeng <oak.z...@amd.com> --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 15 +++