Andrey Grodzovsky
eb7e5cfced
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-22 16:36:49 -05:00
..
2018-07-18 09:03:07 -05:00
2016-10-25 14:38:45 -04:00
2018-07-20 14:24:41 -05:00
2017-03-29 23:53:24 -04:00
2018-07-03 13:13:08 +02:00
2018-07-16 19:10:36 -04:00
2018-07-16 19:10:36 -04:00
2018-07-16 19:10:36 -04:00
2018-08-21 14:19:26 -05:00
2018-07-16 19:10:36 -04:00
2018-07-16 19:10:36 -04:00
2017-12-18 10:58:35 -05:00
2017-12-18 10:58:35 -05:00
2018-05-24 10:07:55 -05:00
2018-05-17 10:13:22 -05:00
2018-07-30 10:39:22 +10:00
2018-07-10 14:15:58 -05:00
2017-12-18 10:59:46 -05:00
2018-07-31 16:58:19 -05:00
2018-07-31 16:58:19 -05:00
2018-07-05 16:39:58 -05:00
2018-07-13 18:40:27 +02:00
2015-06-03 21:03:15 -04:00
2018-08-22 16:05:00 -05:00
2018-07-25 15:06:19 -05:00
2018-05-15 13:44:19 -05:00
2017-12-18 10:59:01 -05:00
2018-08-21 14:32:28 -05:00
2018-07-10 14:15:58 -05:00
2018-05-15 13:43:43 -05:00
2018-07-05 16:39:59 -05:00
2018-07-05 16:38:48 -05:00
2018-07-18 16:18:44 -05:00
2015-08-17 16:50:21 -04:00
2018-07-13 18:40:27 +02:00
2018-07-20 14:24:18 -05:00
2018-07-06 10:01:56 +10:00
2018-07-10 14:15:39 -05:00
2018-07-05 16:39:49 -05:00
2016-08-19 12:30:58 -04:00
2018-07-25 15:06:06 -05:00
2018-01-29 23:14:30 -05:00
2017-06-07 18:20:59 -04:00
2018-07-11 22:32:49 -04:00
2018-02-20 15:09:21 -05:00
2017-01-27 11:12:39 -05:00
2016-09-27 13:00:52 -04:00
2018-08-22 16:05:20 -05:00
2018-07-05 16:38:46 -05:00
2018-02-19 14:20:18 -05:00
2017-12-18 10:59:07 -05:00
2018-03-14 15:16:35 -05:00
2015-06-03 21:03:15 -04:00
2018-06-15 12:20:44 -05:00
2018-02-19 14:18:16 -05:00
2018-07-25 15:06:26 -05:00
2018-07-17 14:18:28 -05:00
2018-07-31 16:58:18 -05:00
2018-07-05 16:40:03 -05:00
2018-03-23 15:32:28 -04:00
2018-04-11 13:07:56 -05:00
2018-07-31 16:58:21 -05:00
2018-07-25 15:06:13 -05:00
2016-09-14 15:10:37 -04:00
2015-06-03 21:03:15 -04:00
2018-07-31 16:58:23 -05:00
2017-08-15 14:46:06 -04:00
2018-07-25 15:06:06 -05:00
2018-08-13 17:18:54 -05:00
2018-02-19 14:18:31 -05:00
2018-07-27 09:07:44 -05:00
2018-07-18 16:18:43 -05:00
2018-07-27 09:07:41 -05:00
2018-02-28 14:18:07 -05:00
2018-08-21 14:19:18 -05:00
2017-12-07 11:51:56 -05:00
2018-02-06 20:32:37 -05:00
2018-02-06 20:32:37 -05:00
2018-07-10 14:15:58 -05:00
2017-11-15 20:42:10 -08:00
2018-07-31 16:58:17 -05:00
2018-07-27 15:00:38 -05:00
2018-07-13 14:46:11 -05:00
2018-05-17 10:13:22 -05:00
2018-08-13 17:19:10 -05:00
2018-08-16 12:59:11 -05:00
2018-08-13 17:20:10 -05:00
2018-08-13 17:21:29 -05:00
2018-08-13 17:21:29 -05:00
2018-08-16 12:59:11 -05:00
2018-06-15 12:20:38 -05:00
2017-10-20 13:28:44 -04:00
2017-09-28 16:03:20 -04:00
2018-03-07 16:10:13 -05:00
2018-02-19 14:18:48 -05:00
2018-08-22 16:04:14 -05:00
2018-07-31 16:58:17 -05:00
2018-07-13 14:46:11 -05:00
2018-07-31 16:58:18 -05:00
2018-07-05 16:38:27 -05:00
2017-08-29 15:27:54 -04:00
2017-06-20 12:06:49 -04:00
2016-05-04 20:23:53 -04:00
2016-08-08 13:28:39 -04:00
2015-06-03 21:03:15 -04:00
2018-03-14 15:39:51 -05:00
2018-03-14 15:39:51 -05:00
2017-12-06 12:47:59 -05:00
2016-07-14 16:39:35 -04:00
2018-07-05 16:39:59 -05:00
2018-03-06 13:12:38 -05:00
2017-05-16 17:17:41 +02:00
2018-03-15 09:57:50 -05:00
2018-02-26 23:09:36 -05:00
2016-10-25 14:38:45 -04:00
2018-07-05 16:39:58 -05:00
2016-10-25 14:38:45 -04:00
2018-07-25 15:06:40 -05:00
2018-02-19 14:18:10 -05:00
2017-11-27 18:29:47 -05:00
2015-06-03 21:03:17 -04:00
2017-12-13 17:28:08 -05:00
2017-01-27 12:20:41 -05:00
2015-06-03 21:03:17 -04:00
2018-02-26 23:09:36 -05:00
2016-10-25 14:38:45 -04:00
2018-07-10 14:15:39 -05:00
2016-10-25 14:38:45 -04:00
2018-07-10 14:15:39 -05:00
2016-10-25 14:38:45 -04:00
2018-07-13 14:45:30 -05:00
2016-10-25 14:38:45 -04:00
2018-07-13 14:45:30 -05:00
2016-10-25 14:38:45 -04:00
2018-07-20 14:54:31 +10:00
2016-10-25 14:38:45 -04:00
2018-05-23 23:51:21 -05:00
2018-04-11 13:07:54 -05:00
2018-06-01 09:45:05 -05:00
2018-05-18 16:08:15 -05:00
2018-02-19 14:19:49 -05:00
2018-07-05 16:39:58 -05:00
2016-10-25 14:38:45 -04:00
2018-07-05 16:39:58 -05:00
2017-05-31 16:48:48 -04:00
2018-07-13 14:45:30 -05:00
2017-05-31 16:48:48 -04:00
2018-07-24 15:13:53 -05:00
2017-08-15 14:46:13 -04:00
2018-02-26 23:09:36 -05:00
2017-08-15 14:46:00 -04:00
2018-08-22 16:36:49 -05:00
2016-10-25 14:38:45 -04:00
2018-08-22 16:36:49 -05:00
2016-10-25 14:38:45 -04:00
2018-08-22 16:36:49 -05:00
2016-10-25 14:38:45 -04:00
2018-08-22 16:36:49 -05:00
2017-03-29 23:54:44 -04:00
2018-02-26 23:09:36 -05:00
2016-10-25 14:38:45 -04:00
2015-09-02 12:21:35 -04:00
2017-09-26 17:01:32 -04:00
2018-07-05 16:38:48 -05:00
2015-06-03 21:03:17 -04:00
2017-05-16 17:17:41 +02:00
2018-05-18 16:08:15 -05:00
2018-07-05 16:38:48 -05:00
2017-08-15 14:46:00 -04:00
2017-04-28 17:32:57 -04:00
2018-05-15 13:44:06 -05:00
2018-03-14 14:38:27 -05:00
2017-12-18 10:59:58 -05:00
2017-09-26 15:14:12 -04:00
2018-03-20 23:43:25 -05:00
2017-12-13 17:28:07 -05:00
2018-05-17 10:13:18 -05:00
2017-12-13 17:28:07 -05:00
2018-06-15 12:20:42 -05:00
2016-07-15 12:33:31 -04:00
2018-05-15 13:43:35 -05:00
2018-06-13 13:45:20 -05:00
2018-02-19 14:18:31 -05:00
2018-08-13 17:19:27 -05:00
2018-02-19 14:18:31 -05:00
2016-08-31 15:21:09 -04:00
2018-07-13 14:45:30 -05:00
2016-10-25 14:38:45 -04:00
2018-07-13 14:45:30 -05:00
2016-10-25 14:38:45 -04:00
2018-07-13 14:45:43 -05:00
2017-03-29 23:54:45 -04:00
2018-03-05 15:37:12 -05:00
2016-10-25 14:38:45 -04:00
2018-07-05 16:39:59 -05:00
2018-03-15 09:57:50 -05:00
2017-02-08 17:25:02 -05:00
2017-12-27 11:34:02 -05:00
2016-10-25 14:38:45 -04:00
2017-05-16 17:17:41 +02:00
2018-04-11 13:07:57 -05:00
2018-02-19 14:18:08 -05:00
2017-01-27 12:20:41 -05:00
2016-09-28 16:13:17 -04:00
2018-05-24 00:18:02 -05:00
2018-05-30 12:37:05 -05:00
2018-05-17 10:13:17 -05:00
2018-06-15 12:20:34 -05:00
2018-02-26 23:09:36 -05:00
2016-10-25 14:38:45 -04:00
2015-09-02 12:21:35 -04:00
2018-08-13 17:20:10 -05:00
2016-10-25 14:38:45 -04:00
2018-08-13 17:20:10 -05:00
2016-10-25 14:38:45 -04:00
2018-08-13 17:20:10 -05:00
2016-10-25 14:38:45 -04:00
2018-08-13 17:20:10 -05:00
2017-03-29 23:54:47 -04:00
2018-08-13 17:21:29 -05:00
2016-10-25 14:38:45 -04:00
2018-08-13 17:21:29 -05:00
2016-10-25 14:38:45 -04:00
2018-08-16 12:59:11 -05:00
2017-03-29 23:54:47 -04:00
2018-08-13 17:19:46 -05:00
2017-05-24 17:41:27 -04:00
2018-03-14 15:16:35 -05:00
2017-03-29 23:54:46 -04:00
2018-07-10 14:16:39 -05:00
2017-03-29 23:54:30 -04:00
2018-08-21 14:16:50 -05:00
2017-01-27 11:12:43 -05:00
2018-08-21 14:17:36 -05:00
2018-02-19 14:18:11 -05:00
2017-11-01 19:22:00 -04:00