* [linux-next:master 6467/10748] drivers/remoteproc/imx_dsp_rproc.c:602:49: sparse: sparse: incorrect type in argument 2 (different address spaces)
@ 2021-10-24 16:35 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-10-24 16:35 UTC (permalink / raw)
To: Shengjiu Wang; +Cc: kbuild-all, Linux Memory Management List, Mathieu Poirier
[-- Attachment #1: Type: text/plain, Size: 5153 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: cf6c9d12750cf6f3f6aeffcd0bdb36b1ac993f44
commit: ec0e5549f3586d2cb99a05edd006d722ebad912c [6467/10748] remoteproc: imx_dsp_rproc: Add remoteproc driver for DSP on i.MX
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-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/next/linux-next.git/commit/?id=ec0e5549f3586d2cb99a05edd006d722ebad912c
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout ec0e5549f3586d2cb99a05edd006d722ebad912c
# 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=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/remoteproc/imx_dsp_rproc.c:602:49: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *va @@ got void [noderef] __iomem *[assigned] cpu_addr @@
drivers/remoteproc/imx_dsp_rproc.c:602:49: sparse: expected void *va
drivers/remoteproc/imx_dsp_rproc.c:602:49: sparse: got void [noderef] __iomem *[assigned] cpu_addr
drivers/remoteproc/imx_dsp_rproc.c:638:49: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void *va @@ got void [noderef] __iomem *[assigned] cpu_addr @@
drivers/remoteproc/imx_dsp_rproc.c:638:49: sparse: expected void *va
drivers/remoteproc/imx_dsp_rproc.c:638:49: sparse: got void [noderef] __iomem *[assigned] cpu_addr
vim +602 drivers/remoteproc/imx_dsp_rproc.c
563
564 /**
565 * imx_dsp_rproc_add_carveout() - request mailbox channels
566 * @priv: private data pointer
567 *
568 * This function registers specified memory entry in @rproc carveouts list
569 * The carveouts can help to mapping the memory address for DSP.
570 */
571 static int imx_dsp_rproc_add_carveout(struct imx_dsp_rproc *priv)
572 {
573 const struct imx_dsp_rproc_dcfg *dsp_dcfg = priv->dsp_dcfg;
574 const struct imx_rproc_dcfg *dcfg = dsp_dcfg->dcfg;
575 struct rproc *rproc = priv->rproc;
576 struct device *dev = rproc->dev.parent;
577 struct device_node *np = dev->of_node;
578 struct of_phandle_iterator it;
579 struct rproc_mem_entry *mem;
580 struct reserved_mem *rmem;
581 void __iomem *cpu_addr;
582 int a;
583 u64 da;
584
585 /* Remap required addresses */
586 for (a = 0; a < dcfg->att_size; a++) {
587 const struct imx_rproc_att *att = &dcfg->att[a];
588
589 if (!(att->flags & ATT_OWN))
590 continue;
591
592 if (imx_dsp_rproc_sys_to_da(priv, att->sa, att->size, &da))
593 return -EINVAL;
594
595 cpu_addr = devm_ioremap_wc(dev, att->sa, att->size);
596 if (!cpu_addr) {
597 dev_err(dev, "failed to map memory %p\n", &att->sa);
598 return -ENOMEM;
599 }
600
601 /* Register memory region */
> 602 mem = rproc_mem_entry_init(dev, cpu_addr, (dma_addr_t)att->sa,
603 att->size, da, NULL, NULL, "dsp_mem");
604
605 if (mem)
606 rproc_coredump_add_segment(rproc, da, att->size);
607 else
608 return -ENOMEM;
609
610 rproc_add_carveout(rproc, mem);
611 }
612
613 of_phandle_iterator_init(&it, np, "memory-region", NULL, 0);
614 while (of_phandle_iterator_next(&it) == 0) {
615 /*
616 * Ignore the first memory region which will be used vdev buffer.
617 * No need to do extra handlings, rproc_add_virtio_dev will handle it.
618 */
619 if (!strcmp(it.node->name, "vdev0buffer"))
620 continue;
621
622 rmem = of_reserved_mem_lookup(it.node);
623 if (!rmem) {
624 dev_err(dev, "unable to acquire memory-region\n");
625 return -EINVAL;
626 }
627
628 if (imx_dsp_rproc_sys_to_da(priv, rmem->base, rmem->size, &da))
629 return -EINVAL;
630
631 cpu_addr = devm_ioremap_wc(dev, rmem->base, rmem->size);
632 if (!cpu_addr) {
633 dev_err(dev, "failed to map memory %p\n", &rmem->base);
634 return -ENOMEM;
635 }
636
637 /* Register memory region */
638 mem = rproc_mem_entry_init(dev, cpu_addr, (dma_addr_t)rmem->base,
639 rmem->size, da, NULL, NULL, it.node->name);
640
641 if (mem)
642 rproc_coredump_add_segment(rproc, da, rmem->size);
643 else
644 return -ENOMEM;
645
646 rproc_add_carveout(rproc, mem);
647 }
648
649 return 0;
650 }
651
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 79228 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-10-24 16:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-24 16:35 [linux-next:master 6467/10748] drivers/remoteproc/imx_dsp_rproc.c:602:49: sparse: sparse: incorrect type in argument 2 (different address spaces) kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).