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: <202304020444.8cPZT2Bi-lkp@intel.com>
Date:   Sun, 2 Apr 2023 04:40:39 +0800
From:   kernel test robot <lkp@...el.com>
To:     Qing Zhang <zhangqing@...ngson.cn>
Cc:     oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Huacai Chen <chenhuacai@...nel.org>
Subject: drivers/soc/qcom/rpmh.c:441:9: sparse: sparse: incorrect type in
 argument 1 (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   93e2b01740863cf2f4a58887ac1384e6324b50a2
commit: 93a4fa622eb061f75f87f0cf9609ab4e69c67d01 LoongArch: Add STACKTRACE support
date:   8 months ago
config: loongarch-randconfig-s032-20230402 (https://download.01.org/0day-ci/archive/20230402/202304020444.8cPZT2Bi-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 12.1.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.4-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=93a4fa622eb061f75f87f0cf9609ab4e69c67d01
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 93a4fa622eb061f75f87f0cf9609ab4e69c67d01
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=loongarch olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=loongarch SHELL=/bin/bash drivers/soc/qcom/ mm/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304020444.8cPZT2Bi-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/soc/qcom/rpmh.c:441:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   drivers/soc/qcom/rpmh.c:441:9: sparse:     expected void *ptr
   drivers/soc/qcom/rpmh.c:441:9: sparse:     got unsigned int [noderef] __percpu *
>> drivers/soc/qcom/rpmh.c:441:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   drivers/soc/qcom/rpmh.c:441:9: sparse:     expected void *ptr
   drivers/soc/qcom/rpmh.c:441:9: sparse:     got unsigned int [noderef] __percpu *
>> drivers/soc/qcom/rpmh.c:441:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   drivers/soc/qcom/rpmh.c:441:9: sparse:     expected void *ptr
   drivers/soc/qcom/rpmh.c:441:9: sparse:     got unsigned int [noderef] __percpu *
>> drivers/soc/qcom/rpmh.c:441:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got unsigned int [noderef] __percpu * @@
   drivers/soc/qcom/rpmh.c:441:9: sparse:     expected void *ptr
   drivers/soc/qcom/rpmh.c:441:9: sparse:     got unsigned int [noderef] __percpu *
>> drivers/soc/qcom/rpmh.c:441:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   drivers/soc/qcom/rpmh.c:441:9: sparse:     expected void *ptr
   drivers/soc/qcom/rpmh.c:441:9: sparse:     got int [noderef] __percpu *
>> drivers/soc/qcom/rpmh.c:441:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   drivers/soc/qcom/rpmh.c:441:9: sparse:     expected void *ptr
   drivers/soc/qcom/rpmh.c:441:9: sparse:     got int [noderef] __percpu *
>> drivers/soc/qcom/rpmh.c:441:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   drivers/soc/qcom/rpmh.c:441:9: sparse:     expected void *ptr
   drivers/soc/qcom/rpmh.c:441:9: sparse:     got int [noderef] __percpu *
>> drivers/soc/qcom/rpmh.c:441:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *ptr @@     got int [noderef] __percpu * @@
   drivers/soc/qcom/rpmh.c:441:9: sparse:     expected void *ptr
   drivers/soc/qcom/rpmh.c:441:9: sparse:     got int [noderef] __percpu *

vim +441 drivers/soc/qcom/rpmh.c

600513dfeef33c Lina Iyer        2018-06-20  426  
600513dfeef33c Lina Iyer        2018-06-20  427  /**
985427f997b6a3 Maulik Shah      2020-04-12  428   * rpmh_flush() - Flushes the buffered sleep and wake sets to TCSes
600513dfeef33c Lina Iyer        2018-06-20  429   *
985427f997b6a3 Maulik Shah      2020-04-12  430   * @ctrlr: Controller making request to flush cached data
600513dfeef33c Lina Iyer        2018-06-20  431   *
985427f997b6a3 Maulik Shah      2020-04-12  432   * Return:
985427f997b6a3 Maulik Shah      2020-04-12  433   * * 0          - Success
985427f997b6a3 Maulik Shah      2020-04-12  434   * * Error code - Otherwise
600513dfeef33c Lina Iyer        2018-06-20  435   */
d5e205079c34aa Maulik Shah      2020-02-03  436  int rpmh_flush(struct rpmh_ctrlr *ctrlr)
600513dfeef33c Lina Iyer        2018-06-20  437  {
600513dfeef33c Lina Iyer        2018-06-20  438  	struct cache_req *p;
d2a8cfc6f32026 Douglas Anderson 2020-05-04  439  	int ret = 0;
600513dfeef33c Lina Iyer        2018-06-20  440  
985427f997b6a3 Maulik Shah      2020-04-12 @441  	lockdep_assert_irqs_disabled();
985427f997b6a3 Maulik Shah      2020-04-12  442  
d2a8cfc6f32026 Douglas Anderson 2020-05-04  443  	/*
d2a8cfc6f32026 Douglas Anderson 2020-05-04  444  	 * Currently rpmh_flush() is only called when we think we're running
d2a8cfc6f32026 Douglas Anderson 2020-05-04  445  	 * on the last processor.  If the lock is busy it means another
d2a8cfc6f32026 Douglas Anderson 2020-05-04  446  	 * processor is up and it's better to abort than spin.
d2a8cfc6f32026 Douglas Anderson 2020-05-04  447  	 */
d2a8cfc6f32026 Douglas Anderson 2020-05-04  448  	if (!spin_trylock(&ctrlr->cache_lock))
d2a8cfc6f32026 Douglas Anderson 2020-05-04  449  		return -EBUSY;
d2a8cfc6f32026 Douglas Anderson 2020-05-04  450  
600513dfeef33c Lina Iyer        2018-06-20  451  	if (!ctrlr->dirty) {
600513dfeef33c Lina Iyer        2018-06-20  452  		pr_debug("Skipping flush, TCS has latest data.\n");
d2a8cfc6f32026 Douglas Anderson 2020-05-04  453  		goto exit;
600513dfeef33c Lina Iyer        2018-06-20  454  	}
600513dfeef33c Lina Iyer        2018-06-20  455  
f5ac95f9ca2f43 Maulik Shah      2020-04-12  456  	/* Invalidate the TCSes first to avoid stale data */
881808d0bbf336 Douglas Anderson 2020-04-13  457  	rpmh_rsc_invalidate(ctrlr_to_drv(ctrlr));
f5ac95f9ca2f43 Maulik Shah      2020-04-12  458  
c8790cb6da58d3 Lina Iyer        2018-06-20  459  	/* First flush the cached batch requests */
c8790cb6da58d3 Lina Iyer        2018-06-20  460  	ret = flush_batch(ctrlr);
c8790cb6da58d3 Lina Iyer        2018-06-20  461  	if (ret)
d2a8cfc6f32026 Douglas Anderson 2020-05-04  462  		goto exit;
c8790cb6da58d3 Lina Iyer        2018-06-20  463  
600513dfeef33c Lina Iyer        2018-06-20  464  	list_for_each_entry(p, &ctrlr->cache, list) {
600513dfeef33c Lina Iyer        2018-06-20  465  		if (!is_req_valid(p)) {
600513dfeef33c Lina Iyer        2018-06-20  466  			pr_debug("%s: skipping RPMH req: a:%#x s:%#x w:%#x",
600513dfeef33c Lina Iyer        2018-06-20  467  				 __func__, p->addr, p->sleep_val, p->wake_val);
600513dfeef33c Lina Iyer        2018-06-20  468  			continue;
600513dfeef33c Lina Iyer        2018-06-20  469  		}
d5e205079c34aa Maulik Shah      2020-02-03  470  		ret = send_single(ctrlr, RPMH_SLEEP_STATE, p->addr,
d5e205079c34aa Maulik Shah      2020-02-03  471  				  p->sleep_val);
600513dfeef33c Lina Iyer        2018-06-20  472  		if (ret)
d2a8cfc6f32026 Douglas Anderson 2020-05-04  473  			goto exit;
d5e205079c34aa Maulik Shah      2020-02-03  474  		ret = send_single(ctrlr, RPMH_WAKE_ONLY_STATE, p->addr,
d5e205079c34aa Maulik Shah      2020-02-03  475  				  p->wake_val);
600513dfeef33c Lina Iyer        2018-06-20  476  		if (ret)
d2a8cfc6f32026 Douglas Anderson 2020-05-04  477  			goto exit;
600513dfeef33c Lina Iyer        2018-06-20  478  	}
600513dfeef33c Lina Iyer        2018-06-20  479  
600513dfeef33c Lina Iyer        2018-06-20  480  	ctrlr->dirty = false;
600513dfeef33c Lina Iyer        2018-06-20  481  
d2a8cfc6f32026 Douglas Anderson 2020-05-04  482  exit:
d2a8cfc6f32026 Douglas Anderson 2020-05-04  483  	spin_unlock(&ctrlr->cache_lock);
d2a8cfc6f32026 Douglas Anderson 2020-05-04  484  	return ret;
600513dfeef33c Lina Iyer        2018-06-20  485  }
600513dfeef33c Lina Iyer        2018-06-20  486  

:::::: The code at line 441 was first introduced by commit
:::::: 985427f997b6a31155cce841eb395d43c64771c5 soc: qcom: rpmh: Invoke rpmh_flush() for dirty caches

:::::: TO: Maulik Shah <mkshah@...eaurora.org>
:::::: CC: Bjorn Andersson <bjorn.andersson@...aro.org>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ