Hi Chris,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on drm-intel/for-linux-next]
[cannot apply to v5.4 next-20191129]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see
https://stackoverflow.com/a/37406982]
url:
https://github.com/0day-ci/linux/commits/Chris-Wilson/drm-i915-selftests-...
base:
git://anongit.freedesktop.org/drm-intel for-linux-next
config: i386-randconfig-d002-20191129 (attached as .config)
compiler: gcc-7 (Debian 7.5.0-1) 7.5.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from drivers/gpu/drm/i915/gem/i915_gem_object.c:346:0:
drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c: In function
'igt_gem_coherency':
> drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c:329:2:
error: implicit declaration of function 'intel_engine_pm_get'; did you mean
'intel_runtime_pm_get'? [-Werror=implicit-function-declaration]
intel_engine_pm_get(ctx.engine);
^~~~~~~~~~~~~~~~~~~
intel_runtime_pm_get
> drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c:408:2:
error: implicit declaration of function 'intel_engine_pm_put'; did you mean
'intel_runtime_pm_put'? [-Werror=implicit-function-declaration]
intel_engine_pm_put(ctx.engine);
^~~~~~~~~~~~~~~~~~~
intel_runtime_pm_put
Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_read
Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_write
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_read
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_set
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_inc
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_dec
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_dec_and_test
Cyclomatic Complexity 2 arch/x86/include/asm/atomic.h:arch_atomic_try_cmpxchg
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_read
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_set
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_inc
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_dec
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_try_cmpxchg
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_dec_and_test
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:arch_test_and_clear_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:constant_test_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:variable_test_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:__ffs
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls
Cyclomatic Complexity 1 include/asm-generic/bitops-instrumented.h:test_and_clear_bit
Cyclomatic Complexity 1 include/linux/bitops.h:fls_long
Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u32
Cyclomatic Complexity 1 include/linux/log2.h:__rounddown_pow_of_two
Cyclomatic Complexity 2 arch/x86/include/asm/div64.h:div_u64_rem
Cyclomatic Complexity 1 arch/x86/include/asm/div64.h:mul_u32_u32
Cyclomatic Complexity 1 include/linux/list.h:INIT_LIST_HEAD
Cyclomatic Complexity 1 include/linux/list.h:__list_del
Cyclomatic Complexity 1 include/linux/list.h:list_empty
Cyclomatic Complexity 1 include/linux/math64.h:div_u64
Cyclomatic Complexity 1 arch/x86/include/asm/current.h:get_current
Cyclomatic Complexity 2 arch/x86/include/asm/jump_label.h:arch_static_branch
Cyclomatic Complexity 1 include/linux/jump_label.h:static_key_false
Cyclomatic Complexity 1 include/linux/cpumask.h:cpu_max_bits_warn
Cyclomatic Complexity 1 include/linux/cpumask.h:cpumask_check
Cyclomatic Complexity 1 include/linux/err.h:ERR_PTR
Cyclomatic Complexity 1 include/linux/err.h:PTR_ERR
Cyclomatic Complexity 5 arch/x86/include/asm/preempt.h:__preempt_count_add
Cyclomatic Complexity 5 arch/x86/include/asm/preempt.h:__preempt_count_sub
Cyclomatic Complexity 1 include/linux/spinlock.h:spinlock_check
Cyclomatic Complexity 1 include/linux/spinlock.h:spin_lock
Cyclomatic Complexity 1 include/linux/spinlock.h:spin_unlock
Cyclomatic Complexity 1 include/linux/rcupdate.h:__rcu_read_lock
Cyclomatic Complexity 1 include/linux/rcupdate.h:__rcu_read_unlock
Cyclomatic Complexity 1 include/linux/rcupdate.h:rcu_read_lock
Cyclomatic Complexity 1 include/linux/rcupdate.h:rcu_read_lock_sched_notrace
Cyclomatic Complexity 1 include/linux/rcupdate.h:rcu_read_unlock_sched_notrace
Cyclomatic Complexity 1 include/linux/llist.h:llist_del_all
Cyclomatic Complexity 1 include/linux/nodemask.h:node_state
Cyclomatic Complexity 1 arch/x86/include/asm/topology.h:numa_node_id
Cyclomatic Complexity 2 drivers/gpu/drm/i915/i915_utils.h:yesno
Cyclomatic Complexity 2 include/linux/mmzone.h:__nr_to_section
Cyclomatic Complexity 1 include/linux/mmzone.h:__section_mem_map_addr
Cyclomatic Complexity 1 include/linux/topology.h:numa_mem_id
Cyclomatic Complexity 1 include/linux/uaccess.h:pagefault_disabled_inc
Cyclomatic Complexity 1 include/linux/uaccess.h:pagefault_disabled_dec
Cyclomatic Complexity 1 include/linux/uaccess.h:pagefault_disable
Cyclomatic Complexity 1 include/linux/uaccess.h:pagefault_enable
Cyclomatic Complexity 1 include/linux/mm.h:page_to_section
Cyclomatic Complexity 1 include/linux/mm.h:lowmem_page_address
Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_large
Cyclomatic Complexity 3 include/linux/slab.h:kmalloc
Cyclomatic Complexity 1 include/linux/scatterlist.h:sg_page
Cyclomatic Complexity 1 include/linux/scatterlist.h:sg_mark_end
Cyclomatic Complexity 1 drivers/gpu/drm/i915/i915_gem_gtt.h:i915_vm_is_4lvl
Cyclomatic Complexity 1 include/linux/dma-resv.h:dma_resv_get_list
Cyclomatic Complexity 1 drivers/gpu/drm/i915/gem/i915_gem_object_types.h:to_intel_bo
Cyclomatic Complexity 1
drivers/gpu/drm/i915/gem/i915_gem_object.h:i915_gem_object_set_volatile
Cyclomatic Complexity 1
drivers/gpu/drm/i915/gem/i915_gem_object.h:i915_gem_object_type_has
Cyclomatic Complexity 1
drivers/gpu/drm/i915/gem/i915_gem_object.h:i915_gem_object_has_struct_page
Cyclomatic Complexity 1
drivers/gpu/drm/i915/gem/i915_gem_object.h:__i915_gem_object_unpin_pages
Cyclomatic Complexity 1
drivers/gpu/drm/i915/gem/i915_gem_object.h:i915_gem_object_unpin_pages
Cyclomatic Complexity 1
drivers/gpu/drm/i915/gem/i915_gem_object.h:i915_gem_object_unpin_map
Cyclomatic Complexity 1 drivers/gpu/drm/i915/i915_vma.h:i915_vma_unset_ggtt_write
Cyclomatic Complexity 1 drivers/gpu/drm/i915/i915_vma.h:i915_ggtt_offset
Cyclomatic Complexity 1 drivers/gpu/drm/i915/i915_vma.h:__i915_vma_unpin
Cyclomatic Complexity 1 drivers/gpu/drm/i915/i915_vma.h:i915_vma_unpin
Cyclomatic Complexity 1 include/linux/highmem.h:kmap_atomic
Cyclomatic Complexity 1 include/linux/highmem.h:__kunmap_atomic
Cyclomatic Complexity 2 include/linux/random.h:__seed
Cyclomatic Complexity 1 include/linux/random.h:prandom_seed_state
Cyclomatic Complexity 1 drivers/gpu/drm/i915/i915_drv.h:to_i915
Cyclomatic Complexity 1 drivers/gpu/drm/i915/i915_drv.h:mkwrite_device_info
Cyclomatic Complexity 1
drivers/gpu/drm/i915/gem/i915_gem_context.h:i915_gem_context_vm
Cyclomatic Complexity 1
drivers/gpu/drm/i915/gem/i915_gem_context.h:i915_gem_context_engines
Cyclomatic Complexity 1
drivers/gpu/drm/i915/gem/i915_gem_context.h:i915_gem_engines_iter_init
Cyclomatic Complexity 1
drivers/gpu/drm/i915/gem/i915_gem_object.c:gpu_write_needs_clflush
Cyclomatic Complexity 4
drivers/gpu/drm/i915/gem/selftests/huge_pages.c:get_largest_page_size
Cyclomatic Complexity 1 drivers/gpu/drm/i915/gt/intel_ring.h:intel_ring_advance
Cyclomatic Complexity 1
drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c:always_valid
Cyclomatic Complexity 1
drivers/gpu/drm/i915/gem/i915_gem_object.c:i915_global_objects_exit
Cyclomatic Complexity 1
drivers/gpu/drm/i915/gem/i915_gem_object.c:i915_global_objects_shrink
Cyclomatic Complexity 1 include/linux/slab.h:kmem_cache_zalloc
Cyclomatic Complexity 1 include/linux/xarray.h:xa_init_flags
Cyclomatic Complexity 1
drivers/gpu/drm/i915/gem/i915_gem_context.h:i915_gem_context_lock_engines
Cyclomatic Complexity 1
drivers/gpu/drm/i915/gem/i915_gem_context.h:i915_gem_context_unlock_engines
vim +329 drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c
299
300 static int igt_gem_coherency(void *arg)
301 {
302 const unsigned int ncachelines = PAGE_SIZE/64;
303 struct drm_i915_private *i915 = arg;
304 const struct igt_coherency_mode *read, *write, *over;
305 unsigned long count, n;
306 u32 *offsets, *values;
307 I915_RND_STATE(prng);
308 struct context ctx;
309 int err = 0;
310
311 /*
312 * We repeatedly write, overwrite and read from a sequence of
313 * cachelines in order to try and detect incoherency (unflushed writes
314 * from either the CPU or GPU). Each setter/getter uses our cache
315 * domain API which should prevent incoherency.
316 */
317
318 offsets = kmalloc_array(ncachelines, 2*sizeof(u32), GFP_KERNEL);
319 if (!offsets)
320 return -ENOMEM;
321 for (count = 0; count < ncachelines; count++)
322 offsets[count] = count * 64 + 4 * (count % 16);
323
324 values = offsets + ncachelines;
325
326 ctx.engine = random_engine(i915, &prng);
327 GEM_BUG_ON(!ctx.engine);
328 pr_info("%s: using %s\n", __func__, ctx.engine->name);
329 intel_engine_pm_get(ctx.engine);
330
331 for (over = igt_coherency_mode; over->name; over++) {
332 if (!over->set)
333 continue;
334
335 if (!over->valid(&ctx))
336 continue;
337
338 for (write = igt_coherency_mode; write->name; write++) {
339 if (!write->set)
340 continue;
341
342 if (!write->valid(&ctx))
343 continue;
344
345 for (read = igt_coherency_mode; read->name; read++) {
346 if (!read->get)
347 continue;
348
349 if (!read->valid(&ctx))
350 continue;
351
352 for_each_prime_number_from(count, 1, ncachelines) {
353 ctx.obj = i915_gem_object_create_internal(i915, PAGE_SIZE);
354 if (IS_ERR(ctx.obj)) {
355 err = PTR_ERR(ctx.obj);
356 goto free;
357 }
358
359 i915_random_reorder(offsets, ncachelines, &prng);
360 for (n = 0; n < count; n++)
361 values[n] = prandom_u32_state(&prng);
362
363 for (n = 0; n < count; n++) {
364 err = over->set(&ctx, offsets[n], ~values[n]);
365 if (err) {
366 pr_err("Failed to set stale value[%ld/%ld] in object using %s,
err=%d\n",
367 n, count, over->name, err);
368 goto put_object;
369 }
370 }
371
372 for (n = 0; n < count; n++) {
373 err = write->set(&ctx, offsets[n], values[n]);
374 if (err) {
375 pr_err("Failed to set value[%ld/%ld] in object using %s,
err=%d\n",
376 n, count, write->name, err);
377 goto put_object;
378 }
379 }
380
381 for (n = 0; n < count; n++) {
382 u32 found;
383
384 err = read->get(&ctx, offsets[n], &found);
385 if (err) {
386 pr_err("Failed to get value[%ld/%ld] in object using %s,
err=%d\n",
387 n, count, read->name, err);
388 goto put_object;
389 }
390
391 if (found != values[n]) {
392 pr_err("Value[%ld/%ld] mismatch, (overwrite with %s) wrote [%s] %x read
[%s] %x (inverse %x), at offset %x\n",
393 n, count, over->name,
394 write->name, values[n],
395 read->name, found,
396 ~values[n], offsets[n]);
397 err = -EINVAL;
398 goto put_object;
399 }
400 }
401
402 i915_gem_object_put(ctx.obj);
403 }
404 }
405 }
406 }
407 free:
408 intel_engine_pm_put(ctx.engine);
409 kfree(offsets);
410 return err;
411
412 put_object:
413 i915_gem_object_put(ctx.obj);
414 goto free;
415 }
416
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation