All of lore.kernel.org
 help / color / mirror / Atom feed
* [mlankhorst:locking-rework 12/13] drivers/gpu//drm/i915/gt/intel_context.c:160:18: error: unused variable 'wakeref'
@ 2020-01-11  7:30 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-01-11  7:30 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 10977 bytes --]

tree:   git://people.freedesktop.org/~mlankhorst/linux locking-rework
head:   9f6ac3cc57cdcc31f3dad6a029e3a09464d47a67
commit: 86a14abed82268eea85e489e1ced64211d567f07 [12/13] drm/i915: Rework intel_context pinning to do everything outside of pin_mutex
config: x86_64-randconfig-s1-20200111 (attached as .config)
compiler: gcc-7 (Debian 7.5.0-3) 7.5.0
reproduce:
        git checkout 86a14abed82268eea85e489e1ced64211d567f07
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/gpu//drm/i915/gt/intel_context.c: In function '__intel_context_do_pin':
>> drivers/gpu//drm/i915/gt/intel_context.c:160:18: error: unused variable 'wakeref' [-Werror=unused-variable]
     intel_wakeref_t wakeref;
                     ^~~~~~~
   Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
   Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
   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 1 arch/x86/include/asm/atomic.h:arch_atomic_fetch_add
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_fetch_sub
   Cyclomatic Complexity 2 arch/x86/include/asm/atomic.h:arch_atomic_try_cmpxchg
   Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:arch_set_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 include/linux/list.h:INIT_LIST_HEAD
   Cyclomatic Complexity 1 include/linux/list.h:list_empty
   Cyclomatic Complexity 3 include/linux/string.h:memset
   Cyclomatic Complexity 3 include/linux/string.h:memchr_inv
   Cyclomatic Complexity 1 include/linux/err.h:ERR_PTR
   Cyclomatic Complexity 1 include/linux/err.h:PTR_ERR
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/intel_wakeref.h:intel_wakeref_is_active
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/i915_request.h:to_request
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/i915_active.h:i915_active_fini
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_context.h:__intel_context_ring_size
   Cyclomatic Complexity 1 include/drm/drm_print.h:drm_debug_printer
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_gtt.h:i915_vm_to_ggtt
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/i915_vma.h:i915_ggtt_pin_bias
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/i915_drv.h:i915_coherent_map_type
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_engine_pm.h:intel_engine_pm_is_awake
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_context.c:i915_global_context_exit
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_context.c:i915_global_context_shrink
   Cyclomatic Complexity 1 include/linux/slab.h:kmem_cache_zalloc
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_context.c:intel_context_alloc
   Cyclomatic Complexity 1 include/linux/err.h:IS_ERR
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_read
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/i915_active.h:i915_active_is_idle
   Cyclomatic Complexity 2 include/asm-generic/bitops/instrumented-non-atomic.h:test_bit
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_context.h:intel_context_is_barrier
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_reset.h:__intel_reset_failed
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_gt.h:intel_gt_is_wedged
   Cyclomatic Complexity 1 include/asm-generic/bitops/instrumented-atomic.h:set_bit
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_inc
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/i915_vma.h:__i915_vma_pin
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_dec
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/i915_vma.h:__i915_vma_unpin
   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 include/asm-generic/atomic-instrumented.h:atomic_dec_and_test
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_fetch_add
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_fetch_sub
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_set
   Cyclomatic Complexity 1 include/linux/refcount.h:refcount_set
   Cyclomatic Complexity 1 include/linux/kref.h:kref_init
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_try_cmpxchg
   Cyclomatic Complexity 3 include/linux/atomic-fallback.h:atomic_fetch_add_unless
   Cyclomatic Complexity 1 include/linux/atomic-fallback.h:atomic_add_unless
   Cyclomatic Complexity 1 include/linux/atomic-fallback.h:atomic_inc_not_zero
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_context.h:intel_context_pin_if_active
   Cyclomatic Complexity 2 drivers/gpu//drm/i915/gt/intel_context.c:__context_pin_state
   Cyclomatic Complexity 5 drivers/gpu//drm/i915/gt/intel_context.c:intel_context_pre_pin
   Cyclomatic Complexity 4 drivers/gpu//drm/i915/gt/intel_context.c:intel_context_active_acquire
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_context.c:intel_context_active_release
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_context.c:__context_unpin_state
   Cyclomatic Complexity 2 drivers/gpu//drm/i915/gt/intel_context.c:intel_context_post_unpin
   Cyclomatic Complexity 4 include/linux/refcount.h:refcount_add
   Cyclomatic Complexity 1 include/linux/refcount.h:refcount_inc
   Cyclomatic Complexity 1 include/linux/kref.h:kref_get
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_context.h:intel_context_get
   Cyclomatic Complexity 2 drivers/gpu//drm/i915/gt/intel_context.c:__intel_context_active
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_gtt.h:i915_vm_get
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_timeline.h:intel_timeline_get
   Cyclomatic Complexity 2 include/linux/dma-fence.h:dma_fence_get
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/i915_request.h:i915_request_get
   Cyclomatic Complexity 4 include/linux/refcount.h:refcount_sub_and_test
   Cyclomatic Complexity 1 include/linux/refcount.h:refcount_dec_and_test
   Cyclomatic Complexity 2 include/linux/kref.h:kref_put
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_context.h:intel_context_put
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_context.c:__intel_context_retire
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_timeline.h:intel_timeline_put
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_gtt.h:i915_vm_put
   Cyclomatic Complexity 2 include/linux/dma-fence.h:dma_fence_put
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/i915_request.h:i915_request_put
   Cyclomatic Complexity 2 drivers/gpu//drm/i915/intel_wakeref.h:intel_wakeref_get
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_engine_pm.h:intel_engine_pm_get
   Cyclomatic Complexity 2 drivers/gpu//drm/i915/intel_wakeref.h:__intel_wakeref_put
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/intel_wakeref.h:intel_wakeref_put
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_engine_pm.h:intel_engine_pm_put
   Cyclomatic Complexity 1 include/linux/lockdep.h:lock_is_held
   Cyclomatic Complexity 4 drivers/gpu//drm/i915/i915_request.h:i915_request_timeline
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/i915_active.h:i915_active_add_request
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_engine_pm.h:intel_engine_create_kernel_request
   Cyclomatic Complexity 2 drivers/gpu//drm/i915/gt/selftest_context.c:request_sync
   Cyclomatic Complexity 4 drivers/gpu//drm/i915/gt/selftest_context.c:context_sync
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/intel_wakeref.h:intel_wakeref_unlock_wait
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_engine_pm.h:intel_engine_pm_flush
   Cyclomatic Complexity 1 drivers/gpu//drm/i915/gt/intel_context.c:intel_context_free
   Cyclomatic Complexity 4 drivers/gpu//drm/i915/gt/intel_context.c:intel_context_alloc_state
   Cyclomatic Complexity 10 drivers/gpu//drm/i915/gt/intel_context.c:__intel_context_do_pin

vim +/wakeref +160 drivers/gpu//drm/i915/gt/intel_context.c

   157	
   158	int __intel_context_do_pin(struct intel_context *ce)
   159	{
 > 160		intel_wakeref_t wakeref;
   161		bool handoff = false;
   162		void *vaddr;
   163		int err;
   164	
   165		if (unlikely(!test_bit(CONTEXT_ALLOC_BIT, &ce->flags))) {
   166			err = intel_context_alloc_state(ce);
   167			if (err)
   168				return err;
   169		}
   170	
   171		/*
   172		 * We always pin the context/ring/timeline here, to ensure a pin
   173		 * refcount for __intel_context_active(), which prevent a lock
   174		 * inversion of ce->pin_mutex vs dma_resv_lock().
   175		 */
   176		err = intel_context_pre_pin(ce);
   177		if (err)
   178			goto err_wakeref;
   179	
   180		err = ce->ops->pre_pin(ce, &vaddr);
   181		if (err)
   182			goto err_ctx_unpin;
   183	
   184		err = mutex_lock_interruptible(&ce->pin_mutex);
   185		if (err)
   186			goto err_post_unpin;
   187	
   188		if (likely(!atomic_read(&ce->pin_count))) {
   189			err = intel_context_active_acquire(ce);
   190			if (unlikely(err))
   191				goto err_unlock;
   192	
   193			err = ce->ops->pin(ce, vaddr);
   194			if (err) {
   195				intel_context_active_release(ce);
   196				goto err_unlock;
   197			}
   198	
   199			CE_TRACE(ce, "pin ring:{head:%04x, tail:%04x}\n",
   200				 ce->ring->head, ce->ring->tail);
   201	
   202			handoff = true;
   203			smp_mb__before_atomic(); /* flush pin before it is visible */
   204		}
   205	
   206		atomic_inc(&ce->pin_count);
   207		GEM_BUG_ON(!intel_context_is_pinned(ce)); /* no overflow! */
   208	
   209	err_unlock:
   210		mutex_unlock(&ce->pin_mutex);
   211	err_post_unpin:
   212		if (!handoff)
   213			ce->ops->post_unpin(ce);
   214	err_ctx_unpin:
   215		intel_context_post_unpin(ce);
   216	err_wakeref:
   217		return err;
   218	}
   219	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31257 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-11  7:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-11  7:30 [mlankhorst:locking-rework 12/13] drivers/gpu//drm/i915/gt/intel_context.c:160:18: error: unused variable 'wakeref' kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.