iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Chunyan Zhang <zhang.lyra@gmail.com>,
	Joerg Roedel <joro@8bytes.org>, Rob Herring <robh+dt@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>
Cc: devicetree@vger.kernel.org, kbuild-all@lists.01.org,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	linux-kernel@vger.kernel.org, Sheng Xu <sheng.xu@unisoc.com>,
	iommu@lists.linux-foundation.org,
	Baolin Wang <baolin.wang7@gmail.com>,
	Orson Zhai <orsonzhai@gmail.com>
Subject: Re: [PATCH v1 2/2] iommu: add Unisoc iommu basic driver
Date: Fri, 22 Jan 2021 02:43:07 +0800	[thread overview]
Message-ID: <202101220249.PoccFdE7-lkp@intel.com> (raw)
In-Reply-To: <20210121112349.421464-3-zhang.lyra@gmail.com>

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

Hi Chunyan,

I love your patch! Yet something to improve:

[auto build test ERROR on robh/for-next]
[also build test ERROR on v5.11-rc4 next-20210121]
[cannot apply to iommu/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/Chunyan-Zhang/Add-Unisoc-iommu-basic-driver/20210121-194023
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.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/891db11d7229149235a02e5bc31a61188243a5d7
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Chunyan-Zhang/Add-Unisoc-iommu-basic-driver/20210121-194023
        git checkout 891db11d7229149235a02e5bc31a61188243a5d7
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc 

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

All errors (new ones prefixed by >>):

   drivers/iommu/sprd-iommu.c: In function 'sprd_iommu_attach_device':
>> drivers/iommu/sprd-iommu.c:248:16: error: implicit declaration of function 'dma_alloc_coherent' [-Werror=implicit-function-declaration]
     248 |  dom->pgt_va = dma_alloc_coherent(sdev->dev, pgt_size, &dom->pgt_pa, GFP_KERNEL);
         |                ^~~~~~~~~~~~~~~~~~
   drivers/iommu/sprd-iommu.c:248:14: warning: assignment to 'u32 *' {aka 'unsigned int *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
     248 |  dom->pgt_va = dma_alloc_coherent(sdev->dev, pgt_size, &dom->pgt_pa, GFP_KERNEL);
         |              ^
   drivers/iommu/sprd-iommu.c: In function 'sprd_iommu_detach_device':
>> drivers/iommu/sprd-iommu.c:270:2: error: implicit declaration of function 'dma_free_coherent' [-Werror=implicit-function-declaration]
     270 |  dma_free_coherent(sdev->dev, pgt_size, dom->pgt_va, dom->pgt_pa);
         |  ^~~~~~~~~~~~~~~~~
   In file included from include/linux/device.h:15,
                    from drivers/iommu/sprd-iommu.c:10:
   drivers/iommu/sprd-iommu.c: In function 'sprd_iommu_map':
   drivers/iommu/sprd-iommu.c:296:27: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
     296 |   dev_err(dom->sdev->dev, "(iova(0x%lx) + sixe(0x%lx)) are not in the range!\n",
         |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
      19 | #define dev_fmt(fmt) fmt
         |                      ^~~
   drivers/iommu/sprd-iommu.c:296:3: note: in expansion of macro 'dev_err'
     296 |   dev_err(dom->sdev->dev, "(iova(0x%lx) + sixe(0x%lx)) are not in the range!\n",
         |   ^~~~~~~
   drivers/iommu/sprd-iommu.c:296:52: note: format string is defined here
     296 |   dev_err(dom->sdev->dev, "(iova(0x%lx) + sixe(0x%lx)) are not in the range!\n",
         |                                                  ~~^
         |                                                    |
         |                                                    long unsigned int
         |                                                  %x
   drivers/iommu/sprd-iommu.c:279:38: warning: variable 'mdata' set but not used [-Wunused-but-set-variable]
     279 |  const struct sprd_iommu_match_data *mdata;
         |                                      ^~~~~
   drivers/iommu/sprd-iommu.c: In function 'sprd_iommu_probe':
   drivers/iommu/sprd-iommu.c:483:21: warning: assignment to 'u32 *' {aka 'unsigned int *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
     483 |  sdev->prot_page_va = dma_alloc_coherent(dev, SPRD_IOMMU_PAGE_SIZE,
         |                     ^
   cc1: some warnings being treated as errors


vim +/dma_alloc_coherent +248 drivers/iommu/sprd-iommu.c

   240	
   241	static int sprd_iommu_attach_device(struct iommu_domain *domain,
   242					    struct device *dev)
   243	{
   244		struct sprd_iommu_device *sdev = dev_iommu_priv_get(dev);
   245		struct sprd_iommu_domain *dom = to_sprd_domain(domain);
   246		size_t pgt_size = sprd_iommu_pgt_size(domain);
   247	
 > 248		dom->pgt_va = dma_alloc_coherent(sdev->dev, pgt_size, &dom->pgt_pa, GFP_KERNEL);
   249		if (!dom->pgt_va)
   250			return -ENOMEM;
   251	
   252		dom->sdev = sdev;
   253	
   254		sprd_iommu_first_ppn(dom);
   255		sprd_iommu_first_vpn(dom);
   256		sprd_iommu_vpn_range(dom);
   257		sprd_iommu_default_ppn(sdev);
   258		sprd_iommu_hw_en(sdev, true);
   259	
   260		return 0;
   261	}
   262	
   263	static void sprd_iommu_detach_device(struct iommu_domain *domain,
   264						     struct device *dev)
   265	{
   266		struct sprd_iommu_domain *dom = to_sprd_domain(domain);
   267		struct sprd_iommu_device *sdev = dom->sdev;
   268		size_t pgt_size = sprd_iommu_pgt_size(domain);
   269	
 > 270		dma_free_coherent(sdev->dev, pgt_size, dom->pgt_va, dom->pgt_pa);
   271		sprd_iommu_hw_en(sdev, false);
   272		dom->sdev = NULL;
   273	}
   274	

---
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: 67242 bytes --]

[-- Attachment #3: Type: text/plain, Size: 156 bytes --]

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  parent reply	other threads:[~2021-01-21 18:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21 11:23 [PATCH v1 0/2] Add Unisoc iommu basic driver Chunyan Zhang
2021-01-21 11:23 ` [PATCH v1 1/2] dt-bindings: iommu: add bindings for sprd iommu Chunyan Zhang
2021-01-21 11:23 ` [PATCH v1 2/2] iommu: add Unisoc iommu basic driver Chunyan Zhang
2021-01-21 15:47   ` kernel test robot
2021-01-21 18:43   ` kernel test robot [this message]
2021-01-21 21:46   ` Robin Murphy
2021-01-27 12:21     ` Chunyan Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202101220249.PoccFdE7-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=baolin.wang7@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=sheng.xu@unisoc.com \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).