Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* Re: [PATCH] drm/i915/pmu: Use raw_spin_lock where ever needed in i915 pmu
       [not found] <20251103185141.854074-1-ravi.kumar.vodapalli@intel.com>
@ 2025-11-04 14:06 ` kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-11-04 14:06 UTC (permalink / raw)
  To: Ravi Kumar Vodapalli, intel-gfx
  Cc: llvm, oe-kbuild-all, balasubramani.vivekanandan, matthew.d.roper,
	lucas.demarchi, gustavo.sousa, clinton.a.taylor, matthew.s.atwood,
	dnyaneshwar.bhadane, shekhar.chauhan, Ravi Kumar Vodapalli

Hi Ravi,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on drm-intel/for-linux-next-fixes drm-tip/drm-tip linus/master v6.18-rc4 next-20251104]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ravi-Kumar-Vodapalli/drm-i915-pmu-Use-raw_spin_lock-where-ever-needed-in-i915-pmu/20251104-025356
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
patch link:    https://lore.kernel.org/r/20251103185141.854074-1-ravi.kumar.vodapalli%40intel.com
patch subject: [PATCH] drm/i915/pmu: Use raw_spin_lock where ever needed in i915 pmu
config: x86_64-randconfig-014-20251104 (https://download.01.org/0day-ci/archive/20251104/202511042145.tYp6IjWG-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251104/202511042145.tYp6IjWG-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511042145.tYp6IjWG-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/i915/i915_pmu.c:233:24: error: incompatible pointer types passing 'spinlock_t *' (aka 'struct spinlock *') to parameter of type 'raw_spinlock_t *' (aka 'struct raw_spinlock *') [-Werror,-Wincompatible-pointer-types]
     233 |         raw_spin_lock_irqsave(&pmu->lock, flags);
         |                               ^~~~~~~~~~
   include/linux/spinlock.h:244:34: note: expanded from macro 'raw_spin_lock_irqsave'
     244 |                 flags = _raw_spin_lock_irqsave(lock);   \
         |                                                ^~~~
   include/linux/spinlock_api_smp.h:32:65: note: passing argument to parameter 'lock' here
      32 | unsigned long __lockfunc _raw_spin_lock_irqsave(raw_spinlock_t *lock)
         |                                                                 ^
   drivers/gpu/drm/i915/i915_pmu.c:254:29: error: incompatible pointer types passing 'spinlock_t *' (aka 'struct spinlock *') to parameter of type 'raw_spinlock_t *' (aka 'struct raw_spinlock *') [-Werror,-Wincompatible-pointer-types]
     254 |         raw_spin_unlock_irqrestore(&pmu->lock, flags);
         |                                    ^~~~~~~~~~
   include/linux/spinlock.h:282:31: note: expanded from macro 'raw_spin_unlock_irqrestore'
     282 |                 _raw_spin_unlock_irqrestore(lock, flags);       \
         |                                             ^~~~
   include/linux/spinlock_api_smp.h:43:45: note: passing argument to parameter 'lock' here
      43 | _raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags)
         |                                             ^
   drivers/gpu/drm/i915/i915_pmu.c:305:20: error: incompatible pointer types passing 'spinlock_t *' (aka 'struct spinlock *') to parameter of type 'raw_spinlock_t *' (aka 'struct raw_spinlock *') [-Werror,-Wincompatible-pointer-types]
     305 |         raw_spin_lock_irq(&pmu->lock);
         |                           ^~~~~~~~~~
   include/linux/spinlock.h:274:53: note: expanded from macro 'raw_spin_lock_irq'
     274 | #define raw_spin_lock_irq(lock)         _raw_spin_lock_irq(lock)
         |                                                            ^~~~
   include/linux/spinlock_api_smp.h:29:52: note: passing argument to parameter 'lock' here
      29 | void __lockfunc _raw_spin_lock_irq(raw_spinlock_t *lock)
         |                                                    ^
   drivers/gpu/drm/i915/i915_pmu.c:317:22: error: incompatible pointer types passing 'spinlock_t *' (aka 'struct spinlock *') to parameter of type 'raw_spinlock_t *' (aka 'struct raw_spinlock *') [-Werror,-Wincompatible-pointer-types]
     317 |         raw_spin_unlock_irq(&pmu->lock);
         |                             ^~~~~~~~~~
   include/linux/spinlock.h:277:56: note: expanded from macro 'raw_spin_unlock_irq'
     277 | #define raw_spin_unlock_irq(lock)       _raw_spin_unlock_irq(lock)
         |                                                              ^~~~
   include/linux/spinlock_api_smp.h:41:54: note: passing argument to parameter 'lock' here
      41 | void __lockfunc _raw_spin_unlock_irq(raw_spinlock_t *lock)      __releases(lock);
         |                                                      ^
   drivers/gpu/drm/i915/i915_pmu.c:327:20: error: incompatible pointer types passing 'spinlock_t *' (aka 'struct spinlock *') to parameter of type 'raw_spinlock_t *' (aka 'struct raw_spinlock *') [-Werror,-Wincompatible-pointer-types]
     327 |         raw_spin_lock_irq(&pmu->lock);
         |                           ^~~~~~~~~~
   include/linux/spinlock.h:274:53: note: expanded from macro 'raw_spin_lock_irq'
     274 | #define raw_spin_lock_irq(lock)         _raw_spin_lock_irq(lock)
         |                                                            ^~~~
   include/linux/spinlock_api_smp.h:29:52: note: passing argument to parameter 'lock' here
      29 | void __lockfunc _raw_spin_lock_irq(raw_spinlock_t *lock)
         |                                                    ^
   drivers/gpu/drm/i915/i915_pmu.c:337:22: error: incompatible pointer types passing 'spinlock_t *' (aka 'struct spinlock *') to parameter of type 'raw_spinlock_t *' (aka 'struct raw_spinlock *') [-Werror,-Wincompatible-pointer-types]
     337 |         raw_spin_unlock_irq(&pmu->lock);
         |                             ^~~~~~~~~~
   include/linux/spinlock.h:277:56: note: expanded from macro 'raw_spin_unlock_irq'
     277 | #define raw_spin_unlock_irq(lock)       _raw_spin_unlock_irq(lock)
         |                                                              ^~~~
   include/linux/spinlock_api_smp.h:41:54: note: passing argument to parameter 'lock' here
      41 | void __lockfunc _raw_spin_unlock_irq(raw_spinlock_t *lock)      __releases(lock);
         |                                                      ^
   drivers/gpu/drm/i915/i915_pmu.c:743:24: error: incompatible pointer types passing 'spinlock_t *' (aka 'struct spinlock *') to parameter of type 'raw_spinlock_t *' (aka 'struct raw_spinlock *') [-Werror,-Wincompatible-pointer-types]
     743 |         raw_spin_lock_irqsave(&pmu->lock, flags);
         |                               ^~~~~~~~~~
   include/linux/spinlock.h:244:34: note: expanded from macro 'raw_spin_lock_irqsave'
     244 |                 flags = _raw_spin_lock_irqsave(lock);   \
         |                                                ^~~~
   include/linux/spinlock_api_smp.h:32:65: note: passing argument to parameter 'lock' here
      32 | unsigned long __lockfunc _raw_spin_lock_irqsave(raw_spinlock_t *lock)
         |                                                                 ^
   drivers/gpu/drm/i915/i915_pmu.c:785:29: error: incompatible pointer types passing 'spinlock_t *' (aka 'struct spinlock *') to parameter of type 'raw_spinlock_t *' (aka 'struct raw_spinlock *') [-Werror,-Wincompatible-pointer-types]
     785 |         raw_spin_unlock_irqrestore(&pmu->lock, flags);
         |                                    ^~~~~~~~~~
   include/linux/spinlock.h:282:31: note: expanded from macro 'raw_spin_unlock_irqrestore'
     282 |                 _raw_spin_unlock_irqrestore(lock, flags);       \
         |                                             ^~~~
   include/linux/spinlock_api_smp.h:43:45: note: passing argument to parameter 'lock' here
      43 | _raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags)
         |                                             ^
   drivers/gpu/drm/i915/i915_pmu.c:806:24: error: incompatible pointer types passing 'spinlock_t *' (aka 'struct spinlock *') to parameter of type 'raw_spinlock_t *' (aka 'struct raw_spinlock *') [-Werror,-Wincompatible-pointer-types]
     806 |         raw_spin_lock_irqsave(&pmu->lock, flags);
         |                               ^~~~~~~~~~
   include/linux/spinlock.h:244:34: note: expanded from macro 'raw_spin_lock_irqsave'
     244 |                 flags = _raw_spin_lock_irqsave(lock);   \
         |                                                ^~~~
   include/linux/spinlock_api_smp.h:32:65: note: passing argument to parameter 'lock' here
      32 | unsigned long __lockfunc _raw_spin_lock_irqsave(raw_spinlock_t *lock)
         |                                                                 ^
   drivers/gpu/drm/i915/i915_pmu.c:839:29: error: incompatible pointer types passing 'spinlock_t *' (aka 'struct spinlock *') to parameter of type 'raw_spinlock_t *' (aka 'struct raw_spinlock *') [-Werror,-Wincompatible-pointer-types]
     839 |         raw_spin_unlock_irqrestore(&pmu->lock, flags);
         |                                    ^~~~~~~~~~
   include/linux/spinlock.h:282:31: note: expanded from macro 'raw_spin_unlock_irqrestore'
     282 |                 _raw_spin_unlock_irqrestore(lock, flags);       \
         |                                             ^~~~
   include/linux/spinlock_api_smp.h:43:45: note: passing argument to parameter 'lock' here
      43 | _raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags)
         |                                             ^
   drivers/gpu/drm/i915/i915_pmu.c:1157:2: error: incompatible pointer types passing 'spinlock_t *' (aka 'struct spinlock *') to parameter of type 'raw_spinlock_t *' (aka 'struct raw_spinlock *') [-Werror,-Wincompatible-pointer-types]
    1157 |         raw_spin_lock_init(&pmu->lock);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/spinlock.h:108:23: note: expanded from macro 'raw_spin_lock_init'
     108 |         __raw_spin_lock_init((lock), #lock, &__key, LD_WAIT_SPIN);      \
         |                              ^~~~~~
   include/linux/spinlock.h:101:52: note: passing argument to parameter 'lock' here
     101 |   extern void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name,
         |                                                    ^
   11 errors generated.


vim +233 drivers/gpu/drm/i915/i915_pmu.c

   217	
   218	static u64 get_rc6(struct intel_gt *gt)
   219	{
   220		struct drm_i915_private *i915 = gt->i915;
   221		const unsigned int gt_id = gt->info.id;
   222		struct i915_pmu *pmu = &i915->pmu;
   223		intel_wakeref_t wakeref;
   224		unsigned long flags;
   225		u64 val;
   226	
   227		wakeref = intel_gt_pm_get_if_awake(gt);
   228		if (wakeref) {
   229			val = __get_rc6(gt);
   230			intel_gt_pm_put_async(gt, wakeref);
   231		}
   232	
 > 233		raw_spin_lock_irqsave(&pmu->lock, flags);
   234	
   235		if (wakeref) {
   236			store_sample(pmu, gt_id, __I915_SAMPLE_RC6, val);
   237		} else {
   238			/*
   239			 * We think we are runtime suspended.
   240			 *
   241			 * Report the delta from when the device was suspended to now,
   242			 * on top of the last known real value, as the approximated RC6
   243			 * counter value.
   244			 */
   245			val = ktime_since_raw(pmu->sleep_last[gt_id]);
   246			val += read_sample(pmu, gt_id, __I915_SAMPLE_RC6);
   247		}
   248	
   249		if (val < read_sample(pmu, gt_id, __I915_SAMPLE_RC6_LAST_REPORTED))
   250			val = read_sample(pmu, gt_id, __I915_SAMPLE_RC6_LAST_REPORTED);
   251		else
   252			store_sample(pmu, gt_id, __I915_SAMPLE_RC6_LAST_REPORTED, val);
   253	
   254		raw_spin_unlock_irqrestore(&pmu->lock, flags);
   255	
   256		return val;
   257	}
   258	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

only message in thread, other threads:[~2025-11-04 14:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20251103185141.854074-1-ravi.kumar.vodapalli@intel.com>
2025-11-04 14:06 ` [PATCH] drm/i915/pmu: Use raw_spin_lock where ever needed in i915 pmu kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox