Re: [PATCH v3 2/4] remoteproc: Add a remoteproc driver for the MT8183's APU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alexandre,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v5.14-rc6 next-20210819]
[cannot apply to remoteproc/for-next rpmsg/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Alexandre-Bailon/Add-support-of-mt8183-APU/20210819-231419
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/c161c7d11a0fdf701085657c15f949f397ade5be
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alexandre-Bailon/Add-support-of-mt8183-APU/20210819-231419
        git checkout c161c7d11a0fdf701085657c15f949f397ade5be
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arm 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/device.h:15,
                    from include/linux/iommu.h:11,
                    from drivers/remoteproc/mtk_apu.c:10:
   drivers/remoteproc/mtk_apu.c: In function 'mtk_apu_iommu_map':
>> drivers/remoteproc/mtk_apu.c:83:38: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
      83 |                         dev_err(dev, "Unable to map memory region: %pa+%lx\n",
         |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/remoteproc/mtk_apu.c:83:25: note: in expansion of macro 'dev_err'
      83 |                         dev_err(dev, "Unable to map memory region: %pa+%lx\n",
         |                         ^~~~~~~
   drivers/remoteproc/mtk_apu.c:83:74: note: format string is defined here
      83 |                         dev_err(dev, "Unable to map memory region: %pa+%lx\n",
         |                                                                        ~~^
         |                                                                          |
         |                                                                          long unsigned int
         |                                                                        %x


vim +83 drivers/remoteproc/mtk_apu.c

    60	
    61	static int mtk_apu_iommu_map(struct rproc *rproc, struct rproc_mem_entry *entry)
    62	{
    63		struct mtk_apu_rproc *apu_rproc = rproc->priv;
    64		struct device *dev = rproc->dev.parent;
    65		struct rproc_mem_entry *mapping;
    66		struct iommu_domain *domain;
    67		int ret;
    68		u64 pa;
    69	
    70		mapping = kzalloc(sizeof(*mapping), GFP_KERNEL);
    71		if (!mapping)
    72			return -ENOMEM;
    73	
    74		if (!entry->va)
    75			pa = entry->dma;
    76		else
    77			pa = rproc_va_to_pa(entry->va);
    78	
    79		if ((strcmp(entry->name, "vdev0vring0") == 0 ||
    80			strcmp(entry->name, "vdev0vring1") == 0)) {
    81			entry->va = memremap(entry->dma, entry->len, MEMREMAP_WC);
    82			if (IS_ERR_OR_NULL(entry->va)) {
  > 83				dev_err(dev, "Unable to map memory region: %pa+%lx\n",
    84					&entry->dma, entry->len);
    85				ret = PTR_ERR(mapping->va);
    86				goto free_mapping;
    87			}
    88			mapping->va = entry->va;
    89		}
    90	
    91		domain = iommu_get_domain_for_dev(dev);
    92		ret = iommu_map(domain, entry->da, pa, entry->len, entry->flags);
    93		if (ret) {
    94			dev_err(dev, "iommu_map failed: %d\n", ret);
    95			goto err_memunmap;
    96		}
    97	
    98		mapping->da = entry->da;
    99		mapping->len = entry->len;
   100		list_add_tail(&mapping->node, &apu_rproc->mappings);
   101	
   102		return 0;
   103	
   104	err_memunmap:
   105		memunmap(mapping->va);
   106	free_mapping:
   107		kfree(mapping);
   108	
   109		return ret;
   110	}
   111	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux