lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202008091008.50Z49Kv2%lkp@intel.com>
Date:   Sun, 9 Aug 2020 10:47:12 +0800
From:   kernel test robot <lkp@...el.com>
To:     Baolin Wang <baolin.wang7@...il.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Bjorn Andersson <bjorn.andersson@...aro.org>
Subject: drivers/hwspinlock/stm32_hwspinlock.c:30:39: sparse: got void

Hi Baolin,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   06a81c1c7db9bd5de0bd38cd5acc44bb22b99150
commit: ffd0bbfb378ecd56eac22bf932ccdbf89ac7f725 hwspinlock: Allow drivers to be built with COMPILE_TEST
date:   5 months ago
config: i386-randconfig-s031-20200809 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-118-ge1578773-dirty
        git checkout ffd0bbfb378ecd56eac22bf932ccdbf89ac7f725
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


sparse warnings: (new ones prefixed by >>)

   drivers/hwspinlock/stm32_hwspinlock.c:30:39: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] <asn:2> *lock_addr @@     got void *priv @@
   drivers/hwspinlock/stm32_hwspinlock.c:30:39: sparse:     expected void [noderef] <asn:2> *lock_addr
>> drivers/hwspinlock/stm32_hwspinlock.c:30:39: sparse:     got void *priv
   drivers/hwspinlock/stm32_hwspinlock.c:41:39: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] <asn:2> *lock_addr @@     got void *priv @@
   drivers/hwspinlock/stm32_hwspinlock.c:41:39: sparse:     expected void [noderef] <asn:2> *lock_addr
   drivers/hwspinlock/stm32_hwspinlock.c:41:39: sparse:     got void *priv
   drivers/hwspinlock/stm32_hwspinlock.c:78:39: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *priv @@     got void [noderef] <asn:2> * @@
>> drivers/hwspinlock/stm32_hwspinlock.c:78:39: sparse:     expected void *priv
   drivers/hwspinlock/stm32_hwspinlock.c:78:39: sparse:     got void [noderef] <asn:2> *
--
   drivers/hwspinlock/sirf_hwspinlock.c:35:39: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] <asn:2> *lock_addr @@     got void *priv @@
   drivers/hwspinlock/sirf_hwspinlock.c:35:39: sparse:     expected void [noderef] <asn:2> *lock_addr
>> drivers/hwspinlock/sirf_hwspinlock.c:35:39: sparse:     got void *priv
   drivers/hwspinlock/sirf_hwspinlock.c:43:39: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] <asn:2> *lock_addr @@     got void *priv @@
   drivers/hwspinlock/sirf_hwspinlock.c:43:39: sparse:     expected void [noderef] <asn:2> *lock_addr
   drivers/hwspinlock/sirf_hwspinlock.c:43:39: sparse:     got void *priv
   drivers/hwspinlock/sirf_hwspinlock.c:77:30: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *priv @@     got void [noderef] <asn:2> * @@
>> drivers/hwspinlock/sirf_hwspinlock.c:77:30: sparse:     expected void *priv
   drivers/hwspinlock/sirf_hwspinlock.c:77:30: sparse:     got void [noderef] <asn:2> *
--
   drivers/hwspinlock/sprd_hwspinlock.c:46:34: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] <asn:2> *addr @@     got void *priv @@
   drivers/hwspinlock/sprd_hwspinlock.c:46:34: sparse:     expected void [noderef] <asn:2> *addr
>> drivers/hwspinlock/sprd_hwspinlock.c:46:34: sparse:     got void *priv
   drivers/hwspinlock/sprd_hwspinlock.c:64:39: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] <asn:2> *lock_addr @@     got void *priv @@
   drivers/hwspinlock/sprd_hwspinlock.c:64:39: sparse:     expected void [noderef] <asn:2> *lock_addr
   drivers/hwspinlock/sprd_hwspinlock.c:64:39: sparse:     got void *priv
   drivers/hwspinlock/sprd_hwspinlock.c:131:28: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *priv @@     got void [noderef] <asn:2> * @@
>> drivers/hwspinlock/sprd_hwspinlock.c:131:28: sparse:     expected void *priv
   drivers/hwspinlock/sprd_hwspinlock.c:131:28: sparse:     got void [noderef] <asn:2> *

vim +30 drivers/hwspinlock/stm32_hwspinlock.c

f24fcff1d267da Benjamin Gaignard 2018-11-14  27  
f24fcff1d267da Benjamin Gaignard 2018-11-14  28  static int stm32_hwspinlock_trylock(struct hwspinlock *lock)
f24fcff1d267da Benjamin Gaignard 2018-11-14  29  {
f24fcff1d267da Benjamin Gaignard 2018-11-14 @30  	void __iomem *lock_addr = lock->priv;
f24fcff1d267da Benjamin Gaignard 2018-11-14  31  	u32 status;
f24fcff1d267da Benjamin Gaignard 2018-11-14  32  
f24fcff1d267da Benjamin Gaignard 2018-11-14  33  	writel(STM32_MUTEX_LOCK_BIT | STM32_MUTEX_COREID, lock_addr);
f24fcff1d267da Benjamin Gaignard 2018-11-14  34  	status = readl(lock_addr);
f24fcff1d267da Benjamin Gaignard 2018-11-14  35  
f24fcff1d267da Benjamin Gaignard 2018-11-14  36  	return status == (STM32_MUTEX_LOCK_BIT | STM32_MUTEX_COREID);
f24fcff1d267da Benjamin Gaignard 2018-11-14  37  }
f24fcff1d267da Benjamin Gaignard 2018-11-14  38  
f24fcff1d267da Benjamin Gaignard 2018-11-14  39  static void stm32_hwspinlock_unlock(struct hwspinlock *lock)
f24fcff1d267da Benjamin Gaignard 2018-11-14  40  {
f24fcff1d267da Benjamin Gaignard 2018-11-14  41  	void __iomem *lock_addr = lock->priv;
f24fcff1d267da Benjamin Gaignard 2018-11-14  42  
f24fcff1d267da Benjamin Gaignard 2018-11-14  43  	writel(STM32_MUTEX_COREID, lock_addr);
f24fcff1d267da Benjamin Gaignard 2018-11-14  44  }
f24fcff1d267da Benjamin Gaignard 2018-11-14  45  
5cd69f13deef80 Fabien Dessenne   2019-03-07  46  static void stm32_hwspinlock_relax(struct hwspinlock *lock)
5cd69f13deef80 Fabien Dessenne   2019-03-07  47  {
5cd69f13deef80 Fabien Dessenne   2019-03-07  48  	ndelay(50);
5cd69f13deef80 Fabien Dessenne   2019-03-07  49  }
5cd69f13deef80 Fabien Dessenne   2019-03-07  50  
f24fcff1d267da Benjamin Gaignard 2018-11-14  51  static const struct hwspinlock_ops stm32_hwspinlock_ops = {
f24fcff1d267da Benjamin Gaignard 2018-11-14  52  	.trylock	= stm32_hwspinlock_trylock,
f24fcff1d267da Benjamin Gaignard 2018-11-14  53  	.unlock		= stm32_hwspinlock_unlock,
5cd69f13deef80 Fabien Dessenne   2019-03-07  54  	.relax		= stm32_hwspinlock_relax,
f24fcff1d267da Benjamin Gaignard 2018-11-14  55  };
f24fcff1d267da Benjamin Gaignard 2018-11-14  56  
f24fcff1d267da Benjamin Gaignard 2018-11-14  57  static int stm32_hwspinlock_probe(struct platform_device *pdev)
f24fcff1d267da Benjamin Gaignard 2018-11-14  58  {
f24fcff1d267da Benjamin Gaignard 2018-11-14  59  	struct stm32_hwspinlock *hw;
f24fcff1d267da Benjamin Gaignard 2018-11-14  60  	void __iomem *io_base;
f24fcff1d267da Benjamin Gaignard 2018-11-14  61  	size_t array_size;
f24fcff1d267da Benjamin Gaignard 2018-11-14  62  	int i, ret;
f24fcff1d267da Benjamin Gaignard 2018-11-14  63  
d4824486b676ef Yangtao Li        2019-12-28  64  	io_base = devm_platform_ioremap_resource(pdev, 0);
4d5a91fd1f42a8 Wei Yongjun       2019-01-03  65  	if (IS_ERR(io_base))
4d5a91fd1f42a8 Wei Yongjun       2019-01-03  66  		return PTR_ERR(io_base);
f24fcff1d267da Benjamin Gaignard 2018-11-14  67  
f24fcff1d267da Benjamin Gaignard 2018-11-14  68  	array_size = STM32_MUTEX_NUM_LOCKS * sizeof(struct hwspinlock);
f24fcff1d267da Benjamin Gaignard 2018-11-14  69  	hw = devm_kzalloc(&pdev->dev, sizeof(*hw) + array_size, GFP_KERNEL);
f24fcff1d267da Benjamin Gaignard 2018-11-14  70  	if (!hw)
f24fcff1d267da Benjamin Gaignard 2018-11-14  71  		return -ENOMEM;
f24fcff1d267da Benjamin Gaignard 2018-11-14  72  
f24fcff1d267da Benjamin Gaignard 2018-11-14  73  	hw->clk = devm_clk_get(&pdev->dev, "hsem");
f24fcff1d267da Benjamin Gaignard 2018-11-14  74  	if (IS_ERR(hw->clk))
f24fcff1d267da Benjamin Gaignard 2018-11-14  75  		return PTR_ERR(hw->clk);
f24fcff1d267da Benjamin Gaignard 2018-11-14  76  
f24fcff1d267da Benjamin Gaignard 2018-11-14  77  	for (i = 0; i < STM32_MUTEX_NUM_LOCKS; i++)
f24fcff1d267da Benjamin Gaignard 2018-11-14 @78  		hw->bank.lock[i].priv = io_base + i * sizeof(u32);
f24fcff1d267da Benjamin Gaignard 2018-11-14  79  
f24fcff1d267da Benjamin Gaignard 2018-11-14  80  	platform_set_drvdata(pdev, hw);
f24fcff1d267da Benjamin Gaignard 2018-11-14  81  	pm_runtime_enable(&pdev->dev);
f24fcff1d267da Benjamin Gaignard 2018-11-14  82  
f24fcff1d267da Benjamin Gaignard 2018-11-14  83  	ret = hwspin_lock_register(&hw->bank, &pdev->dev, &stm32_hwspinlock_ops,
f24fcff1d267da Benjamin Gaignard 2018-11-14  84  				   0, STM32_MUTEX_NUM_LOCKS);
f24fcff1d267da Benjamin Gaignard 2018-11-14  85  
f24fcff1d267da Benjamin Gaignard 2018-11-14  86  	if (ret)
f24fcff1d267da Benjamin Gaignard 2018-11-14  87  		pm_runtime_disable(&pdev->dev);
f24fcff1d267da Benjamin Gaignard 2018-11-14  88  
f24fcff1d267da Benjamin Gaignard 2018-11-14  89  	return ret;
f24fcff1d267da Benjamin Gaignard 2018-11-14  90  }
f24fcff1d267da Benjamin Gaignard 2018-11-14  91  

:::::: The code at line 30 was first introduced by commit
:::::: f24fcff1d267da08c4bbb3869e7f4b36ce916b76 hwspinlock: add STM32 hwspinlock device

:::::: TO: Benjamin Gaignard <benjamin.gaignard@...com>
:::::: CC: Bjorn Andersson <bjorn.andersson@...aro.org>

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

Download attachment ".config.gz" of type "application/gzip" (39715 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ