public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [boqun:rust-sync 6/10] include/linux/spinlock.h:388:1: warning: raw_spinlock 'lock->.rlock' is still held at the end of function
@ 2026-03-19  9:16 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-03-19  9:16 UTC (permalink / raw)
  To: Boqun Feng; +Cc: llvm, oe-kbuild-all, Lyude Paul

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git rust-sync
head:   754219dea900fe187e29e8b5ff9fa49238e394c7
commit: b5db14c62254a116585d2620ccee08d1613c25e3 [6/10] irq & spin_lock: Add counted interrupt disabling/enabling
config: hexagon-randconfig-001-20260319 (https://download.01.org/0day-ci/archive/20260319/202603191712.uxBdFAep-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 4abb927bacf37f18f6359a41639a6d1b3bffffb5)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260319/202603191712.uxBdFAep-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/202603191712.uxBdFAep-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from crypto/rsa.c:9:
   In file included from include/linux/module.h:18:
   In file included from include/linux/kmod.h:9:
   In file included from include/linux/umh.h:4:
   In file included from include/linux/gfp.h:7:
   In file included from include/linux/mmzone.h:8:
>> include/linux/spinlock.h:388:1: warning: raw_spinlock 'lock->.rlock' is still held at the end of function [-Wthread-safety-analysis]
     388 | }
         | ^
   include/linux/spinlock.h:387:2: note: raw_spinlock acquired here
     387 |         raw_spin_lock_irq_disable(&lock->rlock);
         |         ^
   include/linux/spinlock.h:277:41: note: expanded from macro 'raw_spin_lock_irq_disable'
     277 | #define raw_spin_lock_irq_disable(lock) _raw_spin_lock_irq_disable(lock)
         |                                         ^
   include/linux/spinlock_api_up.h:80:42: note: expanded from macro '_raw_spin_lock_irq_disable'
      80 | #define _raw_spin_lock_irq_disable(lock)        __LOCK_IRQ_DISABLE(lock)
         |                                                 ^
   include/linux/spinlock_api_up.h:46:35: note: expanded from macro '__LOCK_IRQ_DISABLE'
      46 |   do { local_interrupt_disable(); __LOCK(lock, ##__VA_ARGS__); } while (0)
         |                                   ^
   include/linux/spinlock_api_up.h:34:27: note: expanded from macro '__LOCK'
      34 |   do { preempt_disable(); ___LOCK_##__VA_ARGS__(lock); } while (0)
         |                           ^
   include/linux/spinlock_api_up.h:28:8: note: expanded from macro '___LOCK_'
      28 |   do { __acquire(lock); (void)(lock); } while (0)
         |        ^
   include/linux/compiler-context-analysis.h:361:23: note: expanded from macro '__acquire'
     361 | #define __acquire(x)            __acquire_ctx_lock(x)
         |                                 ^
   In file included from crypto/rsa.c:9:
   In file included from include/linux/module.h:18:
   In file included from include/linux/kmod.h:9:
   In file included from include/linux/umh.h:4:
   In file included from include/linux/gfp.h:7:
   In file included from include/linux/mmzone.h:8:
>> include/linux/spinlock.h:422:2: warning: releasing raw_spinlock 'lock->.rlock' that was not held [-Wthread-safety-analysis]
     422 |         raw_spin_unlock_irq_enable(&lock->rlock);
         |         ^
   include/linux/spinlock.h:281:42: note: expanded from macro 'raw_spin_unlock_irq_enable'
     281 | #define raw_spin_unlock_irq_enable(lock)        _raw_spin_unlock_irq_enable(lock)
         |                                                 ^
   include/linux/spinlock_api_up.h:143:43: note: expanded from macro '_raw_spin_unlock_irq_enable'
     143 | #define _raw_spin_unlock_irq_enable(lock)       __UNLOCK_IRQ_ENABLE(lock)
         |                                                 ^
   include/linux/spinlock_api_up.h:68:8: note: expanded from macro '__UNLOCK_IRQ_ENABLE'
      68 |   do { __UNLOCK(lock, ##__VA_ARGS__); local_interrupt_enable(); } while (0)
         |        ^
   include/linux/spinlock_api_up.h:55:26: note: expanded from macro '__UNLOCK'
      55 |   do { preempt_enable(); ___UNLOCK_##__VA_ARGS__(lock); } while (0)
         |                          ^
   include/linux/spinlock_api_up.h:49:8: note: expanded from macro '___UNLOCK_'
      49 |   do { __release(lock); (void)(lock); } while (0)
         |        ^
   include/linux/compiler-context-analysis.h:369:23: note: expanded from macro '__release'
     369 | #define __release(x)            __release_ctx_lock(x)
         |                                 ^
   2 warnings generated.


vim +388 include/linux/spinlock.h

   384	
   385	static __always_inline void spin_lock_irq_disable(spinlock_t *lock)
   386	{
   387		raw_spin_lock_irq_disable(&lock->rlock);
 > 388	}
   389	
   390	#define spin_lock_irqsave(lock, flags)				\
   391	do {								\
   392		raw_spin_lock_irqsave(spinlock_check(lock), flags);	\
   393		__release(spinlock_check(lock)); __acquire(lock);	\
   394	} while (0)
   395	
   396	#define spin_lock_irqsave_nested(lock, flags, subclass)			\
   397	do {									\
   398		raw_spin_lock_irqsave_nested(spinlock_check(lock), flags, subclass); \
   399		__release(spinlock_check(lock)); __acquire(lock);		\
   400	} while (0)
   401	
   402	static __always_inline void spin_unlock(spinlock_t *lock)
   403		__releases(lock) __no_context_analysis
   404	{
   405		raw_spin_unlock(&lock->rlock);
   406	}
   407	
   408	static __always_inline void spin_unlock_bh(spinlock_t *lock)
   409		__releases(lock) __no_context_analysis
   410	{
   411		raw_spin_unlock_bh(&lock->rlock);
   412	}
   413	
   414	static __always_inline void spin_unlock_irq(spinlock_t *lock)
   415		__releases(lock) __no_context_analysis
   416	{
   417		raw_spin_unlock_irq(&lock->rlock);
   418	}
   419	
   420	static __always_inline void spin_unlock_irq_enable(spinlock_t *lock)
   421	{
 > 422		raw_spin_unlock_irq_enable(&lock->rlock);
   423	}
   424	

-- 
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:[~2026-03-19  9:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-19  9:16 [boqun:rust-sync 6/10] include/linux/spinlock.h:388:1: warning: raw_spinlock 'lock->.rlock' is still held at the end of function 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