All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [linux-rt-devel:linux-5.9.y-rt 190/208] arch/powerpc/platforms/pseries/iommu.c:181:8: error: type defaults to 'int' in declaration of 'DEFINE_LOCAL_IRQ_LOCK'
Date: Thu, 03 Sep 2020 10:18:50 +0800	[thread overview]
Message-ID: <202009031044.f65cd7bE%lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-5.9.y-rt
head:   60090a4baeb08367272c3c236824887619dce3f7
commit: da1874b9fde1c352fac21ba0214aaff2cb226e37 [190/208] powerpc/pseries/iommu: Use a locallock instead local_irq_save()
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-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
        git checkout da1874b9fde1c352fac21ba0214aaff2cb226e37
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc 

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 >>):

>> arch/powerpc/platforms/pseries/iommu.c:181:8: error: type defaults to 'int' in declaration of 'DEFINE_LOCAL_IRQ_LOCK' [-Werror=implicit-int]
     181 | static DEFINE_LOCAL_IRQ_LOCK(tcp_page_lock);
         |        ^~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/platforms/pseries/iommu.c:181:1: warning: parameter names (without types) in function declaration
     181 | static DEFINE_LOCAL_IRQ_LOCK(tcp_page_lock);
         | ^~~~~~
   In file included from include/asm-generic/percpu.h:7,
                    from arch/powerpc/include/asm/percpu.h:18,
                    from include/linux/irqflags.h:17,
                    from include/linux/spinlock.h:54,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:6,
                    from include/linux/slab.h:15,
                    from arch/powerpc/platforms/pseries/iommu.c:15:
   arch/powerpc/platforms/pseries/iommu.c: In function 'tce_buildmulti_pSeriesLP':
>> arch/powerpc/platforms/pseries/iommu.c:204:21: error: 'tcp_page_lock' undeclared (first use in this function)
     204 |  local_lock_irqsave(tcp_page_lock, flags);
         |                     ^~~~~~~~~~~~~
   include/linux/percpu-defs.h:219:47: note: in definition of macro '__verify_pcpu_ptr'
     219 |  const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
         |                                               ^~~
   include/linux/percpu-defs.h:252:27: note: in expansion of macro 'raw_cpu_ptr'
     252 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr)
         |                           ^~~~~~~~~~~
   include/linux/local_lock_internal.h:163:22: note: in expansion of macro 'this_cpu_ptr'
     163 |   local_lock_acquire(this_cpu_ptr(lock));  \
         |                      ^~~~~~~~~~~~
   include/linux/local_lock.h:31:2: note: in expansion of macro '__local_lock_irqsave'
      31 |  __local_lock_irqsave(lock, flags)
         |  ^~~~~~~~~~~~~~~~~~~~
   arch/powerpc/platforms/pseries/iommu.c:204:2: note: in expansion of macro 'local_lock_irqsave'
     204 |  local_lock_irqsave(tcp_page_lock, flags);
         |  ^~~~~~~~~~~~~~~~~~
   arch/powerpc/platforms/pseries/iommu.c:204:21: note: each undeclared identifier is reported only once for each function it appears in
     204 |  local_lock_irqsave(tcp_page_lock, flags);
         |                     ^~~~~~~~~~~~~
   include/linux/percpu-defs.h:219:47: note: in definition of macro '__verify_pcpu_ptr'
     219 |  const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
         |                                               ^~~
   include/linux/percpu-defs.h:252:27: note: in expansion of macro 'raw_cpu_ptr'
     252 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr)
         |                           ^~~~~~~~~~~
   include/linux/local_lock_internal.h:163:22: note: in expansion of macro 'this_cpu_ptr'
     163 |   local_lock_acquire(this_cpu_ptr(lock));  \
         |                      ^~~~~~~~~~~~
   include/linux/local_lock.h:31:2: note: in expansion of macro '__local_lock_irqsave'
      31 |  __local_lock_irqsave(lock, flags)
         |  ^~~~~~~~~~~~~~~~~~~~
   arch/powerpc/platforms/pseries/iommu.c:204:2: note: in expansion of macro 'local_lock_irqsave'
     204 |  local_lock_irqsave(tcp_page_lock, flags);
         |  ^~~~~~~~~~~~~~~~~~
   arch/powerpc/platforms/pseries/iommu.c: In function 'tce_setrange_multi_pSeriesLP':
   arch/powerpc/platforms/pseries/iommu.c:422:17: error: 'tcp_page_lock' undeclared (first use in this function)
     422 |  local_lock_irq(tcp_page_lock);
         |                 ^~~~~~~~~~~~~
   include/linux/percpu-defs.h:219:47: note: in definition of macro '__verify_pcpu_ptr'
     219 |  const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
         |                                               ^~~
   include/linux/percpu-defs.h:252:27: note: in expansion of macro 'raw_cpu_ptr'
     252 | #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr)
         |                           ^~~~~~~~~~~
   include/linux/local_lock_internal.h:157:22: note: in expansion of macro 'this_cpu_ptr'
     157 |   local_lock_acquire(this_cpu_ptr(lock));  \
         |                      ^~~~~~~~~~~~
   include/linux/local_lock.h:22:31: note: in expansion of macro '__local_lock_irq'
      22 | #define local_lock_irq(lock)  __local_lock_irq(lock)
         |                               ^~~~~~~~~~~~~~~~
   arch/powerpc/platforms/pseries/iommu.c:422:2: note: in expansion of macro 'local_lock_irq'
     422 |  local_lock_irq(tcp_page_lock);
         |  ^~~~~~~~~~~~~~
   arch/powerpc/platforms/pseries/iommu.c: At top level:
   arch/powerpc/platforms/pseries/iommu.c:181:8: warning: 'DEFINE_LOCAL_IRQ_LOCK' declared 'static' but never defined [-Wunused-function]
     181 | static DEFINE_LOCAL_IRQ_LOCK(tcp_page_lock);
         |        ^~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

# https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/commit/?id=da1874b9fde1c352fac21ba0214aaff2cb226e37
git remote add linux-rt-devel https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
git fetch --no-tags linux-rt-devel linux-5.9.y-rt
git checkout da1874b9fde1c352fac21ba0214aaff2cb226e37
vim +181 arch/powerpc/platforms/pseries/iommu.c

   179	
   180	static DEFINE_PER_CPU(__be64 *, tce_page);
 > 181	static DEFINE_LOCAL_IRQ_LOCK(tcp_page_lock);
   182	
   183	static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
   184					     long npages, unsigned long uaddr,
   185					     enum dma_data_direction direction,
   186					     unsigned long attrs)
   187	{
   188		u64 rc = 0;
   189		u64 proto_tce;
   190		__be64 *tcep;
   191		u64 rpn;
   192		long l, limit;
   193		long tcenum_start = tcenum, npages_start = npages;
   194		int ret = 0;
   195		unsigned long flags;
   196	
   197		if ((npages == 1) || !firmware_has_feature(FW_FEATURE_PUT_TCE_IND)) {
   198			return tce_build_pSeriesLP(tbl->it_index, tcenum,
   199						   tbl->it_page_shift, npages, uaddr,
   200			                           direction, attrs);
   201		}
   202	
   203		/* to protect tcep and the page behind it */
 > 204		local_lock_irqsave(tcp_page_lock, flags);
   205	
   206		tcep = __this_cpu_read(tce_page);
   207	
   208		/* This is safe to do since interrupts are off when we're called
   209		 * from iommu_alloc{,_sg}()
   210		 */
   211		if (!tcep) {
   212			tcep = (__be64 *)__get_free_page(GFP_ATOMIC);
   213			/* If allocation fails, fall back to the loop implementation */
   214			if (!tcep) {
   215				local_unlock_irqrestore(tcp_page_lock, flags);
   216				return tce_build_pSeriesLP(tbl->it_index, tcenum,
   217						tbl->it_page_shift,
   218						npages, uaddr, direction, attrs);
   219			}
   220			__this_cpu_write(tce_page, tcep);
   221		}
   222	
   223		rpn = __pa(uaddr) >> TCE_SHIFT;
   224		proto_tce = TCE_PCI_READ;
   225		if (direction != DMA_TO_DEVICE)
   226			proto_tce |= TCE_PCI_WRITE;
   227	
   228		/* We can map max one pageful of TCEs at a time */
   229		do {
   230			/*
   231			 * Set up the page with TCE data, looping through and setting
   232			 * the values.
   233			 */
   234			limit = min_t(long, npages, 4096/TCE_ENTRY_SIZE);
   235	
   236			for (l = 0; l < limit; l++) {
   237				tcep[l] = cpu_to_be64(proto_tce | (rpn & TCE_RPN_MASK) << TCE_RPN_SHIFT);
   238				rpn++;
   239			}
   240	
   241			rc = plpar_tce_put_indirect((u64)tbl->it_index,
   242						    (u64)tcenum << 12,
   243						    (u64)__pa(tcep),
   244						    limit);
   245	
   246			npages -= limit;
   247			tcenum += limit;
   248		} while (npages > 0 && !rc);
   249	
   250		local_unlock_irqrestore(tcp_page_lock, flags);
   251	
   252		if (unlikely(rc == H_NOT_ENOUGH_RESOURCES)) {
   253			ret = (int)rc;
   254			tce_freemulti_pSeriesLP(tbl, tcenum_start,
   255			                        (npages_start - (npages + limit)));
   256			return ret;
   257		}
   258	
   259		if (rc && printk_ratelimit()) {
   260			printk("tce_buildmulti_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
   261			printk("\tindex   = 0x%llx\n", (u64)tbl->it_index);
   262			printk("\tnpages  = 0x%llx\n", (u64)npages);
   263			printk("\ttce[0] val = 0x%llx\n", tcep[0]);
   264			dump_stack();
   265		}
   266		return ret;
   267	}
   268	

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

                 reply	other threads:[~2020-09-03  2:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202009031044.f65cd7bE%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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 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.