arch/sh/include/asm/bitops-op32.h:39:17: sparse: sparse: context imbalance in 'mptcp_sk_clone' - unexpected unlock

From: kernel test robot
Date: Fri Aug 07 2020 - 05:59:00 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 86cfccb66937dd6cbf26ed619958b9e587e6a115
commit: 2c5ebd001d4f0c64a2dfda94eb1d9b31a8863c8d mptcp: refactor token container
date: 6 weeks ago
config: sh-randconfig-s031-20200807 (attached as .config)
compiler: sh4-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.2-118-ge1578773-dirty
git checkout 2c5ebd001d4f0c64a2dfda94eb1d9b31a8863c8d
# 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=sh

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

net/mptcp/protocol.c: note: in included file (through arch/sh/include/asm/bitops.h, include/linux/bitops.h, include/linux/kernel.h):
>> arch/sh/include/asm/bitops-op32.h:39:17: sparse: sparse: context imbalance in 'mptcp_sk_clone' - unexpected unlock

vim +/mptcp_sk_clone +39 arch/sh/include/asm/bitops-op32.h

0d5bbe0bc2583c Paul Mundt 2008-11-25 35
0d5bbe0bc2583c Paul Mundt 2008-11-25 36 static inline void __clear_bit(int nr, volatile unsigned long *addr)
0d5bbe0bc2583c Paul Mundt 2008-11-25 37 {
e3c0f6f3fbdaca Masahiro Yamada 2019-07-23 38 if (__builtin_constant_p(nr)) {
0d5bbe0bc2583c Paul Mundt 2008-11-25 @39 __asm__ __volatile__ (
0d5bbe0bc2583c Paul Mundt 2008-11-25 40 "bclr.b %1, @(%O2,%0) ! __clear_bit\n\t"
0d5bbe0bc2583c Paul Mundt 2008-11-25 41 : "+r" (addr)
0d5bbe0bc2583c Paul Mundt 2008-11-25 42 : "i" (BYTE_OFFSET(nr)),
0d5bbe0bc2583c Paul Mundt 2008-11-25 43 "i" (BYTE_NUMBER(nr))
0d5bbe0bc2583c Paul Mundt 2008-11-25 44 : "t", "memory"
0d5bbe0bc2583c Paul Mundt 2008-11-25 45 );
0d5bbe0bc2583c Paul Mundt 2008-11-25 46 } else {
0d5bbe0bc2583c Paul Mundt 2008-11-25 47 unsigned long mask = BIT_MASK(nr);
0d5bbe0bc2583c Paul Mundt 2008-11-25 48 unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
0d5bbe0bc2583c Paul Mundt 2008-11-25 49
0d5bbe0bc2583c Paul Mundt 2008-11-25 50 *p &= ~mask;
0d5bbe0bc2583c Paul Mundt 2008-11-25 51 }
0d5bbe0bc2583c Paul Mundt 2008-11-25 52 }
0d5bbe0bc2583c Paul Mundt 2008-11-25 53

:::::: The code at line 39 was first introduced by commit
:::::: 0d5bbe0bc2583c4dc06ea00adccf07c3acd1481d sh: Provide optimized non-atomic bitops for SH-2A.

:::::: TO: Paul Mundt <lethal@xxxxxxxxxxxx>
:::::: CC: Paul Mundt <lethal@xxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip