Matthew Auld
8fbf28934a
drm/i915/ttm: fixup the mock_bo
When running the mock selftests we currently blow up with:
<6> [299.836278] i915: Running i915_gem_huge_page_mock_selftests/igt_mock_memory_region_huge_pages
<1> [299.836356] BUG: kernel NULL pointer dereference, address: 00000000000000c8
<1> [299.836361] #PF: supervisor read access in kernel mode
<1> [299.836364] #PF: error_code(0x0000) - not-present page
<6> [299.836367] PGD 0 P4D 0
<4> [299.836369] Oops: 0000 [#1] PREEMPT SMP NOPTI
<4> [299.836372] CPU: 1 PID: 1429 Comm: i915_selftest Tainted: G U 5.17.0-rc4-CI-CI_DRM_11227+ #1
<4> [299.836376] Hardware name: Intel(R) Client Systems NUC11TNHi5/NUC11TNBi5, BIOS TNTGL357.0042.2020.1221.1743 12/21/2020
<4> [299.836380] RIP: 0010:ttm_resource_init+0x57/0x90 [ttm]
<4> [299.836392] RSP: 0018:ffffc90001e4f680 EFLAGS: 00010203
<4> [299.836395] RAX: 0000000000000000 RBX: ffffc90001e4f708 RCX: 0000000000000000
<4> [299.836398] RDX: ffff888116172528 RSI: ffffc90001e4f6f8 RDI: 0000000000000000
<4> [299.836401] RBP: ffffc90001e4f6f8 R08: 00000000000001b0 R09: ffff888116172528
<4> [299.836403] R10: 0000000000000001 R11: 00000000a4cb2e51 R12: ffffc90001e4fa90
<4> [299.836406] R13: ffff888116172528 R14: ffff888130d7f4b0 R15: ffff888130d7f400
<4> [299.836409] FS: 00007ff241684500(0000) GS:ffff88849fe80000(0000) knlGS:0000000000000000
<4> [299.836412] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
<4> [299.836416] CR2: 00000000000000c8 CR3: 0000000107b80001 CR4: 0000000000770ee0
<4> [299.836418] PKRU: 55555554
<4> [299.836420] Call Trace:
<4> [299.836422] <TASK>
<4> [299.836423] i915_ttm_buddy_man_alloc+0x68/0x240 [i915]
ttm_resource_init() now needs to access the bo->bdev, and also wants to
store the bo reference. Try to keep both working. The mock_bo is a hack
so we can interface directly with the ttm managers alloc() and free() hooks for
our mock testing, without invoking other TTM features like eviction,
moves, etc.
v2: make sure we only touch res->bo if the alloc() returns successfully
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5123
Fixes: 0e05fc49c3 ("drm/ttm: add common accounting to the resource mgr v3")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220221121103.2473831-1-matthew.auld@intel.com
2022-02-25 14:14:52 +00:00
..
2022-02-08 12:15:04 +01:00
2022-02-11 11:55:26 -08:00
2021-12-17 11:34:35 +00:00
2022-01-03 13:44:38 +01:00
2022-02-08 17:06:14 +09:00
2022-01-13 12:50:48 +00:00
2022-02-07 21:02:31 +01:00
2022-02-11 05:51:23 -07:00
2022-01-18 10:05:48 +02:00
2022-02-06 13:19:46 +01:00
2022-01-22 08:33:35 +02:00
2022-02-14 10:52:27 +10:00
2022-01-21 09:16:11 +02:00
2022-02-07 17:42:44 +01:00
2022-01-26 18:57:09 -08:00
2022-01-26 19:40:33 +01:00
2022-01-06 18:31:33 +01:00
2022-01-05 18:31:17 +01:00
2022-01-31 11:22:53 +11:00
2022-01-04 17:29:31 -08:00
2022-01-15 20:37:06 +02:00
2021-12-16 11:29:54 +09:00
2022-01-18 14:03:34 +02:00
2022-02-25 05:50:18 +10:00
2022-01-30 01:06:35 +01:00
2021-12-24 15:27:52 +09:00
2022-02-01 19:02:41 +10:00
2021-12-09 20:06:54 -08:00
2021-12-22 15:38:12 +01:00
2022-02-09 11:41:29 +01:00
2022-02-25 14:14:52 +00:00
2021-12-21 10:13:26 +01:00
2022-01-21 15:10:02 +01:00
2022-01-23 22:31:23 +00:00
2022-01-24 14:32:47 -08:00
2021-12-13 11:54:07 -07:00
2022-01-18 10:05:48 +02:00
2022-01-13 02:05:50 +01:00
2022-02-11 12:13:22 +01:00
2022-02-01 10:12:26 -04:00
2022-02-01 16:52:54 +01:00
2021-12-15 07:14:27 +02:00
2022-02-04 12:57:26 +01:00
2022-02-02 10:49:29 +00:00
2021-12-30 12:12:12 -08:00
2022-01-12 16:59:22 -08:00
2022-01-22 08:33:35 +02:00
2022-01-13 11:19:07 -08:00
2022-02-02 10:14:07 -08:00
2022-02-07 16:35:35 -08:00
2022-01-11 11:35:28 -08:00
2022-01-10 10:33:52 -05:00
2022-01-12 11:11:34 -08:00
2022-02-14 10:52:27 +10:00
2022-01-31 15:36:34 +01:00
2022-01-14 15:08:36 +01:00
2022-02-12 09:56:18 -08:00
2022-01-12 14:17:45 +00:00
2022-01-17 08:14:18 +02:00
2022-01-22 08:33:37 +02:00
2022-01-18 10:05:48 +02:00
2022-02-09 14:50:42 +01:00
2021-12-21 10:26:50 +01:00
2022-01-22 09:52:17 +02:00
2022-01-22 11:28:23 +02:00
2022-02-11 12:55:17 -08:00
2022-01-16 08:08:11 +02:00
2022-01-13 09:05:29 -08:00
2022-02-02 10:33:04 +05:30
2022-01-31 12:07:31 +01:00
2022-02-14 10:52:27 +10:00
2022-01-22 08:33:37 +02:00
2022-01-11 11:26:57 -08:00
2021-12-27 16:51:12 +01:00
2022-01-06 12:18:08 +00:00
2022-01-20 13:25:01 +02:00
2021-12-21 10:22:19 +01:00
2021-12-11 11:55:27 +01:00
2022-01-19 16:47:39 +00:00
2022-01-17 16:44:26 -06:00
2022-01-10 08:32:37 -08:00
2022-01-27 11:23:26 +02:00
2022-01-16 23:50:34 +01:00
2022-02-09 22:55:01 +01:00
2022-02-07 23:45:02 -05:00
2022-02-08 09:52:59 +01:00
2022-01-14 16:02:28 +01:00
2022-02-01 12:39:37 -08:00
2021-12-17 17:18:18 +01:00
2022-02-25 05:50:18 +10:00
2022-01-24 23:30:24 -05:00
2022-02-08 09:48:44 +01:00
2022-01-17 19:48:07 +01:00
2021-12-28 10:43:56 +03:00
2022-02-04 15:36:02 +01:00
2021-12-29 10:54:50 +01:00
2022-02-12 10:08:54 +01:00
2022-01-18 10:05:48 +02:00
2022-01-20 13:31:46 +02:00
2022-01-14 18:50:54 -05:00
2022-02-25 05:50:18 +10:00
2022-01-23 06:20:44 +02:00
2022-01-14 18:50:53 -05:00
2021-12-21 10:38:13 +01:00
2022-01-17 08:07:57 +02:00
2022-02-10 11:10:23 +01:00
2022-01-22 08:33:37 +02:00
2021-12-08 14:53:15 -05:00