Re: [PATCH 06/24] mpi3mr: add support of event handling part-1

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

 



Hi Kashyap,

I love your patch! Perhaps something to improve:

[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on scsi/for-next v5.10 next-20201223]
[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/Kashyap-Desai/Introducing-mpi3mr-driver/20201222-181732
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
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
        # https://github.com/0day-ci/linux/commit/f353c97f9e813b38c4546df7698017174df5a559
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Kashyap-Desai/Introducing-mpi3mr-driver/20201222-181732
        git checkout f353c97f9e813b38c4546df7698017174df5a559
        # 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@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   drivers/scsi/mpi3mr/mpi3mr_os.c:281:6: warning: no previous prototype for 'mpi3mr_cleanup_fwevt_list' [-Wmissing-prototypes]
     281 | void mpi3mr_cleanup_fwevt_list(struct mpi3mr_ioc *mrioc)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/mpi3mr/mpi3mr_os.c:412:24: warning: no previous prototype for 'mpi3mr_get_tgtdev_by_handle' [-Wmissing-prototypes]
     412 | struct mpi3mr_tgt_dev *mpi3mr_get_tgtdev_by_handle(
         |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/scsi/mpi3mr/mpi3mr_os.c:460:24: warning: no previous prototype for 'mpi3mr_get_tgtdev_by_perst_id' [-Wmissing-prototypes]
     460 | struct mpi3mr_tgt_dev *mpi3mr_get_tgtdev_by_perst_id(
         |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpi3mr/mpi3mr_os.c:580:6: warning: no previous prototype for 'mpi3mr_rfresh_tgtdevs' [-Wmissing-prototypes]
     580 | void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc)
         |      ^~~~~~~~~~~~~~~~~~~~~
   drivers/scsi/mpi3mr/mpi3mr_os.c: In function 'mpi3mr_devstatuschg_evt_bh':
>> drivers/scsi/mpi3mr/mpi3mr_os.c:689:32: warning: variable 'scsi_tgt_priv_data' set but not used [-Wunused-but-set-variable]
     689 |  struct mpi3mr_stgt_priv_data *scsi_tgt_priv_data = NULL;
         |                                ^~~~~~~~~~~~~~~~~~
   drivers/scsi/mpi3mr/mpi3mr_os.c: At top level:
   drivers/scsi/mpi3mr/mpi3mr_os.c:952:6: warning: no previous prototype for 'mpi3mr_flush_delayed_rmhs_list' [-Wmissing-prototypes]
     952 | void mpi3mr_flush_delayed_rmhs_list(struct mpi3mr_ioc *mrioc)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/mpi3mr_get_tgtdev_by_handle +412 drivers/scsi/mpi3mr/mpi3mr_os.c

   271	
   272	/**
   273	 * mpi3mr_cleanup_fwevt_list - Cleanup firmware event list
   274	 * @mrioc: Adapter instance reference
   275	 *
   276	 * Flush all pending firmware events from the firmware event
   277	 * list.
   278	 *
   279	 * Return: Nothing.
   280	 */
 > 281	void mpi3mr_cleanup_fwevt_list(struct mpi3mr_ioc *mrioc)
   282	{
   283		struct mpi3mr_fwevt *fwevt = NULL;
   284	
   285		if ((list_empty(&mrioc->fwevt_list) && !mrioc->current_event) ||
   286		    !mrioc->fwevt_worker_thread || in_interrupt())
   287			return;
   288	
   289		while ((fwevt = mpi3mr_dequeue_fwevt(mrioc)) ||
   290		    (fwevt = mrioc->current_event)) {
   291			/*
   292			 * Wait on the fwevt to complete. If this returns 1, then
   293			 * the event was never executed, and we need a put for the
   294			 * reference the work had on the fwevt.
   295			 *
   296			 * If it did execute, we wait for it to finish, and the put will
   297			 * happen from mpi3mr_process_fwevt()
   298			 */
   299			if (cancel_work_sync(&fwevt->work)) {
   300				/*
   301				 * Put fwevt reference count after
   302				 * dequeuing it from worker queue
   303				 */
   304				mpi3mr_fwevt_put(fwevt);
   305				/*
   306				 * Put fwevt reference count to neutralize
   307				 * kref_init increment
   308				 */
   309				mpi3mr_fwevt_put(fwevt);
   310			}
   311		}
   312	}
   313	
   314	/**
   315	 * mpi3mr_alloc_tgtdev - target device allocator
   316	 *
   317	 * Allocate target device instance and initialize the reference
   318	 * count
   319	 *
   320	 * Return: target device instance.
   321	 */
   322	static struct mpi3mr_tgt_dev *mpi3mr_alloc_tgtdev(void)
   323	{
   324		struct mpi3mr_tgt_dev *tgtdev;
   325	
   326		tgtdev = kzalloc(sizeof(*tgtdev), GFP_ATOMIC);
   327		if (!tgtdev)
   328			return NULL;
   329		kref_init(&tgtdev->ref_count);
   330		return tgtdev;
   331	}
   332	
   333	/**
   334	 * mpi3mr_tgtdev_add_to_list -Add tgtdevice to the list
   335	 * @mrioc: Adapter instance reference
   336	 * @tgtdev: Target device
   337	 *
   338	 * Add the target device to the target device list
   339	 *
   340	 * Return: Nothing.
   341	 */
   342	static void mpi3mr_tgtdev_add_to_list(struct mpi3mr_ioc *mrioc,
   343		struct mpi3mr_tgt_dev *tgtdev)
   344	{
   345		unsigned long flags;
   346	
   347		spin_lock_irqsave(&mrioc->tgtdev_lock, flags);
   348		mpi3mr_tgtdev_get(tgtdev);
   349		INIT_LIST_HEAD(&tgtdev->list);
   350		list_add_tail(&tgtdev->list, &mrioc->tgtdev_list);
   351		spin_unlock_irqrestore(&mrioc->tgtdev_lock, flags);
   352	}
   353	
   354	/**
   355	 * mpi3mr_tgtdev_del_from_list -Delete tgtdevice from the list
   356	 * @mrioc: Adapter instance reference
   357	 * @tgtdev: Target device
   358	 *
   359	 * Remove the target device from the target device list
   360	 *
   361	 * Return: Nothing.
   362	 */
   363	static void mpi3mr_tgtdev_del_from_list(struct mpi3mr_ioc *mrioc,
   364		struct mpi3mr_tgt_dev *tgtdev)
   365	{
   366		unsigned long flags;
   367	
   368		spin_lock_irqsave(&mrioc->tgtdev_lock, flags);
   369		if (!list_empty(&tgtdev->list)) {
   370			list_del_init(&tgtdev->list);
   371			mpi3mr_tgtdev_put(tgtdev);
   372		}
   373		spin_unlock_irqrestore(&mrioc->tgtdev_lock, flags);
   374	}
   375	
   376	/**
   377	 * __mpi3mr_get_tgtdev_by_handle -Get tgtdev from device handle
   378	 * @mrioc: Adapter instance reference
   379	 * @handle: Device handle
   380	 *
   381	 * Accessor to retrieve target device from the device handle.
   382	 * Non Lock version
   383	 *
   384	 * Return: Target device reference.
   385	 */
   386	static struct mpi3mr_tgt_dev  *__mpi3mr_get_tgtdev_by_handle(
   387		struct mpi3mr_ioc *mrioc, u16 handle)
   388	{
   389		struct mpi3mr_tgt_dev *tgtdev;
   390	
   391		assert_spin_locked(&mrioc->tgtdev_lock);
   392		list_for_each_entry(tgtdev, &mrioc->tgtdev_list, list)
   393			if (tgtdev->dev_handle == handle)
   394				goto found_tgtdev;
   395		return NULL;
   396	
   397	found_tgtdev:
   398		mpi3mr_tgtdev_get(tgtdev);
   399		return tgtdev;
   400	}
   401	
   402	/**
   403	 * mpi3mr_get_tgtdev_by_handle -Get tgtdev from device handle
   404	 * @mrioc: Adapter instance reference
   405	 * @handle: Device handle
   406	 *
   407	 * Accessor to retrieve target device from the device handle.
   408	 * Lock version
   409	 *
   410	 * Return: Target device reference.
   411	 */
 > 412	struct mpi3mr_tgt_dev *mpi3mr_get_tgtdev_by_handle(
   413		struct mpi3mr_ioc *mrioc, u16 handle)
   414	{
   415		struct mpi3mr_tgt_dev *tgtdev;
   416		unsigned long flags;
   417	
   418		spin_lock_irqsave(&mrioc->tgtdev_lock, flags);
   419		tgtdev = __mpi3mr_get_tgtdev_by_handle(mrioc, handle);
   420		spin_unlock_irqrestore(&mrioc->tgtdev_lock, flags);
   421		return tgtdev;
   422	}
   423	
   424	/**
   425	 * __mpi3mr_get_tgtdev_by_perst_id -Get tgtdev from persist ID
   426	 * @mrioc: Adapter instance reference
   427	 * @persist_id: Persistent ID
   428	 *
   429	 * Accessor to retrieve target device from the Persistent ID.
   430	 * Non Lock version
   431	 *
   432	 * Return: Target device reference.
   433	 */
   434	static struct mpi3mr_tgt_dev  *__mpi3mr_get_tgtdev_by_perst_id(
   435		struct mpi3mr_ioc *mrioc, u16 persist_id)
   436	{
   437		struct mpi3mr_tgt_dev *tgtdev;
   438	
   439		assert_spin_locked(&mrioc->tgtdev_lock);
   440		list_for_each_entry(tgtdev, &mrioc->tgtdev_list, list)
   441			if (tgtdev->perst_id == persist_id)
   442				goto found_tgtdev;
   443		return NULL;
   444	
   445	found_tgtdev:
   446		mpi3mr_tgtdev_get(tgtdev);
   447		return tgtdev;
   448	}
   449	
   450	/**
   451	 * mpi3mr_get_tgtdev_by_perst_id -Get tgtdev from persistent ID
   452	 * @mrioc: Adapter instance reference
   453	 * @persist_id: Persistent ID
   454	 *
   455	 * Accessor to retrieve target device from the Persistent ID.
   456	 * Lock version
   457	 *
   458	 * Return: Target device reference.
   459	 */
 > 460	struct mpi3mr_tgt_dev *mpi3mr_get_tgtdev_by_perst_id(
   461		struct mpi3mr_ioc *mrioc, u16 persist_id)
   462	{
   463		struct mpi3mr_tgt_dev *tgtdev;
   464		unsigned long flags;
   465	
   466		spin_lock_irqsave(&mrioc->tgtdev_lock, flags);
   467		tgtdev = __mpi3mr_get_tgtdev_by_perst_id(mrioc, persist_id);
   468		spin_unlock_irqrestore(&mrioc->tgtdev_lock, flags);
   469		return tgtdev;
   470	}
   471	

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

Attachment: .config.gz
Description: application/gzip


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux