linux_dsm_epyc7002/drivers/gpu/drm/amd/amdgpu
Andrey Grodzovsky a3d9103ebf drm/amdgpu: Fix page fault and kasan warning on pci device remove.
Problem:
When executing echo 1 > /sys/class/drm/card0/device/remove kasan warning
as bellow and page fault happen because adev->gart.pages already freed by the
time amdgpu_gart_unbind is called.

BUG: KASAN: user-memory-access in amdgpu_gart_unbind+0x98/0x180 [amdgpu]
Write of size 8 at addr 0000000000003648 by task bash/1828
CPU: 2 PID: 1828 Comm: bash Tainted: G        W  O      4.18.0-rc1-dev+ #29
Hardware name: Gigabyte Technology Co., Ltd. AX370-Gaming/AX370-Gaming-CF, BIOS F3 06/19/2017
Call Trace:
dump_stack+0x71/0xab
kasan_report+0x109/0x390
amdgpu_gart_unbind+0x98/0x180 [amdgpu]
ttm_tt_unbind+0x43/0x60 [ttm]
ttm_bo_move_ttm+0x83/0x1c0 [ttm]
ttm_bo_handle_move_mem+0xb97/0xd00 [ttm]
ttm_bo_evict+0x273/0x530 [ttm]
ttm_mem_evict_first+0x29c/0x360 [ttm]
ttm_bo_force_list_clean+0xfc/0x210 [ttm]
ttm_bo_clean_mm+0xe7/0x160 [ttm]
amdgpu_ttm_fini+0xda/0x1d0 [amdgpu]
amdgpu_bo_fini+0xf/0x60 [amdgpu]
gmc_v8_0_sw_fini+0x36/0x70 [amdgpu]
amdgpu_device_fini+0x2d0/0x7d0 [amdgpu]
amdgpu_driver_unload_kms+0x6a/0xd0 [amdgpu]
drm_dev_unregister+0x79/0x180 [drm]
amdgpu_pci_remove+0x2a/0x60 [amdgpu]
pci_device_remove+0x5b/0x100
device_release_driver_internal+0x236/0x360
pci_stop_bus_device+0xbf/0xf0
pci_stop_and_remove_bus_device_locked+0x16/0x30
remove_store+0xda/0xf0
kernfs_fop_write+0x186/0x220
__vfs_write+0xcc/0x330
vfs_write+0xe6/0x250
ksys_write+0xb1/0x140
do_syscall_64+0x77/0x1e0
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f66ebbb32c0

Fix:
Split gmc_v{6,7,8,9}_0_gart_fini to postpone amdgpu_gart_fini to after
memory managers are shut down since gart unbind happens
as part of this procedure

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-08-27 11:09:40 -05:00
..
amdgpu_acp.c drm/amd/amdgpu: creating two I2S instances for stoney/cz (v2) 2018-07-18 09:03:07 -05:00
amdgpu_acp.h
amdgpu_acpi.c drm/amdgpu/acpi: skip backlight events for DC 2018-07-20 14:24:41 -05:00
amdgpu_afmt.c
amdgpu_amdkfd_fence.c drm/amdgpu: Remove unecessary dma_fence_ops 2018-07-03 13:13:08 +02:00
amdgpu_amdkfd_gfx_v7.c drm/amdgpu: Add kfd2kgd.set_compute_idle interface 2018-07-16 19:10:36 -04:00
amdgpu_amdkfd_gfx_v8.c drm/amdgpu: Add kfd2kgd.set_compute_idle interface 2018-07-16 19:10:36 -04:00
amdgpu_amdkfd_gfx_v9.c drm/amdgpu: Add kfd2kgd.set_compute_idle interface 2018-07-16 19:10:36 -04:00
amdgpu_amdkfd_gpuvm.c drm/amdgpu: fix amdgpu_amdkfd_remove_eviction_fence v3 2018-08-21 14:19:26 -05:00
amdgpu_amdkfd.c drm/amdgpu: Add kfd2kgd.set_compute_idle interface 2018-07-16 19:10:36 -04:00
amdgpu_amdkfd.h drm/amdgpu: Add kfd2kgd.set_compute_idle interface 2018-07-16 19:10:36 -04:00
amdgpu_atombios.c
amdgpu_atombios.h
amdgpu_atomfirmware.c drm/amdgpu: Update GFX info structure to match what vega20 used 2018-05-24 10:07:55 -05:00
amdgpu_atomfirmware.h drm/amdgpu/atomfirmware: add parser for gfx_info table 2018-05-17 10:13:22 -05:00
amdgpu_atpx_handler.c BackMerge v4.18-rc7 into drm-next 2018-07-30 10:39:22 +10:00
amdgpu_benchmark.c drm/amdgpu: allocate gart memory when it's required (v3) 2018-07-10 14:15:58 -05:00
amdgpu_bios.c
amdgpu_bo_list.c drm/amdgpu: allocate the bo_list array after the list 2018-07-31 16:58:19 -05:00
amdgpu_bo_list.h drm/amdgpu: allocate the bo_list array after the list 2018-07-31 16:58:19 -05:00
amdgpu_cgs.c drm/amdgpu: switch firmware path for CIK parts (v2) 2018-07-05 16:39:58 -05:00
amdgpu_connectors.c drm: drop _mode_ from update_edit_property() 2018-07-13 18:40:27 +02:00
amdgpu_connectors.h
amdgpu_cs.c drm/amdgpu: fix preamble handling 2018-08-27 11:09:39 -05:00
amdgpu_ctx.c drm/scheduler: modify API to avoid redundancy 2018-07-25 15:06:19 -05:00
amdgpu_debugfs.c drm/amd/amdgpu: Add some documentation to the debugfs entries 2018-05-15 13:44:19 -05:00
amdgpu_debugfs.h
amdgpu_device.c Revert "drm/amdgpu/display: Replace CONFIG_DRM_AMD_DC_DCN1_0 with CONFIG_X86" 2018-08-21 14:32:28 -05:00
amdgpu_display.c drm/amdgpu: allocate gart memory when it's required (v3) 2018-07-10 14:15:58 -05:00
amdgpu_display.h drm/amdgpu: Rename amdgpu_display_framebuffer_domains() 2018-05-15 13:43:43 -05:00
amdgpu_dpm.c drm/amdgpu: use pcie functions for link width and speed 2018-07-05 16:39:59 -05:00
amdgpu_dpm.h drm/amd/pp: Unify powergate_uvd/vce/mmhub to set_powergating_by_smu 2018-07-05 16:38:48 -05:00
amdgpu_drv.c drm/amdgpu: remove internal/unused kernel module parameters 2018-07-18 16:18:44 -05:00
amdgpu_drv.h
amdgpu_encoders.c drm: drop _mode_ from drm_mode_connector_attach_encoder 2018-07-13 18:40:27 +02:00
amdgpu_fb.c drm/amdgpu: use drm_fb helper for console_(un)lock 2018-07-20 14:24:18 -05:00
amdgpu_fence.c drm-misc-next for 4.19: 2018-07-06 10:01:56 +10:00
amdgpu_gart.c drm/amdgpu: separate gpu address from bo pin 2018-07-10 14:15:39 -05:00
amdgpu_gart.h drm/amdgpu: Add AMDGPU_GPU_PAGES_IN_CPU_PAGE define 2018-07-05 16:39:49 -05:00
amdgpu_gds.h
amdgpu_gem.c drm/amdgpu: consistenly name amdgpu_bo_ functions 2018-07-25 15:06:06 -05:00
amdgpu_gfx.c
amdgpu_gfx.h
amdgpu_gmc.h drm/amdgpu: save vm fault information for amdkfd 2018-07-11 22:32:49 -04:00
amdgpu_gtt_mgr.c
amdgpu_i2c.c
amdgpu_i2c.h
amdgpu_ib.c amdgpu: fix multi-process hang issue 2018-08-27 11:09:40 -05:00
amdgpu_ids.c drm/amdgpu: remove duplicated codes 2018-07-05 16:38:46 -05:00
amdgpu_ids.h
amdgpu_ih.c
amdgpu_ih.h
amdgpu_ioc32.c
amdgpu_irq.c drm/amdgpu: update documentation for amdgpu_irq.c v3 2018-06-15 12:20:44 -05:00
amdgpu_irq.h
amdgpu_job.c drm/scheduler: remove sched field from the entity 2018-07-25 15:06:26 -05:00
amdgpu_job.h drm/amdgpu: remove job->adev (v2) 2018-07-17 14:18:28 -05:00
amdgpu_kms.c drm/amdgpu: nuke amdgpu_bo_list_free 2018-07-31 16:58:18 -05:00
amdgpu_mn.c mm, oom: distinguish blockable mode for mmu notifiers 2018-08-22 10:52:44 -07:00
amdgpu_mn.h drm/amdgpu: Add MMU notifier type for KFD userptr 2018-03-23 15:32:28 -04:00
amdgpu_mode.h drm/amdgpu: Move GEM BO to drm_framebuffer 2018-04-11 13:07:56 -05:00
amdgpu_object.c drm/amdgpu: Replace ttm_bo_unref with ttm_bo_put 2018-07-31 16:58:21 -05:00
amdgpu_object.h drm/amdgpu: reduce the number of placements for a BO 2018-07-25 15:06:13 -05:00
amdgpu_pll.c
amdgpu_pll.h
amdgpu_pm.c drm/amdgpu/pm: Fix potential Spectre v1 2018-07-31 16:58:23 -05:00
amdgpu_pm.h
amdgpu_prime.c drm/amdgpu: consistenly name amdgpu_bo_ functions 2018-07-25 15:06:06 -05:00
amdgpu_psp.c drm/amdgpu: update tmr mc address 2018-08-13 17:18:54 -05:00
amdgpu_psp.h
amdgpu_queue_mgr.c drm/amdgpu: implement harvesting support for UVD 7.2 (v3) 2018-07-27 09:07:44 -05:00
amdgpu_ring.c drm/amdgpu: allow for more flexible priority handling 2018-07-18 16:18:43 -05:00
amdgpu_ring.h drm/amdgpu: add support for inplace IB patching for MM engines v2 2018-07-27 09:07:41 -05:00
amdgpu_sa.c
amdgpu_sched.c drm/amdgpu: fix incorrect use of drm_file->pid 2018-08-21 14:19:18 -05:00
amdgpu_sched.h
amdgpu_sync.c
amdgpu_sync.h
amdgpu_test.c drm/amdgpu: allocate gart memory when it's required (v3) 2018-07-10 14:15:58 -05:00
amdgpu_trace_points.c
amdgpu_trace.h drm/amdgpu: add new amdgpu_vm_bo_trace_cs() function v2 2018-07-31 16:58:17 -05:00
amdgpu_ttm.c drm/amdgpu: clean up the superfluous space and align the comment text for amdgpu_ttm 2018-07-27 15:00:38 -05:00
amdgpu_ttm.h drm/amdgpu: Keep track of amount of pinned CPU visible VRAM 2018-07-13 14:46:11 -05:00
amdgpu_ucode.c drm/amdgpu: Set vega20 load_type to AMDGPU_FW_LOAD_DIRECT. 2018-05-17 10:13:22 -05:00
amdgpu_ucode.h drm/amdgpu:add new firmware id for VCN 2018-08-13 17:19:10 -05:00
amdgpu_uvd.c drm/amdgpu: Use kvmalloc for allocating UVD/VCE/VCN BO backup memory 2018-08-16 12:59:11 -05:00
amdgpu_uvd.h drm/amdgpu/uvd: UVD entity initialization relys on ring initialization 2018-08-13 17:20:10 -05:00
amdgpu_vce.c drm/amdgpu/vce: VCE entity initialization relies on ring initializtion 2018-08-13 17:21:29 -05:00
amdgpu_vce.h drm/amdgpu/vce: VCE entity initialization relies on ring initializtion 2018-08-13 17:21:29 -05:00
amdgpu_vcn.c drm/amdgpu: Use kvmalloc for allocating UVD/VCE/VCN BO backup memory 2018-08-16 12:59:11 -05:00
amdgpu_vcn.h drm/amdgpu: add vcn jpeg ib test 2018-06-15 12:20:38 -05:00
amdgpu_vf_error.c
amdgpu_vf_error.h
amdgpu_virt.c
amdgpu_virt.h
amdgpu_vm.c drm/amdgpu: fix VM clearing for the root PD 2018-08-27 11:09:39 -05:00
amdgpu_vm.h drm/amdgpu: add new amdgpu_vm_bo_trace_cs() function v2 2018-07-31 16:58:17 -05:00
amdgpu_vram_mgr.c drm/amdgpu: Keep track of amount of pinned CPU visible VRAM 2018-07-13 14:46:11 -05:00
amdgpu.h drm/amdgpu: move bo_list defines to amdgpu_bo_list.h 2018-07-31 16:58:18 -05:00
atom.c Revert "drm/amdgpu: avoid sleep while executing atombios table (V2)" 2018-07-05 16:38:27 -05: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
ci_dpm.c drm/amdgpu: use pcie functions for link width and speed 2018-07-05 16:39:59 -05:00
ci_dpm.h
ci_smc.c
cik_dpm.h
cik_ih.c
cik_ih.h
cik_sdma.c drm/amdgpu: switch firmware path for CIK parts (v2) 2018-07-05 16:39:58 -05:00
cik_sdma.h
cik.c gpu: drm: amdgpu: Replace mdelay with msleep in cik_pcie_gen3_enable() 2018-07-25 15:06:40 -05:00
cik.h
cikd.h
clearstate_ci.h
clearstate_defs.h
clearstate_gfx9.h
clearstate_si.h
clearstate_vi.h
cz_ih.c
cz_ih.h
dce_v6_0.c drm/amdgpu: separate gpu address from bo pin 2018-07-10 14:15:39 -05:00
dce_v6_0.h
dce_v8_0.c drm/amdgpu: separate gpu address from bo pin 2018-07-10 14:15:39 -05:00
dce_v8_0.h
dce_v10_0.c drm/amd: Use newly added interrupt source defs for VI v3. 2018-07-13 14:45:30 -05:00
dce_v10_0.h
dce_v11_0.c drm/amd: Use newly added interrupt source defs for VI v3. 2018-07-13 14:45:30 -05:00
dce_v11_0.h
dce_virtual.c Merge branch 'drm-next-4.19' of git://people.freedesktop.org/~agd5f/linux into drm-next 2018-07-20 14:54:31 +10:00
dce_virtual.h
df_v1_7.c drm/amdgpu: add a df 1.7 implementation of enable_ecc_force_par_wr_rmw 2018-05-23 23:51:21 -05:00
df_v1_7.h drm/amdgpu/df: implement df v1_7 callback functions 2018-04-11 13:07:54 -05:00
df_v3_6.c drm/amdgpu/df: fix potential array out-of-bounds read 2018-06-01 09:45:05 -05:00
df_v3_6.h drm/amdgpu/df: implement df v3_6 callback functions (v2) 2018-05-18 16:08:15 -05:00
emu_soc.c
gfx_v6_0.c drm/amdgpu: switch firmware path for SI parts 2018-07-05 16:39:58 -05:00
gfx_v6_0.h
gfx_v7_0.c drm/amdgpu: switch firmware path for CIK parts (v2) 2018-07-05 16:39:58 -05:00
gfx_v7_0.h
gfx_v8_0.c drm/amd: Use newly added interrupt source defs for VI v3. 2018-07-13 14:45:30 -05:00
gfx_v8_0.h
gfx_v9_0.c drm/amdgpu: Fix RLC safe mode test in gfx_v9_0_enter_rlc_safe_mode 2018-07-24 15:13:53 -05:00
gfx_v9_0.h
gfxhub_v1_0.c
gfxhub_v1_0.h
gmc_v6_0.c drm/amdgpu: Fix page fault and kasan warning on pci device remove. 2018-08-27 11:09:40 -05:00
gmc_v6_0.h
gmc_v7_0.c drm/amdgpu: Fix page fault and kasan warning on pci device remove. 2018-08-27 11:09:40 -05:00
gmc_v7_0.h
gmc_v8_0.c drm/amdgpu: Fix page fault and kasan warning on pci device remove. 2018-08-27 11:09:40 -05:00
gmc_v8_0.h
gmc_v9_0.c drm/amdgpu: Fix page fault and kasan warning on pci device remove. 2018-08-27 11:09:40 -05:00
gmc_v9_0.h
iceland_ih.c
iceland_ih.h
iceland_sdma_pkt_open.h
Kconfig
kv_dpm.c drm/amd/pp: Unify powergate_uvd/vce/mmhub to set_powergating_by_smu 2018-07-05 16:38:48 -05:00
kv_dpm.h
kv_smc.c
Makefile drm/amdgpu/df: implement df v3_6 callback functions (v2) 2018-05-18 16:08:15 -05:00
mmhub_v1_0.c drm/amd/pp: Unify powergate_uvd/vce/mmhub to set_powergating_by_smu 2018-07-05 16:38:48 -05:00
mmhub_v1_0.h
mmsch_v1_0.h
mxgpu_ai.c drm/amdgpu/sriov: Need to set in_gpu_reset flag to back after gpu reset 2018-05-15 13:44:06 -05:00
mxgpu_ai.h
mxgpu_vi.c
mxgpu_vi.h
nbio_v6_1.c
nbio_v6_1.h
nbio_v7_0.c drm/amdgpu: Add nbio support for vega20 (v2) 2018-05-17 10:13:18 -05:00
nbio_v7_0.h
ObjectID.h drm/amdgpu: Add BRACKET_LAYOUT_ENUMs to ObjectID.h 2018-06-15 12:20:42 -05:00
ppsmc.h
psp_gfx_if.h drm/amdgpu: update psp gfx if header 2018-05-15 13:43:35 -05:00
psp_v3_1.c drm/amdgpu: add checking for sos version 2018-06-13 13:45:20 -05:00
psp_v3_1.h
psp_v10_0.c drm/amdgpu:add VCN support in PSP driver 2018-08-13 17:19:27 -05:00
psp_v10_0.h
r600_dpm.h
sdma_v2_4.c drm/amd: Use newly added interrupt source defs for VI v3. 2018-07-13 14:45:30 -05:00
sdma_v2_4.h
sdma_v3_0.c drm/amd: Use newly added interrupt source defs for VI v3. 2018-07-13 14:45:30 -05:00
sdma_v3_0.h
sdma_v4_0.c drm/amd: Use newly added interrupt source defs for SOC15. 2018-07-13 14:45:43 -05:00
sdma_v4_0.h
si_dma.c
si_dma.h
si_dpm.c drm/amdgpu: use pcie functions for link width and speed 2018-07-05 16:39:59 -05:00
si_dpm.h
si_enums.h
si_ih.c
si_ih.h
si_smc.c
si.c drm/amdgpu/si: implement asic need_full_reset callback 2018-04-11 13:07:57 -05:00
si.h
sid.h
sislands_smc.h
soc15_common.h drm/amdgpu: Add SOC15_WAIT_ON_RREG macro define 2018-05-24 00:18:02 -05:00
soc15.c drm/amdgpu: typo fix for vega20 cg flags 2018-05-30 12:37:05 -05:00
soc15.h drm/amdgpu/soc15: dynamic initialize ip offset for vega20 2018-05-17 10:13:17 -05:00
soc15d.h drm/amdgpu: add jpeg packet defines to soc15d.h 2018-06-15 12:20:34 -05:00
tonga_ih.c
tonga_ih.h
tonga_sdma_pkt_open.h
uvd_v4_2.c drm/amdgpu/uvd: UVD entity initialization relys on ring initialization 2018-08-13 17:20:10 -05:00
uvd_v4_2.h
uvd_v5_0.c drm/amdgpu/uvd: UVD entity initialization relys on ring initialization 2018-08-13 17:20:10 -05:00
uvd_v5_0.h
uvd_v6_0.c drm/amdgpu/uvd: UVD entity initialization relys on ring initialization 2018-08-13 17:20:10 -05:00
uvd_v6_0.h
uvd_v7_0.c drm/amdgpu/uvd: UVD entity initialization relys on ring initialization 2018-08-13 17:20:10 -05:00
uvd_v7_0.h
vce_v2_0.c drm/amdgpu/vce: VCE entity initialization relies on ring initializtion 2018-08-13 17:21:29 -05:00
vce_v2_0.h
vce_v3_0.c drm/amdgpu/vce: VCE entity initialization relies on ring initializtion 2018-08-13 17:21:29 -05:00
vce_v3_0.h
vce_v4_0.c drm/amdgpu: Use kvmalloc for allocating UVD/VCE/VCN BO backup memory 2018-08-16 12:59:11 -05:00
vce_v4_0.h
vcn_v1_0.c drm/amdgpu:add VCN booting with firmware loaded by PSP 2018-08-13 17:19:46 -05:00
vcn_v1_0.h
vega10_ih.c
vega10_ih.h
vega10_reg_init.c drm/amdgpu: Add CLK IP base offset 2018-07-10 14:16:39 -05:00
vega10_sdma_pkt_open.h
vega20_reg_init.c drm/amdgpu: set correct base for THM/NBIF/MP1 IP 2018-08-21 14:16:50 -05:00
vi_dpm.h
vi.c drm/amdgpu: access register without KIQ 2018-08-21 14:17:36 -05:00
vi.h
vid.h