[PATCH 2/2] drm/sched: serialize job_timeout and scheduler

2021-08-31 Thread Monk Liu
tested-by: jingwen chen Signed-off-by: Monk Liu Signed-off-by: jingwen chen --- drivers/gpu/drm/scheduler/sched_main.c | 24 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c

[PATCH 1/2] drm/sched: fix the bug of time out calculation(v4)

2021-08-31 Thread Monk Liu
n) tested-by: jingwen Signed-off-by: Monk Liu --- drivers/gpu/drm/scheduler/sched_main.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index a2a9536..3e0b

[PATCH 2/2] drm/sched: serialize job_timeout and scheduler

2021-08-31 Thread Monk Liu
tested-by: jingwen chen Signed-off-by: Monk Liu Signed-off-by: jingwen chen --- drivers/gpu/drm/scheduler/sched_main.c | 24 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c

[PATCH 1/2] drm/sched: fix the bug of time out calculation(v3)

2021-08-31 Thread Monk Liu
scheduler in job_timeout to serial the handling of scheduler and job_timeout. 2)drop the bad job's del and insert in scheduler due to above serialization (no race issue anymore with the serialization) tested-by: jingwen Signed-off-by: Monk Liu --- drivers/gpu/drm/scheduler/sched_m

[PATCH] drm/sched: fix the bug of time out calculation(v3)

2021-08-25 Thread Monk Liu
scheduler in job_timeout to serial the handling of scheduler and job_timeout. 2)drop the bad job's del and insert in scheduler due to above serialization (no race issue anymore with the serialization) Signed-off-by: Monk Liu --- drivers/gpu/drm/scheduler/sched_main.c | 25 ++--- 1 fi

[PATCH] drm/sched: fix the bug of time out calculation(v2)

2021-08-24 Thread Monk Liu
a previous job signaled. v2: further cleanup the logic, and do the TDR timer cancelling if the signaled job is the last one in its scheduler. Signed-off-by: Monk Liu --- drivers/gpu/drm/scheduler/sched_main.c | 29 - 1 file changed, 20 insertions(+), 9 deletions

[PATCH] drm/sched: fix the bug of time out calculation

2021-08-24 Thread Monk Liu
a previous job signaled. Signed-off-by: Monk Liu --- drivers/gpu/drm/scheduler/sched_main.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index a2a9536..fb27025 100644 --- a/drivers/gpu/drm

[PATCH] drm/amdgpu: fix reload KMD hang on GFX10 KIQ

2020-08-09 Thread Monk Liu
(the config like HQD addr, ring size, is easily changed if we alter the sched_hw_submission) the fix is we must inactive KIQ first before touching any of its registgers Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu

[PATCH 2/2] drm/amdgpu: introduce a new parameter to configure how many KCQ we want(v5)

2020-07-31 Thread Monk Liu
hypervisor driver to set this paramter automatically thus no need for user to configure it through modprobe in virtual machine Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

[PATCH 1/2] drm/amdgpu: fix reload KMD hang on KIQ

2020-07-31 Thread Monk Liu
configuration (the config like HQD addr, ring size, is easily changed if we alter the sched_hw_submission) the fix is we must inactive KIQ first before touching any of its registgers Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 3 +++ 1 file changed, 3 insertions

[PATCH] drm/amdgpu: introduce a new parameter to configure how many KCQ we want(v4)

2020-07-30 Thread Monk Liu
to configure it through modprobe in virtual machine Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c| 4 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c| 52

[PATCH] drm/amdgpu: introduce a new parameter to configure how many KCQ we want(v4)

2020-07-30 Thread Monk Liu
to configure it through modprobe in virtual machine Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c| 4 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c| 52

[PATCH] drm/amdgpu: introduce a new parameter to configure how many KCQ we want(v3)

2020-07-28 Thread Monk Liu
affects gfx 8/9/10 v2: refine namings v3: choose queues for each ring to that try best to cross pipes evenly. TODO: in the future we will let hypervisor driver to set this paramter automatically thus no need for user to configure it through modprobe in virtual machine Signed-off-by: Monk Liu

[PATCH] drm/amdgpu: introduce a new parameter to configure how many KCQ we want(v2)

2020-07-27 Thread Monk Liu
: this paramter only affects gfx 8/9/10 TODO: in the future we will let hypervisor driver to set this paramter automatically thus no need for user to configure it through modprobe in virtual machine Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 1 + drivers/gpu/drm/amd

[PATCH] drm/amdgpu: introduce a new parameter to configure how many KCQ we want

2020-07-27 Thread Monk Liu
what: KCQ cost many clocks during world switch which impacts a lot to multi-VF performance how: introduce a paramter to control the number of KCQ to avoid performance drop if there is no KQC needed notes: this paramter only affects gfx 8/9/10 Signed-off-by: Monk Liu --- drivers/gpu/drm/amd

[PATCH] drm/amdgpu: make IB test synchronize with init for SRIOV(v2)

2020-06-29 Thread Monk Liu
the delayed_init routine at the bottom of device_init to avoid driver loading done prior to the IB test completes Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd

[PATCH] drm/amdgpu: make IB test synchronize with init for SRIOV

2020-06-29 Thread Monk Liu
: make IB test synchronize with driver init thus it won't still running when we shutdown the VM. Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 29 - 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdgpu: fix one vf mode

2020-04-26 Thread Monk Liu
still need to call system_enable_features for one vf mode but need to block the SMU request from SRIOV case and allows the software side change pass in "smu_v11_0_system_features_control" by this patlch the pp_dpm_mclk/sclk now shows correct output Signed-off-by: Monk Liu Singed-off

[PATCH 1/2] drm/amdgpu: extent threshold of waiting FLR_COMPLETE

2020-04-23 Thread Monk Liu
to 5s to satisfy WHOLE GPU reset which need 3+ seconds to finish Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h | 2 +- drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h b

[PATCH 2/2] drm/amdgpu: limit smu_set_mp1_state to pp_one_vf or bare-metal

2020-04-23 Thread Monk Liu
Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 3d601d5..810141f 100644 --- a/drivers/gpu/drm/amd/amdgpu

[PATCH 8/8] drm/amdgpu: for nv12 always need smu ip

2020-04-23 Thread Monk Liu
because nv12 SRIOV support one vf mode Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/nv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c index 995bdec..9c42316 100644 --- a/drivers/gpu/drm/amd

[PATCH 2/8] drm/amdgpu: skip cg/pg set for SRIOV

2020-04-23 Thread Monk Liu
Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index 8a579ce..909ef08 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers

[PATCH 5/8] drm/amdgpu: clear the messed up checking logic

2020-04-23 Thread Monk Liu
for MI100 + ASICS, we always support SW_SMU for bare-metal and for SRIOV one_vf_mode Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu

[PATCH 4/8] drm/amdgpu: provide RREG32_SOC15_NO_KIQ, will be used later

2020-04-23 Thread Monk Liu
Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/soc15_common.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15_common.h b/drivers/gpu/drm/amd/amdgpu/soc15_common.h index c893c64..56d02aa 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc15_common.h +++ b

[PATCH 7/8] drm/amdgpu: skip sysfs node not belong to one vf mode

2020-04-23 Thread Monk Liu
Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 48 -- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index 49e2e43..c762deb 100644 --- a/drivers

[PATCH 6/8] drm/amdgpu: enable one vf mode for nv12

2020-04-23 Thread Monk Liu
Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 12 +++- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 6 +++- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 49 +- 3 files changed, 52 insertions(+), 15 deletions(-) diff --git a/drivers/gpu

[PATCH 3/8] drm/amdgpu: sriov is forbidden to call disable DPM

2020-04-23 Thread Monk Liu
Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c index 88b4e56..2bb1e0c 100644 --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

[PATCH 1/8] drm/amdgpu: ignore TA ucode for SRIOV

2020-04-23 Thread Monk Liu
Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c index 0afd610..b4b0242 100644 --- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +++ b/drivers/gpu

[PATCH 1/7] drm/amdgpu: cleanup idh event/req for NV headers

2020-03-24 Thread Monk Liu
1) drop the headers from AI in mxgpu_nv.c, should refer to mxgpu_nv.h 2) the IDH_EVENT_MAX is not used and not aligned with host side so drop it 3) the IDH_TEXT_MESSAG was provided in host but not defined in guest Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h | 3

[PATCH 6/7] drm/amdgpu: adjust sequence of ip_discovery init and timeout_setting

2020-03-24 Thread Monk Liu
r the adev->virt.ops all settle done, and the perfect place is in amdgpu_discovery_reg_base_init() Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 16 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 10 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_

[PATCH 2/7] drm/amdgpu: introduce new idh_request/event enum

2020-03-24 Thread Monk Liu
new idh_request and ihd_event to prepare for the new handshake protocol implementation later Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h b/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h

[PATCH 5/7] drm/amdgpu: equip new req_init_data handshake

2020-03-24 Thread Monk Liu
by this new handshake host side can prepare vbios/ip-discovery and pf exchange data upon recieving this request without stopping world switch. this way the world switch is less impacted by VF's exclusive mode request Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 19

[PATCH 7/7] drm/amdgpu: postpone entering fullaccess mode

2020-03-24 Thread Monk Liu
if host support new handshake we only need to enter fullaccess_mode in ip_init() part, otherwise we need to do it before reading vbios (becuase host prepares vbios for VF only after received REQ_GPU_INIT event under legacy handshake) Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu

[PATCH 4/7] drm/amdgpu: use static mmio offset for NV mailbox

2020-03-24 Thread Monk Liu
isters. HW team confirm us all MAILBOX registers will be at the same offset for all ASICs, no IP discovery needed for those registers Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c | 52 +++ drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h | 18 ++-

[PATCH 3/7] drm/amdgpu: introduce new request and its function

2020-03-24 Thread Monk Liu
1) modify xgpu_nv_send_access_requests to support new idh request 2) introduce new function: req_gpu_init_data() which is used to notify host to prepare vbios/ip-discovery/pfvf exchange Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 13 + drivers/gpu/drm/amd

[PATCH 2/4] drm/amdgpu: purge ip_discovery headers

2020-03-24 Thread Monk Liu
those two headers are not needed for ip discovery Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c index 27d8ae1..37e1fcf

[PATCH 1/4] drm/amdgpu: don't try to reserve training bo for sriov

2020-03-24 Thread Monk Liu
1) SRIOV guest KMD doesn't care training buffer 2) if we resered training buffer that will overlap with IP discovery reservation because training buffer is at vram_size - 0x8000 and IP discovery is at ()vram_size - 0x1 => vram_size -1) Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amd

[PATCH 4/4] drm/amdgpu: cleanup all virtualization detection routine

2020-03-24 Thread Monk Liu
). Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.h | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 33 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 6 drivers/gpu/

[PATCH 3/4] drm/amdgpu: amends feature bits for MM bandwidth mgr

2020-03-24 Thread Monk Liu
Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h index f0128f7..0a95b13 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +++ b

[PATCH] drm/amdgpu: revise RLCG access path

2020-03-15 Thread Monk Liu
what changed: 1)provide new implementation interface for the rlcg access path 2)put SQ_CMD/SQ_IND_INDEX to GFX9 RLCG path to let debugfs's reg_op function can access reg that need RLCG path help now even debugfs's reg_op can used to dump wave. tested-by: Monk Liu tested-by: Zhou pengju Signed

[refactor RLCG wreg path 1/2] drm/amdgpu: refactor RLCG access path part 1

2020-03-10 Thread Monk Liu
we can let RLCG to serve the register access even through UMR (via debugfs interface) the current implementation cannot achieve that goal because it can only hardcode everywhere, but UMR only pass "offset" as varable to driver tested-by: Monk Liu tested-by: Zhou pengju Signed-off-by: Z

[refactor RLCG wreg path 2/2] drm/amdgpu: refactor RLCG access path part 2

2020-03-10 Thread Monk Liu
switch to new RLCG access path, and drop the legacy WREG32_RLC macros tested-by: Monk Liu tested-by: Zhou pengju Signed-off-by: Zhou pengju Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 30 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 5

[PATCH 1/2] drm/amdgpu: refactor RLCG access path part 1

2020-03-10 Thread Monk Liu
we can let RLCG to serve the register access even through UMR (via debugfs interface) the current implementation cannot achieve that goal because it can only hardcode everywhere, but UMR only pass "offset" as varable to driver tested-by: Monk Liu tested-by: Zhou pengju Signed-off-by: Z

[PATCH 2/2] drm/amdgpu: refactor RLCG access path part 2

2020-03-10 Thread Monk Liu
switch to new RLCG access path, and drop the legacy WREG32_RLC macros tested-by: Monk Liu tested-by: Zhou pengju Signed-off-by: Zhou pengju Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c | 30 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 5

[enable VCN2.0 for NV12 SRIOV 5/6] drm/amdgpu: disable clock/power gating for SRIOV

2020-03-05 Thread Monk Liu
and disable MC resum in VCN2.0 as well those are not concerned by VF driver Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c b/drivers/gpu/drm/amd/amdgpu

[enable VCN2.0 for NV12 SRIOV 3/6] drm/amdgpu: implement initialization part on VCN2.0 for SRIOV

2020-03-05 Thread Monk Liu
one dec ring and one enc ring Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 231 +- 1 file changed, 228 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c index c387c81

[PATCH] drm/amdgpu: enable vcn 2.0 for SRIOV on NV12

2020-03-05 Thread Monk Liu
this a patch that port from SRIOV project branch to fix those IB/RING test fail on VCN 2.0 rings Signed-off-by: Darlington Opara Signed-off-by: Jiange Zhao Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c

[PATCH 2/3] drm/amdgpu: don't use pipe1 of gfx10

2020-03-02 Thread Monk Liu
will not be able for GFX pipe 0. That’s why I skip setting of state for gfx pipe 1 as decided by all driver team fix: since CP team won't help us to debug any issues that related with gfx pipe1, so based on above reason, let's skip gfx ring 1 (pipe1) even for both bare-metal and SRIOV Signed-off-by: Monk

[PATCH 3/3] drm/amdgpu: stop using sratch_reg in IB test

2020-03-02 Thread Monk Liu
, GFX IB test is a runtime work, so it is forbidden to use scrach_reg0/1/2/3 during IB test period note: Although we can only have this change for SRIOV, but looks it doesn't worth the effort to differentiate bare-metal with SRIOV on the GFX ib test Signed-off-by: Monk Liu --- drivers/gpu/drm/amd

[PATCH 1/3] drm/amdgpu: fix IB test MCBP bug

2020-03-02 Thread Monk Liu
1)for gfx IB test we shouldn't insert DE meta data 2)we should make sure IB test finished before we send event 3 to hypervisor otherwise the IDLE from event 3 will preempt IB test, which is not designed as a compatible structure for MCBP Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdgpu: fix psp ucode not loaded in bare-metal

2020-02-20 Thread Monk Liu
for bare-metal we alawys need to load sys/sos/kdb Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 3494966..51839ab

[PATCH 3/3] drm/amdgpu: fix colliding of preemption

2020-02-17 Thread Monk Liu
switch bug. Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 3 ++- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 8 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c index

[PATCH 1/3] drm/amdgpu: cleanup some incorrect reg access for SRIOV

2020-02-17 Thread Monk Liu
ucode under SRIOV, otherwise PSP would report error Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu

[PATCH 2/3] drm/amdgpu: fix memory leak during TDR test

2020-02-17 Thread Monk Liu
fix system memory leak regression introduced by this previous change of 201331 - Single VF Mode Test Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b

[PATCH] avoid to use NULL pointer

2020-02-14 Thread Monk Liu
Signed-off-by: Monk Liu --- src/lib/umr_read_pm4_stream.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/umr_read_pm4_stream.c b/src/lib/umr_read_pm4_stream.c index 60bea49..317b638 100644 --- a/src/lib/umr_read_pm4_stream.c +++ b/src/lib/umr_read_pm4_stream.c @@ -325,6 +325,9

[PATCH] avoid to use NULL pointer

2020-02-14 Thread Monk Liu
Signed-off-by: Monk Liu --- src/lib/umr_read_pm4_stream.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/umr_read_pm4_stream.c b/src/lib/umr_read_pm4_stream.c index 60bea49..317b638 100644 --- a/src/lib/umr_read_pm4_stream.c +++ b/src/lib/umr_read_pm4_stream.c @@ -325,6 +325,9

[PATCH 1/2] drm/amdgpu: fix double gpu_recovery for NV of SRIOV

2019-12-17 Thread Monk Liu
interrupt. Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c index 0d8767e..1c3a7d4 100644 --- a/drivers/gpu/drm/amd/amdgpu

[PATCH 2/2] drm/amdgpu: fix KIQ ring test fail in TDR of SRIOV

2019-12-17 Thread Monk Liu
KIQ way to do register access and stuck there, because KIQ probably won't work by that time (e.g. you already made GFX hang) so the best way right now is to simply remove it. Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 -- 1 file changed, 2 deletions(-) diff --git

[PATCH] drm/amdgpu: fix KIQ ring test fail in TDR

2019-12-17 Thread Monk Liu
to block this sequence: if we do pre_reset() before VF FLR, it would go KIQ way to do register access and stuck there, because KIQ probably won't work by that time (e.g. you already made GFX hang) Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 -- drivers/gpu/drm/amd

[PATCH] drm/amdgpu: fix GFX10 missing CSIB set(v2)

2019-11-29 Thread Monk Liu
still need to init csb even for SRIOV v2: drop init_pg() for gfx10 at all since PG and GFX off feature will be fully controled by RLC and SMU fw for gfx10 Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 38 ++ 1 file changed, 11 insertions

[PATCH] drm/amdgpu: should stop GFX ring in hw_fini

2019-11-29 Thread Monk Liu
To align with the scheme from gfx9 disabling GFX ring after VM shutdown could avoid garbage data be fetched to GFX RB which may lead to unnecessary screw up on GFX Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu

[PATCH 1/2] drm/amdgpu: fix GFX10 missing CSIB set

2019-11-29 Thread Monk Liu
still need to init csb even for SRIOV Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index 74edfd9..230e8af 100644

[PATCH 2/2] drm/amdgpu: should stop GFX ring in hw_fini

2019-11-29 Thread Monk Liu
To align with the scheme from gfx9: without disabling gfx ring in hw_fini we would hit GFX hang if a guest VM is destroyed suddenly when running a game Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd

[PATCH] drm/amdgpu: fix calltrace during kmd unload(v2)

2019-11-27 Thread Monk Liu
of gfx7/8 as well v3: use bo_create_kernel instead of bo_create_reserved for CSB otherwise the bo_free_kernel() on CSB is not aligned and would led to its internal reserve pending there forever Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c | 10 +- drivers/gpu/drm/amd

[PATCH] drm/amdgpu: fix calltrace during kmd unload(v2)

2019-11-27 Thread Monk Liu
of gfx7/8 as well remove all those useless code for gfx9/10 Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c | 8 - drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 58 + drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 2 ++ drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdgpu: fix calltrace during kmd unload(v2)

2019-11-27 Thread Monk Liu
of gfx7/8 as well remove all those useless code for gfx9/10 Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c | 8 - drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 58 + drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 2 ++ drivers/gpu/drm/amd/amdgpu

[PATCH 2/5] drm/amdgpu: skip rlc ucode loading for SRIOV gfx10

2019-11-26 Thread Monk Liu
Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 80 +- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index 879c0a1..a56cba9 100644 --- a/drivers

[PATCH 5/5] drm/amdgpu: fix calltrace during kmd unload

2019-11-26 Thread Monk Liu
kernel would report a warning on double unpin on the csb BO because we unpin it during hw_fini but actually we don't need to pin/unpin it during hw_init/fini since it is created with kernel pinned remove all those useless code for gfx9/10 Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu

[PATCH 4/5] drm/amdgpu: use CPU to flush vmhub if sched stopped

2019-11-26 Thread Monk Liu
otherwse the flush_gpu_tlb will hang if we unload the KMD becuase the schedulers already stopped Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c b/drivers/gpu/drm/amd

[PATCH 1/5] drm/amdgpu: fix GFX10 missing CSIB set

2019-11-26 Thread Monk Liu
still need to init csb even for SRIOV Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index 4d6df35..879c0a1 100644

[PATCH 3/5] drm/amdgpu: do autoload right after MEC loaded for SRIOV VF

2019-11-26 Thread Monk Liu
since we don't have RLCG ucode loading and no SRlist as well Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 96a6b00

[PATCH] drm/amdgpu: fix an UMC hw arbitrator bug(v2)

2019-09-24 Thread Monk Liu
other client's access on the same page, thus the deadlock could be avoided Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/Makefile | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h | 1 + drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 7 +++ drivers/gpu/drm/amd/amdgpu/umc_v6_0.c | 37

[PATCH] drm/amdgpu: fix an UMC hw arbitrator bug

2019-09-23 Thread Monk Liu
other client's access on the same page, thus the deadlock could be avoided Signed-off-by: Monk Liu Change-Id: Iaf6eb2a20a4785ec8440e64d5e0cae67aa0603da --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH] drm/amdgpu: introduce vram lost for reset

2019-08-27 Thread Monk Liu
for SOC15/vega10 the BACO reset & mode1 would introduce vram lost in high end address range, current kmd's vram lost checking cannot catch it since it only check very ahead visible frame buffer Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu.h| 1 + drivers/gpu/drm

[PATCH] drm/amdgpu: introduce vram lost paramter for reset function

2019-08-22 Thread Monk Liu
for SOC15/vega10 the BACO reset would introduce vram lost in the high end address range and current kmd's vram lost checking cannot catch it since it only check visible frame buffer TODO: to confirm if mode1/2 reset would introduce vram lost Signed-off-by: Monk Liu --- drivers/gpu/drm/amd

[PATCH] drm/amdgpu: fix double ucode load by PSP(v3)

2019-07-31 Thread Monk Liu
since it is needed by bare-metal v3: drop the change in reinit_early_sriov, just clear all block's status.hw in the head place and set the status.hw after hw_init done is enough Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 59 +++--- 1 file

[PATCH] drm/amdgpu: fix double ucode load by PSP(v2)

2019-07-31 Thread Monk Liu
since it is needed by bare-metal Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 77 +++--- 1 file changed, 48 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

[PATCH 3/3] drm/amdgpu: fix double ucode load by PSP

2019-07-30 Thread Monk Liu
previously the ucode loading of PSP was repreated, one executed in phase_1 init/re-init/resume and the other in fw_loading routine Avoid this double loading by clearing ip_blocks.status.hw in suspend or reset prior to the FW loading and any block's hw_init/resume Signed-off-by: Monk Liu

[PATCH 1/3] drm/amdgpu: cleanup vega10 SRIOV code path

2019-07-30 Thread Monk Liu
registers should also be skipped for VEGA10 SRIOV. Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 -- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 45 -- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 13 - drivers/gpu/drm/amd/amdgpu

[PATCH 2/3] drm/amdgpu: fix incorrect judge on sos fw version

2019-07-30 Thread Monk Liu
for SRIOV the SOS fw of PSP is loaded in hypervisor thus guest won't tell the version of it, and judging feature by reading the sos fw version in guest side is completely wrong Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/psp_v3_1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] SWDEV-196010 Calltrace caught in amdgpu_vm_sdma.c file

2019-07-15 Thread Monk Liu
don't commit sdma vm job if no updates needed and free the ib Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

[PATCH] drm/amdgpu: drop the incorrect soft_reset for SRIOV

2019-06-10 Thread Monk Liu
It's incorrect to do soft reset for SRIOV, when GFX hang the WREG would stuck there becuase it goes KIQ way. the GPU reset counter is incorrect: always increase twice for each timedout Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 2 +- 1 file changed, 1 insertion

[PATCH] drm/ttm: fix ttm client driver (e.g. amdgpu) reload issue

2019-06-05 Thread Monk Liu
uot; would hit out of bound array accessing bug Signed-off-by: Monk Liu --- drivers/gpu/drm/ttm/ttm_bo.c | 2 ++ drivers/gpu/drm/ttm/ttm_memory.c | 8 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index c7de667..6434

[PATCH] drm/amdgpu: suppress repeating tmo report

2019-05-13 Thread Monk Liu
only report once per TMO job and the timer would be restarted upon the job finished if it's just slow. Suggested-by: Christian König Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c

[PATCH] drm/amdgpu: avoid duplicated tmo report on same job

2019-05-10 Thread Monk Liu
Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c| 12 +++- include/drm/gpu_scheduler.h| 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH] drm/sched: fix the duplicated TMO message for one IB

2019-05-08 Thread Monk Liu
we don't need duplicated IB's timeout error message reported endlessly, just one report per timedout IB is enough Signed-off-by: Monk Liu --- drivers/gpu/drm/scheduler/sched_main.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm

[PATCH] drm/amdgpu: fix vm_cpu_update hit NULL pointer

2019-03-21 Thread Monk Liu
should use amdgpu_bo_map, otherwise you'll hit NULL pointer bug if with amdgpu_bo_kptr Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c b/drivers/gpu/drm/amd

[PATCH] drm: should break if already get the best size

2018-11-22 Thread Monk Liu
Signed-off-by: Monk Liu --- drivers/gpu/drm/drm_mm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index 3cc5fbd..369fd9b 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c @@ -318,6 +318,8 @@ static struct drm_mm_node

[PATCH 2/3] drm/amdgpu: drop the sched_sync

2018-11-02 Thread Monk Liu
r come back, with this patch this issue could be avoided. Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 16 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 14 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_job.h | 3 +-- 3 files changed, 10 insertions(+),

[PATCH 3/3] drm/amdgpu: drop need_vm_flush/need_pipe_sync

2018-11-02 Thread Monk Liu
use a flag to hold need_flush and need_pipe_sync Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c| 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 14 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.h | 6

[PATCH 1/3] drm/amdgpu: rename explicit to need_pipe_sync for better understanding

2018-11-02 Thread Monk Liu
and differentiate it with explicit_bo flag Signed-off-by: Monk Liu --- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 7 +-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu

[PATCH] drm/amdgpu: refactoring mailbox to fix TDR handshake bugs(v2)

2018-03-07 Thread Monk Liu
register don't test if NOTIFY_CMPL event in rcv_msg since it won't recieve that message anymore Change-Id: I17df8b4490a5b53a1cc2bd6c8f9bc3ee14c23f1a Signed-off-by: Monk Liu <monk@amd.com> --- drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 196 ++ drivers/gpu/drm/amd/amd

[PATCH 2/2] drm/amdgpu: refactoring mailbox to fix TDR handshake bugs

2018-03-06 Thread Monk Liu
de after we received FLR_NOTIFY from host side, this can prevent innocent app wrongly succesed to open amdgpu dri device. FLR_NOFITY is received due to an IDLE hang detected from hypervisor side which indicating GPU is already die in this VF. Change-Id: I17df8b4490a5b53a1cc2bd6c8f9bc3ee14c23f1a Sig

[PATCH 1/2] drm/amdgpu: imlement mmio byte access helpers

2018-03-06 Thread Monk Liu
mailbox register can be accessed with a byte boundry according to BIF team, so this patch prepares register byte access and will be used by following patches Change-Id: I1e84f1c6e8e75dc42eb5be09c492fa5e7eb7502a Signed-off-by: Monk Liu <monk@amd.com> --- drivers/gpu/drm/amd/amdgpu/am

[PATCH 2/4] drm/amdgpu: refactoring mailbox to fix TDR handshake bugs

2018-03-05 Thread Monk Liu
de after we received FLR_NOTIFY from host side, this can prevent innocent app wrongly succesed to open amdgpu dri device. FLR_NOFITY is received due to an IDLE hang detected from hypervisor side which indicating GPU is already die in this VF. Change-Id: I17df8b4490a5b53a1cc2bd6c8f9bc3ee14c23f1a Sig

[PATCH 4/4] dma-buf/reservation: should keep the new fence in add_shared_inplace

2018-03-05 Thread Monk Liu
Change-Id: If6a979ba9fd6c923b82212f35f07a9ff31c86767 Signed-off-by: Monk Liu <monk@amd.com> --- drivers/dma-buf/reservation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c index 314eb10..29b7e45

[PATCH 3/4] drm/amdgpu: give warning before sleep in kiq_r/wreg

2018-03-05 Thread Monk Liu
to catch error that may schedule in atomic context early on Change-Id: I49dec7c55470011729b7fa7d3e1ecfe1f38ed89f Signed-off-by: Monk Liu <monk@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/amd/

[PATCH 1/4] drm/amdgpu: imlement mmio byte access helpers

2018-03-05 Thread Monk Liu
mailbox register can be accessed with a byte boundry according to BIF team, so this patch prepares register byte access and will be used by following patches Change-Id: I1e84f1c6e8e75dc42eb5be09c492fa5e7eb7502a Signed-off-by: Monk Liu <monk@amd.com> --- drivers/gpu/drm/amd/amdgpu/am

[PATCH] dma-buf/reservation: should keep the new fence in add_shared_inplace

2018-03-05 Thread Monk Liu
Change-Id: If6a979ba9fd6c923b82212f35f07a9ff31c86767 Signed-off-by: Monk Liu <monk@amd.com> --- drivers/dma-buf/reservation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c index 375de41..9b875267

[PATCH 1/4] drm/amdgpu: fix object unreserved issue

2018-03-04 Thread Monk Liu
bo_do_create will unreserve in in the end if @resv is NULL, which cause the following bo_create_shadow run without lock held on @resv Change-Id: Iaad24b8aea60522f25188874ab9d5c5f13f1a941 Signed-off-by: Monk Liu <monk@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 9 ++

  1   2   3   4   5   >