linux/drivers/gpu/drm/amd/amdgpu
Huang Rui f77c9aff85 drm/amdgpu: Fix per-IB secure flag GFX hang
Since commit "Move to a per-IB secure flag (TMZ)",
we've been seeing hangs in GFX. We need to send
FRAME CONTROL stop/start back-to-back, every time
we flip the TMZ flag. That is, when we transition
from TMZ to non-TMZ we have to send a stop with
TMZ followed by a start with non-TMZ, and
similarly for transitioning from non-TMZ into TMZ.

This patch implements this, thus fixing the GFX
hang.

v1 -> v2:
As suggested by Luben, and accept part of implemetation from this patch:
- Put "secure" closed to the loop and use optimization
- Change "secure" to bool again, and move "secure == -1" out of loop.
v3: Small fixes/optimizations.

Reported-and-Tested-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2020-04-28 16:20:30 -04:00
..
amdgpu.h drm/amdgpu: implement TMZ accessor (v3) 2020-04-28 16:20:29 -04:00
amdgpu_acp.c
amdgpu_acp.h
amdgpu_acpi.c
amdgpu_afmt.c
amdgpu_amdkfd.c drm/amdkfd: Put ASIC revision into HSA capability 2020-04-28 11:04:56 -04:00
amdgpu_amdkfd.h drm/amdkfd: Put ASIC revision into HSA capability 2020-04-28 11:04:56 -04:00
amdgpu_amdkfd_arcturus.c
amdgpu_amdkfd_fence.c
amdgpu_amdkfd_gfx_v7.c
amdgpu_amdkfd_gfx_v8.c
amdgpu_amdkfd_gfx_v9.c drm/amdkfd Avoid destroy hqd when GPU is on reset 2020-04-09 10:43:15 -04:00
amdgpu_amdkfd_gfx_v9.h
amdgpu_amdkfd_gfx_v10.c drm/amdkfd Avoid destroy hqd when GPU is on reset 2020-04-09 10:43:15 -04:00
amdgpu_amdkfd_gpuvm.c drm/amdgpu: shrink critical section in amdgpu_amdkfd_gpuvm_free_memory_of_gpu 2020-04-23 15:39:53 -04:00
amdgpu_atombios.c
amdgpu_atombios.h
amdgpu_atomfirmware.c
amdgpu_atomfirmware.h
amdgpu_atpx_handler.c
amdgpu_benchmark.c drm/amdgpu: expand amdgpu_copy_buffer interface with tmz parameter 2020-04-28 16:20:29 -04:00
amdgpu_bios.c
amdgpu_bo_list.c
amdgpu_bo_list.h
amdgpu_cgs.c drm/amdgpu: retire indirect mmio reg support from cgs 2020-04-09 10:43:18 -04:00
amdgpu_connectors.c
amdgpu_connectors.h
amdgpu_cs.c drm/amdgpu: Move to a per-IB secure flag (TMZ) 2020-04-28 16:20:29 -04:00
amdgpu_csa.c
amdgpu_csa.h
amdgpu_ctx.c drm/amdgpu: rework sched_list generation 2020-04-09 10:43:14 -04:00
amdgpu_ctx.h drm/amdgpu: rework sched_list generation 2020-04-09 10:43:14 -04:00
amdgpu_debugfs.c drm/amdgpu: restrict debugfs register access under SR-IOV 2020-04-13 12:01:04 -04:00
amdgpu_debugfs.h
amdgpu_device.c drm/amdgpu: implement TMZ accessor (v3) 2020-04-28 16:20:29 -04:00
amdgpu_df.h
amdgpu_discovery.c drm/amdgpu: adjust sequence of ip_discovery init and timeout_setting 2020-04-01 14:44:43 -04:00
amdgpu_discovery.h drm/amdgpu: adjust sequence of ip_discovery init and timeout_setting 2020-04-01 14:44:43 -04:00
amdgpu_display.c
amdgpu_display.h
amdgpu_dma_buf.c
amdgpu_dma_buf.h
amdgpu_doorbell.h
amdgpu_dpm.c
amdgpu_dpm.h
amdgpu_drv.c drm/amdgpu: add tmz feature parameter (v2) 2020-04-28 16:20:28 -04:00
amdgpu_drv.h
amdgpu_encoders.c
amdgpu_fb.c
amdgpu_fence.c drm/amdgpu: protect ring overrun 2020-04-24 11:42:11 -04:00
amdgpu_fru_eeprom.c drm/amdgpu: Disable FRU read on Arcturus 2020-04-22 18:11:46 -04:00
amdgpu_fru_eeprom.h drm/amdgpu: Enable reading FRU chip via I2C v3 2020-04-01 14:44:41 -04:00
amdgpu_gart.c
amdgpu_gart.h
amdgpu_gds.h
amdgpu_gem.c drm/amdgpu: fix the wrong logic checking when secure buffer is created (v3) 2020-04-28 16:20:29 -04:00
amdgpu_gem.h
amdgpu_gfx.c drm/amdgpu: protect ring overrun 2020-04-24 11:42:11 -04:00
amdgpu_gfx.h drm/amdgpu: request reg_val_offs each kiq read reg 2020-04-23 15:06:41 -04:00
amdgpu_gmc.c drm/amdgpu: Fine-grained TMZ support 2020-04-28 16:20:30 -04:00
amdgpu_gmc.h drm/amdgpu: implement TMZ accessor (v3) 2020-04-28 16:20:29 -04:00
amdgpu_gtt_mgr.c
amdgpu_i2c.c
amdgpu_i2c.h
amdgpu_ib.c drm/amdgpu: Fix per-IB secure flag GFX hang 2020-04-28 16:20:30 -04:00
amdgpu_ids.c
amdgpu_ids.h
amdgpu_ih.c
amdgpu_ih.h
amdgpu_ioc32.c
amdgpu_irq.c drm/amd/amdgpu: remove hardcoded module name in prints 2020-04-13 12:02:40 -04:00
amdgpu_irq.h
amdgpu_job.c drm/amdgpu: remove set but not used variable 'priority' 2020-04-23 15:06:41 -04:00
amdgpu_job.h drm/amdgpu: Move to a per-IB secure flag (TMZ) 2020-04-28 16:20:29 -04:00
amdgpu_jpeg.c drm/amdgpu: implement more ib pools (v2) 2020-04-01 14:44:44 -04:00
amdgpu_jpeg.h drm/amdgpu: rework sched_list generation 2020-04-09 10:43:14 -04:00
amdgpu_kms.c amdgpu_kms: Remove unnecessary condition check 2020-04-09 10:43:18 -04:00
amdgpu_mes.h
amdgpu_mmhub.c
amdgpu_mmhub.h
amdgpu_mn.c
amdgpu_mn.h
amdgpu_mode.h
amdgpu_nbio.c
amdgpu_nbio.h drm/amdgpu: cleanup all virtualization detection routine 2020-04-01 14:44:42 -04:00
amdgpu_object.c drm/amdgpu: expand amdgpu_copy_buffer interface with tmz parameter 2020-04-28 16:20:29 -04:00
amdgpu_object.h drm/amdgpu: set TMZ bits in PTEs for secure BO (v4) 2020-04-28 16:20:29 -04:00
amdgpu_pll.c
amdgpu_pll.h
amdgpu_pm.c drm/amdgpu: skip sysfs node not belong to one vf mode 2020-04-24 11:42:11 -04:00
amdgpu_pm.h
amdgpu_pmu.c
amdgpu_pmu.h
amdgpu_psp.c drm/amdgpu: add helper function to init sos ucode 2020-04-23 15:40:53 -04:00
amdgpu_psp.h drm/amdgpu: add helper function to init sos ucode 2020-04-23 15:40:53 -04:00
amdgpu_ras.c drm/amdgpu: set error query ready after all IPs late init 2020-04-22 18:11:49 -04:00
amdgpu_ras.h drm/amdgpu: disable ras query and iject during gpu reset 2020-04-01 14:44:42 -04:00
amdgpu_ras_eeprom.c
amdgpu_ras_eeprom.h
amdgpu_ring.c drm/amdgpu/ring: simplify scheduler setup logic 2020-04-13 12:02:26 -04:00
amdgpu_ring.h drm/amdgpu: Fix per-IB secure flag GFX hang 2020-04-28 16:20:30 -04:00
amdgpu_rlc.c
amdgpu_rlc.h
amdgpu_sa.c
amdgpu_sched.c
amdgpu_sched.h
amdgpu_sdma.c
amdgpu_sdma.h drm/amdgpu: expand sdma copy_buffer interface with tmz parameter 2020-04-28 16:20:29 -04:00
amdgpu_socbb.h
amdgpu_sync.c
amdgpu_sync.h
amdgpu_test.c drm/amdgpu: expand amdgpu_copy_buffer interface with tmz parameter 2020-04-28 16:20:29 -04:00
amdgpu_trace.h drm/amdgpu: support access regs outside of mmio bar 2020-04-09 10:43:18 -04:00
amdgpu_trace_points.c
amdgpu_ttm.c drm/amdgpu: stop evicting encrypted BOs to swap 2020-04-28 16:20:29 -04:00
amdgpu_ttm.h drm/amdgpu: add TMZ handling to amdgpu_move_blit 2020-04-28 16:20:29 -04:00
amdgpu_ucode.c drm/amdgpu: Expose TA FW version in fw_version file 2020-04-01 14:44:42 -04:00
amdgpu_ucode.h
amdgpu_umc.c drm/amdgpu: refine ras related message print 2020-04-13 12:01:50 -04:00
amdgpu_umc.h
amdgpu_uvd.c drm/amdgpu: implement more ib pools (v2) 2020-04-01 14:44:44 -04:00
amdgpu_uvd.h
amdgpu_vce.c drm/amdgpu: implement more ib pools (v2) 2020-04-01 14:44:44 -04:00
amdgpu_vce.h
amdgpu_vcn.c Revert "drm/amdgpu: Disable gfx off if VCN is busy" 2020-04-22 18:11:46 -04:00
amdgpu_vcn.h drm/amdgpu/vcn: add shared memory restore after wake up from sleep. 2020-04-09 10:43:15 -04:00
amdgpu_vf_error.c
amdgpu_vf_error.h
amdgpu_virt.c drm/amdgpu: protect ring overrun 2020-04-24 11:42:11 -04:00
amdgpu_virt.h drm/amdgpu: resume kiq access debugfs 2020-04-13 12:01:56 -04:00
amdgpu_vm.c drm/amdgpu: set TMZ bits in PTEs for secure BO (v4) 2020-04-28 16:20:29 -04:00
amdgpu_vm.h drm/amdgpu: define the TMZ bit for the PTE 2020-04-28 16:20:28 -04:00
amdgpu_vm_cpu.c
amdgpu_vm_sdma.c drm/amdgpu: implement more ib pools (v2) 2020-04-01 14:44:44 -04:00
amdgpu_vram_mgr.c
amdgpu_xgmi.c drm/amdgpu: sw pstate switch should only be for vega20 2020-04-27 15:51:42 -04:00
amdgpu_xgmi.h drm/amdgpu: fix race between pstate and remote buffer map 2020-04-22 18:11:46 -04:00
arct_reg_init.c
athub_v1_0.c
athub_v1_0.h
athub_v2_0.c
athub_v2_0.h
atom.c drm/amdgpu: increased atom cmd timeout 2020-04-09 10:43:33 -04:00
atom.h
atombios_crtc.c
atombios_crtc.h
atombios_dp.c
atombios_dp.h
atombios_encoders.c
atombios_encoders.h
atombios_i2c.c
atombios_i2c.h
cik.c drm/amdgpu: fix wrong vram lost counter increment V2 2020-04-13 12:02:08 -04:00
cik.h
cik_dpm.h
cik_ih.c
cik_ih.h
cik_sdma.c drm/amdgpu: expand sdma copy_buffer interface with tmz parameter 2020-04-28 16:20:29 -04:00
cik_sdma.h
cikd.h
clearstate_ci.h
clearstate_defs.h
clearstate_gfx9.h
clearstate_gfx10.h
clearstate_si.h
clearstate_vi.h
cz_ih.c
cz_ih.h
dce_v6_0.c drm/amdgpu: replace indirect mmio access in non-dc code path 2020-04-09 10:43:18 -04:00
dce_v6_0.h
dce_v8_0.c drm/amdgpu: replace indirect mmio access in non-dc code path 2020-04-09 10:43:18 -04:00
dce_v8_0.h
dce_v10_0.c drm/amdgpu: replace indirect mmio access in non-dc code path 2020-04-09 10:43:18 -04:00
dce_v10_0.h
dce_v11_0.c drm/amdgpu: replace indirect mmio access in non-dc code path 2020-04-09 10:43:18 -04:00
dce_v11_0.h
dce_virtual.c drm/amdgpu: disble vblank when unloading sriov driver 2020-04-22 18:11:49 -04:00
dce_virtual.h
df_v1_7.c
df_v1_7.h
df_v3_6.c
df_v3_6.h
emu_soc.c
gfx_v6_0.c drm/amdgpu: Move to a per-IB secure flag (TMZ) 2020-04-28 16:20:29 -04:00
gfx_v6_0.h
gfx_v7_0.c drm/amdgpu: Move to a per-IB secure flag (TMZ) 2020-04-28 16:20:29 -04:00
gfx_v7_0.h
gfx_v8_0.c drm/amdgpu: Move to a per-IB secure flag (TMZ) 2020-04-28 16:20:29 -04:00
gfx_v8_0.h
gfx_v9_0.c drm/amdgpu: Fix per-IB secure flag GFX hang 2020-04-28 16:20:30 -04:00
gfx_v9_0.h
gfx_v9_4.c drm/amdgpu: replace DRM prefix with PCI device info for gfx/mmhub 2020-04-22 18:11:49 -04:00
gfx_v9_4.h
gfx_v10_0.c drm/amdgpu: Fix per-IB secure flag GFX hang 2020-04-28 16:20:30 -04:00
gfx_v10_0.h
gfxhub_v1_0.c
gfxhub_v1_0.h
gfxhub_v1_1.c
gfxhub_v1_1.h
gfxhub_v2_0.c
gfxhub_v2_0.h
gmc_v6_0.c drm/amd/amdgpu: remove hardcoded module name in prints 2020-04-13 12:02:40 -04:00
gmc_v6_0.h
gmc_v7_0.c drm/amd/amdgpu: remove hardcoded module name in prints 2020-04-13 12:02:40 -04:00
gmc_v7_0.h
gmc_v8_0.c drm/amd/amdgpu: remove hardcoded module name in prints 2020-04-13 12:02:40 -04:00
gmc_v8_0.h
gmc_v9_0.c drm/amdgpu/gmc: Use consistent variable on unlocks 2020-04-24 11:42:11 -04:00
gmc_v9_0.h
gmc_v10_0.c drm/amdgpu/gmc: Use consistent variable on unlocks 2020-04-24 11:42:11 -04:00
gmc_v10_0.h
iceland_ih.c
iceland_ih.h
iceland_sdma_pkt_open.h
jpeg_v1_0.c drm/amdgpu: rework sched_list generation 2020-04-09 10:43:14 -04:00
jpeg_v1_0.h
jpeg_v2_0.c drm/amdgpu: rework sched_list generation 2020-04-09 10:43:14 -04:00
jpeg_v2_0.h
jpeg_v2_5.c drm/amdgpu: rework sched_list generation 2020-04-09 10:43:14 -04:00
jpeg_v2_5.h
Kconfig
kv_dpm.c
kv_dpm.h
kv_smc.c
Makefile drm/amdgpu: implement TMZ accessor (v3) 2020-04-28 16:20:29 -04:00
mes_v10_1.c
mes_v10_1.h
mmhub_v1_0.c drm/amdgpu: replace DRM prefix with PCI device info for gfx/mmhub 2020-04-22 18:11:49 -04:00
mmhub_v1_0.h
mmhub_v2_0.c
mmhub_v2_0.h
mmhub_v9_4.c drm/amdgpu: update RAS related dmesg print 2020-04-09 10:43:15 -04:00
mmhub_v9_4.h
mmsch_v1_0.h
mmsch_v2_0.h
mxgpu_ai.c
mxgpu_ai.h drm/amdgpu: extent threshold of waiting FLR_COMPLETE 2020-04-24 11:42:11 -04:00
mxgpu_nv.c drm/amdgpu: use static mmio offset for NV mailbox 2020-04-01 14:44:43 -04:00
mxgpu_nv.h drm/amdgpu: extent threshold of waiting FLR_COMPLETE 2020-04-24 11:42:11 -04:00
mxgpu_vi.c
mxgpu_vi.h drm/amdgpu: cleanup idh event/req for NV headers 2020-04-01 14:44:43 -04:00
navi10_ih.c amdgpu/drm: remove psp access on navi10 for sriov 2020-04-03 17:01:25 -04:00
navi10_ih.h
navi10_reg_init.c
navi10_sdma_pkt_open.h drm/amdgpu: invalidate L2 before SDMA IBs (v2) 2020-04-28 11:50:46 -04:00
navi12_reg_init.c
navi14_reg_init.c
nbio_v2_3.c drm/amdgpu: cleanup all virtualization detection routine 2020-04-01 14:44:42 -04:00
nbio_v2_3.h
nbio_v6_1.c drm/amdgpu: cleanup all virtualization detection routine 2020-04-01 14:44:42 -04:00
nbio_v6_1.h
nbio_v7_0.c drm/amdgpu: cleanup all virtualization detection routine 2020-04-01 14:44:42 -04:00
nbio_v7_0.h
nbio_v7_4.c drm/amdgpu: refine ras related message print 2020-04-13 12:01:50 -04:00
nbio_v7_4.h
nv.c drm/amdgpu: for nv12 always need smu ip 2020-04-24 11:42:11 -04:00
nv.h
nvd.h drm/amdgpu: add tmz bit in frame control packet 2020-04-28 16:20:28 -04:00
ObjectID.h
ppsmc.h
psp_gfx_if.h
psp_v3_1.c drm/amdgpu: retire legacy vega10 sos version check 2020-04-23 15:41:06 -04:00
psp_v3_1.h
psp_v10_0.c drm/amdgpu: switch to helper function to init asd ucode 2020-04-23 15:40:46 -04:00
psp_v10_0.h
psp_v11_0.c drm/amdgpu: ignore TA ucode for SRIOV 2020-04-24 11:42:11 -04:00
psp_v11_0.h
psp_v12_0.c drm/amdgpu: switch to helper function to init asd ucode 2020-04-23 15:40:46 -04:00
psp_v12_0.h
r600_dpm.h
sdma_v2_4.c drm/amdgpu: expand sdma copy_buffer interface with tmz parameter 2020-04-28 16:20:29 -04:00
sdma_v2_4.h
sdma_v3_0.c drm/amdgpu: expand sdma copy_buffer interface with tmz parameter 2020-04-28 16:20:29 -04:00
sdma_v3_0.h
sdma_v4_0.c drm/amdgpu: enable TMZ bit in sdma copy pkt for sdma v4 2020-04-28 16:20:29 -04:00
sdma_v4_0.h
sdma_v5_0.c drm/amdgpu: enable TMZ bit in sdma copy pkt for sdma v5 2020-04-28 16:20:29 -04:00
sdma_v5_0.h
si.c drm/amdgpu: cleanup all virtualization detection routine 2020-04-01 14:44:42 -04:00
si.h
si_dma.c drm/amdgpu: expand sdma copy_buffer interface with tmz parameter 2020-04-28 16:20:29 -04:00
si_dma.h
si_dpm.c drm/amdgpu: remove dead code in si_dpm.c 2020-04-13 12:02:42 -04:00
si_dpm.h
si_enums.h
si_ih.c
si_ih.h
si_smc.c
sid.h
sislands_smc.h
smu_v11_0_i2c.c
smu_v11_0_i2c.h
soc15.c drm/amdgpu: fix wrong vram lost counter increment V2 2020-04-13 12:02:08 -04:00
soc15.h
soc15_common.h drm/amdgpu: provide RREG32_SOC15_NO_KIQ, will be used later 2020-04-24 11:42:11 -04:00
soc15d.h drm/amdgpu: add tmz bit in frame control packet 2020-04-28 16:20:28 -04:00
ta_ras_if.h
ta_xgmi_if.h
tonga_ih.c
tonga_ih.h
tonga_sdma_pkt_open.h
umc_v6_0.c
umc_v6_0.h
umc_v6_1.c drm/amdgpu: decouple EccErrCnt query and clear operation 2020-04-27 15:52:10 -04:00
umc_v6_1.h
uvd_v4_2.c drm/amdgpu: rework sched_list generation 2020-04-09 10:43:14 -04:00
uvd_v4_2.h
uvd_v5_0.c drm/amdgpu: rework sched_list generation 2020-04-09 10:43:14 -04:00
uvd_v5_0.h
uvd_v6_0.c drm/amdgpu: rework sched_list generation 2020-04-09 10:43:14 -04:00
uvd_v6_0.h
uvd_v7_0.c drm/amdgpu: rework sched_list generation 2020-04-09 10:43:14 -04:00
uvd_v7_0.h
vce_v2_0.c drm/amdgpu: rework sched_list generation 2020-04-09 10:43:14 -04:00
vce_v2_0.h
vce_v3_0.c drm/amdgpu: rework sched_list generation 2020-04-09 10:43:14 -04:00
vce_v3_0.h
vce_v4_0.c drm/amdgpu: rework sched_list generation 2020-04-09 10:43:14 -04:00
vce_v4_0.h
vcn_v1_0.c drm/amdgpu: rework sched_list generation 2020-04-09 10:43:14 -04:00
vcn_v1_0.h
vcn_v2_0.c drm/amdgpu: rework sched_list generation 2020-04-09 10:43:14 -04:00
vcn_v2_0.h
vcn_v2_5.c drm/amdgpu/vcn2.5: wait for tiles off after unpause 2020-04-28 11:44:30 -04:00
vcn_v2_5.h
vega10_ih.c
vega10_ih.h
vega10_reg_init.c
vega10_sdma_pkt_open.h
vega20_reg_init.c
vi.c drm/amdgpu: fix wrong vram lost counter increment V2 2020-04-13 12:02:08 -04:00
vi.h
vid.h