[xlnx:master 133/137] drivers/misc/xilinx-ai-engine/ai-engine-dev.c:517:6: error: redefinition of 'aie_partition_is_available'

kernel test robot lkp at intel.com
Tue Aug 11 12:46:51 EDT 2020


tree:   https://github.com/Xilinx/linux-xlnx master
head:   566441779cdc25e377c2baab9277342b09b4249b
commit: 0687b131fdf966fe718891f1b6cf515fa8d395dd [133/137] misc: xilinx-ai-engine: Add function to enquire if a partition is available
config: alpha-allmodconfig (attached as .config)
compiler: alpha-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 0687b131fdf966fe718891f1b6cf515fa8d395dd
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha 

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

All errors (new ones prefixed by >>):

>> drivers/misc/xilinx-ai-engine/ai-engine-dev.c:517:6: error: redefinition of 'aie_partition_is_available'
     517 | bool aie_partition_is_available(struct aie_partition_req *req)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/misc/xilinx-ai-engine/ai-engine-dev.c:24:
   include/linux/xlnx-ai-engine.h:24:20: note: previous definition of 'aie_partition_is_available' was here
      24 | static inline bool aie_partition_is_available(struct aie_partition_req *req)
         |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/xilinx-ai-engine/ai-engine-dev.c:554:16: error: redefinition of 'aie_partition_request'
     554 | struct device *aie_partition_request(struct aie_partition_req *req)
         |                ^~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/misc/xilinx-ai-engine/ai-engine-dev.c:24:
   include/linux/xlnx-ai-engine.h:30:1: note: previous definition of 'aie_partition_request' was here
      30 | aie_partition_request(struct aie_partition_req *req)
         | ^~~~~~~~~~~~~~~~~~~~~
   drivers/misc/xilinx-ai-engine/ai-engine-dev.c:588:5: error: redefinition of 'aie_partition_get_fd'
     588 | int aie_partition_get_fd(struct device *dev)
         |     ^~~~~~~~~~~~~~~~~~~~
   In file included from drivers/misc/xilinx-ai-engine/ai-engine-dev.c:24:
   include/linux/xlnx-ai-engine.h:35:19: note: previous definition of 'aie_partition_get_fd' was here
      35 | static inline int aie_partition_get_fd(struct device *dev)
         |                   ^~~~~~~~~~~~~~~~~~~~
   drivers/misc/xilinx-ai-engine/ai-engine-dev.c:612:6: error: redefinition of 'aie_partition_release'
     612 | void aie_partition_release(struct device *dev)
         |      ^~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/misc/xilinx-ai-engine/ai-engine-dev.c:24:
   include/linux/xlnx-ai-engine.h:40:20: note: previous definition of 'aie_partition_release' was here
      40 | static inline void aie_partition_release(struct device *dev) {}
         |                    ^~~~~~~~~~~~~~~~~~~~~

vim +/aie_partition_is_available +517 drivers/misc/xilinx-ai-engine/ai-engine-dev.c

   496	
   497	/**
   498	 * aie_partition_is_available() - Check if an AI engine partition is available
   499	 * @req: AI engine partition requesting arguments
   500	 * @return: true if the AI engine partition is not in use, otherwise, false
   501	 *
   502	 * This function looks up the AI engine class devices to find the AI engine
   503	 * partition whose partition ID matches the given partition ID in @req. If
   504	 * the partition can be found, if will check if the partition is in use.
   505	 *
   506	 * In case the AI engine release function is called from kernel context, the
   507	 * release() will be scheduled when the AI engine partition reference count is
   508	 * reduced to 0 instead of get called synchronously, and thus, this is a helper
   509	 * function for another kernel module to check if the partitions is released
   510	 * after calling release function from kernel context
   511	 *
   512	 * However, if closing the partition is from user context, it will not return
   513	 * until the release is complete when there is no reference to the AI engine
   514	 * partition file. In this case, user doesn't need to call this function to
   515	 * check if the partition is released.
   516	 */
 > 517	bool aie_partition_is_available(struct aie_partition_req *req)
   518	{
   519		struct aie_partition *apart;
   520		int ret;
   521	
   522		if (!req)
   523			return false;
   524	
   525		apart = aie_class_find_partition_from_id(req->partition_id);
   526		if (!apart)
   527			return false;
   528	
   529		ret = mutex_lock_interruptible(&apart->mlock);
   530		if (ret)
   531			return false;
   532	
   533		if (apart->status & XAIE_PART_STATUS_INUSE) {
   534			mutex_unlock(&apart->mlock);
   535			return false;
   536		}
   537	
   538		mutex_unlock(&apart->mlock);
   539		return true;
   540	}
   541	EXPORT_SYMBOL_GPL(aie_partition_is_available);
   542	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 59561 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20200812/13bd9d22/attachment-0001.gz>


More information about the linux-arm-kernel mailing list