2022-11-09 04:06:11

by kernel test robot

[permalink] [raw]
Subject: drivers/remoteproc/st_remoteproc.c:114:20: 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: f141df371335645ce29a87d9683a3f79fba7fd67
commit: d803336abdbc1bfacdb32b2cf9f4fdbee072b8ee ARM: mm: kill unused runtime hook arch_iounmap()
date: 5 months ago
config: arm-randconfig-s051-20221108
compiler: arm-linux-gnueabi-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=d803336abdbc1bfacdb32b2cf9f4fdbee072b8ee
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout d803336abdbc1bfacdb32b2cf9f4fdbee072b8ee
# 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=arm SHELL=/bin/bash drivers/firmware/tegra/ drivers/remoteproc/ drivers/video/fbdev/aty/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>

sparse warnings: (new ones prefixed by >>)
drivers/remoteproc/st_remoteproc.c:98:12: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *va @@ got void [noderef] __iomem * @@
drivers/remoteproc/st_remoteproc.c:98:12: sparse: expected void *va
drivers/remoteproc/st_remoteproc.c:98:12: sparse: got void [noderef] __iomem *
>> drivers/remoteproc/st_remoteproc.c:114:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *io_addr @@ got void *va @@
drivers/remoteproc/st_remoteproc.c:114:20: sparse: expected void volatile [noderef] __iomem *io_addr
drivers/remoteproc/st_remoteproc.c:114:20: sparse: got void *va
--
drivers/video/fbdev/aty/atyfb_base.c:479:9: sparse: sparse: switch with no cases
>> drivers/video/fbdev/aty/atyfb_base.c:3741:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *io_addr @@ got unsigned char [usertype] *addr @@
drivers/video/fbdev/aty/atyfb_base.c:3741:37: sparse: expected void volatile [noderef] __iomem *io_addr
drivers/video/fbdev/aty/atyfb_base.c:3741:37: sparse: got unsigned char [usertype] *addr

vim +114 drivers/remoteproc/st_remoteproc.c

3df52ed7f269a2 Loic Pallardy 2019-01-10 110
3df52ed7f269a2 Loic Pallardy 2019-01-10 111 static int st_rproc_mem_release(struct rproc *rproc,
3df52ed7f269a2 Loic Pallardy 2019-01-10 112 struct rproc_mem_entry *mem)
3df52ed7f269a2 Loic Pallardy 2019-01-10 113 {
3df52ed7f269a2 Loic Pallardy 2019-01-10 @114 iounmap(mem->va);
3df52ed7f269a2 Loic Pallardy 2019-01-10 115
3df52ed7f269a2 Loic Pallardy 2019-01-10 116 return 0;
3df52ed7f269a2 Loic Pallardy 2019-01-10 117 }
3df52ed7f269a2 Loic Pallardy 2019-01-10 118

:::::: The code at line 114 was first introduced by commit
:::::: 3df52ed7f269a25a5f97d6c03887c3ad3d012816 remoteproc: st: add reserved memory support

:::::: TO: Loic Pallardy <[email protected]>
:::::: CC: Bjorn Andersson <[email protected]>

--
0-DAY CI Kernel Test Service
https://01.org/lkp


Attachments:
(No filename) (3.47 kB)
config (175.09 kB)
Download all attachments

2022-11-09 07:55:31

by Arnd Bergmann

[permalink] [raw]
Subject: Re: drivers/remoteproc/st_remoteproc.c:114:20: sparse: sparse: incorrect type in argument 1 (different address spaces)

On Wed, Nov 9, 2022, at 04:54, kernel test robot wrote:
> tree:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> master
> head: f141df371335645ce29a87d9683a3f79fba7fd67
> commit: d803336abdbc1bfacdb32b2cf9f4fdbee072b8ee ARM: mm: kill unused
> runtime hook arch_iounmap()

Thanks for the report, but I think it might be better to stop
reporting address space violations from this patch, because it
only started showing existing known issues with a slightly
different error message, or flagging issues on arm32 that
were previously shown on other architectures.

> sparse warnings: (new ones prefixed by >>)
> drivers/remoteproc/st_remoteproc.c:98:12: sparse: sparse: incorrect
> type in assignment (different address spaces) @@ expected void *va
> @@ got void [noderef] __iomem * @@
> drivers/remoteproc/st_remoteproc.c:98:12: sparse: expected void
> *va
> drivers/remoteproc/st_remoteproc.c:98:12: sparse: got void
> [noderef] __iomem *
>>> drivers/remoteproc/st_remoteproc.c:114:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *io_addr @@ got void *va @@

Arnd

2022-11-09 08:18:31

by Chen, Rong A

[permalink] [raw]
Subject: Re: drivers/remoteproc/st_remoteproc.c:114:20: sparse: sparse: incorrect type in argument 1 (different address spaces)



On 11/9/2022 3:33 PM, Arnd Bergmann wrote:
> On Wed, Nov 9, 2022, at 04:54, kernel test robot wrote:
>> tree:
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>> master
>> head: f141df371335645ce29a87d9683a3f79fba7fd67
>> commit: d803336abdbc1bfacdb32b2cf9f4fdbee072b8ee ARM: mm: kill unused
>> runtime hook arch_iounmap()
>
> Thanks for the report, but I think it might be better to stop
> reporting address space violations from this patch, because it
> only started showing existing known issues with a slightly
> different error message, or flagging issues on arm32 that
> were previously shown on other architectures.

Hi Arnd,

Thanks for your advice, we'll add the commit to ignore list.

Best Regards,
Rong Chen

>
>> sparse warnings: (new ones prefixed by >>)
>> drivers/remoteproc/st_remoteproc.c:98:12: sparse: sparse: incorrect
>> type in assignment (different address spaces) @@ expected void *va
>> @@ got void [noderef] __iomem * @@
>> drivers/remoteproc/st_remoteproc.c:98:12: sparse: expected void
>> *va
>> drivers/remoteproc/st_remoteproc.c:98:12: sparse: got void
>> [noderef] __iomem *
>>>> drivers/remoteproc/st_remoteproc.c:114:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *io_addr @@ got void *va @@
>
> Arnd
>