drivers/remoteproc/ti_k3_r5_remoteproc.c:377:28: sparse: sparse: incorrect type in argument 1 (different address spaces)

From: kernel test robot
Date: Tue Sep 28 2021 - 12:30:30 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0513e464f9007b70b96740271a948ca5ab6e7dd7
commit: 34f2653686fecc9bd5a4ee16724768c72953fb57 remoteproc: k3-r5: Initialize TCM memories for ECC
date: 12 months ago
config: arm64-randconfig-s031-20210928 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.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-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34f2653686fecc9bd5a4ee16724768c72953fb57
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 34f2653686fecc9bd5a4ee16724768c72953fb57
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm64

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


sparse warnings: (new ones prefixed by >>)
>> drivers/remoteproc/ti_k3_r5_remoteproc.c:377:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void * @@ got void [noderef] __iomem *cpu_addr @@
drivers/remoteproc/ti_k3_r5_remoteproc.c:377:28: sparse: expected void *
drivers/remoteproc/ti_k3_r5_remoteproc.c:377:28: sparse: got void [noderef] __iomem *cpu_addr
drivers/remoteproc/ti_k3_r5_remoteproc.c:380:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void * @@ got void [noderef] __iomem *cpu_addr @@
drivers/remoteproc/ti_k3_r5_remoteproc.c:380:28: sparse: expected void *
drivers/remoteproc/ti_k3_r5_remoteproc.c:380:28: sparse: got void [noderef] __iomem *cpu_addr

vim +377 drivers/remoteproc/ti_k3_r5_remoteproc.c

346
347 /*
348 * The R5F cores have controls for both a reset and a halt/run. The code
349 * execution from DDR requires the initial boot-strapping code to be run
350 * from the internal TCMs. This function is used to release the resets on
351 * applicable cores to allow loading into the TCMs. The .prepare() ops is
352 * invoked by remoteproc core before any firmware loading, and is followed
353 * by the .start() ops after loading to actually let the R5 cores run.
354 */
355 static int k3_r5_rproc_prepare(struct rproc *rproc)
356 {
357 struct k3_r5_rproc *kproc = rproc->priv;
358 struct k3_r5_cluster *cluster = kproc->cluster;
359 struct k3_r5_core *core = kproc->core;
360 struct device *dev = kproc->dev;
361 int ret;
362
363 ret = (cluster->mode == CLUSTER_MODE_LOCKSTEP) ?
364 k3_r5_lockstep_release(cluster) : k3_r5_split_release(core);
365 if (ret) {
366 dev_err(dev, "unable to enable cores for TCM loading, ret = %d\n",
367 ret);
368 return ret;
369 }
370
371 /*
372 * Zero out both TCMs unconditionally (access from v8 Arm core is not
373 * affected by ATCM & BTCM enable configuration values) so that ECC
374 * can be effective on all TCM addresses.
375 */
376 dev_dbg(dev, "zeroing out ATCM memory\n");
> 377 memset(core->mem[0].cpu_addr, 0x00, core->mem[0].size);
378
379 dev_dbg(dev, "zeroing out BTCM memory\n");
380 memset(core->mem[1].cpu_addr, 0x00, core->mem[1].size);
381
382 return 0;
383 }
384

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

Attachment: .config.gz
Description: application/gzip