All of lore.kernel.org
 help / color / mirror / Atom feed
* [chrome-os:chromeos-5.4 39/76] drivers/remoteproc/mtk_scp.c:306:17: sparse: sparse: incorrect type in argument 2 (different address spaces)
@ 2020-11-14  6:33 kernel test robot
  2020-11-14  8:02 ` Nicolas Boichat
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2020-11-14  6:33 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 8598 bytes --]

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head:   4e186ff60c11535b22b7f81c85606260e363989f
commit: 0b60154e37d6ff2e12c8fb52d7c715d61fd96a6a [39/76] FROMGIT: remoteproc/mediatek: Add support for mt8192 SCP
config: riscv-randconfig-s031-20201113 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.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.3-107-gaf3512a6-dirty
        git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
        git fetch --no-tags chrome-os chromeos-5.4
        git checkout 0b60154e37d6ff2e12c8fb52d7c715d61fd96a6a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=riscv 

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/mtk_scp.c:306:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] <asn:2> *addr @@     got void *addr @@
>> drivers/remoteproc/mtk_scp.c:306:17: sparse:     expected void volatile [noderef] <asn:2> *addr
   drivers/remoteproc/mtk_scp.c:306:17: sparse:     got void *addr
   drivers/remoteproc/mtk_scp.c:307:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] <asn:2> *addr @@     got void *addr @@
   drivers/remoteproc/mtk_scp.c:307:9: sparse:     expected void volatile [noderef] <asn:2> *addr
   drivers/remoteproc/mtk_scp.c:307:9: sparse:     got void *addr
   drivers/remoteproc/mtk_scp.c:314:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] <asn:2> *addr @@     got void *addr @@
   drivers/remoteproc/mtk_scp.c:314:9: sparse:     expected void volatile [noderef] <asn:2> *addr
   drivers/remoteproc/mtk_scp.c:314:9: sparse:     got void *addr
   drivers/remoteproc/mtk_scp.c:316:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void volatile [noderef] <asn:2> *addr @@     got void *addr @@
   drivers/remoteproc/mtk_scp.c:316:17: sparse:     expected void volatile [noderef] <asn:2> *addr
   drivers/remoteproc/mtk_scp.c:316:17: sparse:     got void *addr
   drivers/remoteproc/mtk_scp.c:326:9: sparse: sparse: undefined identifier 'dsb'
>> drivers/remoteproc/mtk_scp.c:435:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *addr @@     got void [noderef] <asn:2> * @@
   drivers/remoteproc/mtk_scp.c:436:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *addr @@     got void [noderef] <asn:2> * @@
   drivers/remoteproc/mtk_scp.c:437:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *addr @@     got void [noderef] <asn:2> * @@
   drivers/remoteproc/mtk_scp.c:438:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *addr @@     got void [noderef] <asn:2> * @@
   drivers/remoteproc/mtk_scp.c:439:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *addr @@     got void [noderef] <asn:2> * @@
   drivers/remoteproc/mtk_scp.c:563:23: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] <asn:2> *cpu_addr @@     got void * @@
   drivers/remoteproc/mtk_scp.c:576:56: sparse: sparse: incorrect type in argument 3 (different address spaces) @@     expected void *cpu_addr @@     got void [noderef] <asn:2> *cpu_addr @@

vim +306 drivers/remoteproc/mtk_scp.c

   300	
   301	static void mt8192_power_on_sram(void *addr)
   302	{
   303		int i;
   304	
   305		for (i = 31; i >= 0; i--)
 > 306			writel(GENMASK(i, 0), addr);
 > 307		writel(0, addr);
   308	}
   309	
   310	static void mt8192_power_off_sram(void *addr)
   311	{
   312		int i;
   313	
   314		writel(0, addr);
   315		for (i = 0; i < 32; i++)
   316			writel(GENMASK(i, 0), addr);
   317	}
   318	
   319	static int mt8192_scp_before_load(struct mtk_scp *scp)
   320	{
   321		/* clear SPM interrupt, SCP2SPM_IPC_CLR */
   322		writel(0xff, scp->reg_base + MT8192_SCP2SPM_IPC_CLR);
   323	
   324		writel(1, scp->reg_base + MT8192_CORE0_SW_RSTN_SET);
   325	
   326		dsb(sy);
   327	
   328		readl(scp->reg_base + MT8192_CORE0_SW_RSTN_SET);
   329	
   330		/* enable SRAM clock */
   331		mt8192_power_on_sram(scp->reg_base + MT8192_L2TCM_SRAM_PD_0);
   332		mt8192_power_on_sram(scp->reg_base + MT8192_L2TCM_SRAM_PD_1);
   333		mt8192_power_on_sram(scp->reg_base + MT8192_L2TCM_SRAM_PD_2);
   334		mt8192_power_on_sram(scp->reg_base + MT8192_L1TCM_SRAM_PDN);
   335		mt8192_power_on_sram(scp->reg_base + MT8192_CPU0_SRAM_PD);
   336	
   337		return 0;
   338	}
   339	
   340	static int scp_load(struct rproc *rproc, const struct firmware *fw)
   341	{
   342		struct mtk_scp *scp = rproc->priv;
   343		struct device *dev = scp->dev;
   344		int ret;
   345	
   346		ret = clk_prepare_enable(scp->clk);
   347		if (ret) {
   348			dev_err(dev, "failed to enable clocks\n");
   349			return ret;
   350		}
   351	
   352		/* Hold SCP in reset while loading FW. */
   353		scp->data->scp_reset_assert(scp);
   354	
   355		ret = scp->data->scp_before_load(scp);
   356		if (ret < 0)
   357			return ret;
   358	
   359		ret = scp_elf_load_segments(rproc, fw);
   360		clk_disable_unprepare(scp->clk);
   361	
   362		return ret;
   363	}
   364	
   365	static int scp_start(struct rproc *rproc)
   366	{
   367		struct mtk_scp *scp = (struct mtk_scp *)rproc->priv;
   368		struct device *dev = scp->dev;
   369		struct scp_run *run = &scp->run;
   370		int ret;
   371	
   372		ret = clk_prepare_enable(scp->clk);
   373		if (ret) {
   374			dev_err(dev, "failed to enable clocks\n");
   375			return ret;
   376		}
   377	
   378		run->signaled = false;
   379	
   380		scp->data->scp_reset_deassert(scp);
   381	
   382		ret = wait_event_interruptible_timeout(
   383						run->wq,
   384						run->signaled,
   385						msecs_to_jiffies(2000));
   386	
   387		if (ret == 0) {
   388			dev_err(dev, "wait SCP initialization timeout!\n");
   389			ret = -ETIME;
   390			goto stop;
   391		}
   392		if (ret == -ERESTARTSYS) {
   393			dev_err(dev, "wait SCP interrupted by a signal!\n");
   394			goto stop;
   395		}
   396	
   397		clk_disable_unprepare(scp->clk);
   398		dev_info(dev, "SCP is ready. FW version %s\n", run->fw_ver);
   399	
   400		return 0;
   401	
   402	stop:
   403		scp->data->scp_reset_assert(scp);
   404		clk_disable_unprepare(scp->clk);
   405		return ret;
   406	}
   407	
   408	static void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len)
   409	{
   410		struct mtk_scp *scp = (struct mtk_scp *)rproc->priv;
   411		int offset;
   412	
   413		if (da < scp->sram_size) {
   414			offset = da;
   415			if (offset >= 0 && (offset + len) < scp->sram_size)
   416				return (void __force *)scp->sram_base + offset;
   417		} else if (scp->dram_size) {
   418			offset = da - scp->dma_addr;
   419			if (offset >= 0 && (offset + len) < scp->dram_size)
   420				return (void __force *)scp->cpu_addr + offset;
   421		}
   422	
   423		return NULL;
   424	}
   425	
   426	static void mt8183_scp_stop(struct mtk_scp *scp)
   427	{
   428		/* Disable SCP watchdog */
   429		writel(0, scp->reg_base + MT8183_WDT_CFG);
   430	}
   431	
   432	static void mt8192_scp_stop(struct mtk_scp *scp)
   433	{
   434		/* Disable SRAM clock */
 > 435		mt8192_power_off_sram(scp->reg_base + MT8192_L2TCM_SRAM_PD_0);
   436		mt8192_power_off_sram(scp->reg_base + MT8192_L2TCM_SRAM_PD_1);
   437		mt8192_power_off_sram(scp->reg_base + MT8192_L2TCM_SRAM_PD_2);
   438		mt8192_power_off_sram(scp->reg_base + MT8192_L1TCM_SRAM_PDN);
   439		mt8192_power_off_sram(scp->reg_base + MT8192_CPU0_SRAM_PD);
   440	
   441		/* Disable SCP watchdog */
   442		writel(0, scp->reg_base + MT8192_CORE0_WDT_CFG);
   443	}
   444	

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33316 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-16  4:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-14  6:33 [chrome-os:chromeos-5.4 39/76] drivers/remoteproc/mtk_scp.c:306:17: sparse: sparse: incorrect type in argument 2 (different address spaces) kernel test robot
2020-11-14  8:02 ` Nicolas Boichat
2020-11-16  2:34   ` Tzung-Bi Shih
2020-11-16  4:43     ` Tzung-Bi Shih

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.