drivers/remoteproc/qcom_q6v5_pas.c:123:9: sparse: sparse: incorrect type in argument 2 (different address spaces)

From: kernel test robot
Date: Wed Jul 26 2023 - 06:54:09 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 18b44bc5a67275641fb26f2c54ba7eef80ac5950
commit: a376c10d45a8e6ee5ea55791193f90625b35e156 remoteproc: qcom: pas: Adjust the phys addr wrt the mem region
date: 5 months ago
config: arm64-randconfig-r093-20230726 (https://download.01.org/0day-ci/archive/20230726/202307261856.Pu27vw5Y-lkp@xxxxxxxxx/config)
compiler: aarch64-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230726/202307261856.Pu27vw5Y-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307261856.Pu27vw5Y-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> drivers/remoteproc/qcom_q6v5_pas.c:123:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const volatile [noderef] __iomem * @@ got void * @@
drivers/remoteproc/qcom_q6v5_pas.c:123:9: sparse: expected void const volatile [noderef] __iomem *
drivers/remoteproc/qcom_q6v5_pas.c:123:9: sparse: got void *
drivers/remoteproc/qcom_q6v5_pas.c:108:6: sparse: sparse: symbol 'adsp_segment_dump' was not declared. Should it be static?
drivers/remoteproc/qcom_q6v5_pas.c:553:26: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *mem_region @@ got void [noderef] __iomem * @@
drivers/remoteproc/qcom_q6v5_pas.c:553:26: sparse: expected void *mem_region
drivers/remoteproc/qcom_q6v5_pas.c:553:26: sparse: got void [noderef] __iomem *
drivers/remoteproc/qcom_q6v5_pas.c:575:30: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *dtb_mem_region @@ got void [noderef] __iomem * @@
drivers/remoteproc/qcom_q6v5_pas.c:575:30: sparse: expected void *dtb_mem_region
drivers/remoteproc/qcom_q6v5_pas.c:575:30: sparse: got void [noderef] __iomem *

vim +123 drivers/remoteproc/qcom_q6v5_pas.c

107
108 void adsp_segment_dump(struct rproc *rproc, struct rproc_dump_segment *segment,
109 void *dest, size_t offset, size_t size)
110 {
111 struct qcom_adsp *adsp = rproc->priv;
112 int total_offset;
113
114 total_offset = segment->da + segment->offset + offset - adsp->mem_phys;
115 if (total_offset < 0 || total_offset + size > adsp->mem_size) {
116 dev_err(adsp->dev,
117 "invalid copy request for segment %pad with offset %zu and size %zu)\n",
118 &segment->da, offset, size);
119 memset(dest, 0xff, size);
120 return;
121 }
122
> 123 memcpy_fromio(dest, adsp->mem_region + total_offset, size);
124 }
125

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