CC: [email protected]
CC: [email protected]
TO: Will Deacon <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   61556703b610a104de324e4f061dc6cf7b218b46
commit: dee081bf8f824cabeb7c7495367d5dad0a444eb1 READ_ONCE: Drop pointer 
qualifiers when reading from scalar types
date:   10 months ago
:::::: branch date: 3 days ago
:::::: commit date: 10 months ago
config: microblaze-randconfig-s032-20210207 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce:
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-215-g0fb77bb6-dirty
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dee081bf8f824cabeb7c7495367d5dad0a444eb1
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout dee081bf8f824cabeb7c7495367d5dad0a444eb1
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=microblaze 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


"sparse warnings: (new ones prefixed by >>)"
   drivers/block/zram/zram_drv.c: note: in included file (through 
include/linux/list_bl.h, include/linux/rculist_bl.h, include/linux/dcache.h, 
...):
   include/linux/bit_spinlock.h:41:19: sparse: sparse: context imbalance in 
'zram_slot_trylock' - different lock contexts for basic block
   drivers/block/zram/zram_drv.c: note: in included file (through 
include/asm-generic/bitops.h, arch/microblaze/include/generated/asm/bitops.h, 
include/linux/bitops.h, ...):
>> include/asm-generic/bitops/lock.h:28:43: sparse: sparse: context imbalance 
>> in 'zram_slot_lock' - wrong count at exit
   drivers/block/zram/zram_drv.c: note: in included file (through 
include/linux/list_bl.h, include/linux/rculist_bl.h, include/linux/dcache.h, 
...):
   include/linux/bit_spinlock.h:63:25: sparse: sparse: context imbalance in 
'zram_slot_unlock' - unexpected unlock

vim +/zram_slot_lock +28 include/asm-generic/bitops/lock.h

84c6591103dbea Will Deacon 2018-06-19   8  
26333576fd0d0b Nick Piggin 2007-10-18   9  /**
26333576fd0d0b Nick Piggin 2007-10-18  10   * test_and_set_bit_lock - Set a bit 
and return its old value, for lock
26333576fd0d0b Nick Piggin 2007-10-18  11   * @nr: Bit to set
26333576fd0d0b Nick Piggin 2007-10-18  12   * @addr: Address to count from
26333576fd0d0b Nick Piggin 2007-10-18  13   *
61e02392d3c7ec Will Deacon 2018-02-13  14   * This operation is atomic and 
provides acquire barrier semantics if
61e02392d3c7ec Will Deacon 2018-02-13  15   * the returned value is 0.
26333576fd0d0b Nick Piggin 2007-10-18  16   * It can be used to implement bit 
locks.
26333576fd0d0b Nick Piggin 2007-10-18  17   */
84c6591103dbea Will Deacon 2018-06-19  18  static inline int 
test_and_set_bit_lock(unsigned int nr,
84c6591103dbea Will Deacon 2018-06-19  19                                       
volatile unsigned long *p)
84c6591103dbea Will Deacon 2018-06-19  20  {
84c6591103dbea Will Deacon 2018-06-19  21       long old;
84c6591103dbea Will Deacon 2018-06-19  22       unsigned long mask = 
BIT_MASK(nr);
84c6591103dbea Will Deacon 2018-06-19  23  
84c6591103dbea Will Deacon 2018-06-19  24       p += BIT_WORD(nr);
84c6591103dbea Will Deacon 2018-06-19  25       if (READ_ONCE(*p) & mask)
84c6591103dbea Will Deacon 2018-06-19  26               return 1;
84c6591103dbea Will Deacon 2018-06-19  27  
84c6591103dbea Will Deacon 2018-06-19 @28       old = 
atomic_long_fetch_or_acquire(mask, (atomic_long_t *)p);
84c6591103dbea Will Deacon 2018-06-19  29       return !!(old & mask);
84c6591103dbea Will Deacon 2018-06-19  30  }
84c6591103dbea Will Deacon 2018-06-19  31  

:::::: The code at line 28 was first introduced by commit
:::::: 84c6591103dbeaf393a092a3fc7b09510825f6b9 locking/atomics, 
asm-generic/bitops/lock.h: Rewrite using atomic_fetch_*()

:::::: TO: Will Deacon <[email protected]>
:::::: CC: Ingo Molnar <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to