Re: [PATCH] RDMA/cma: Execute rdma_cm destruction from a handler properly

From: kernel test robot
Date: Fri Jun 26 2020 - 22:39:34 EST


Hi Jason,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.8-rc2 next-20200626]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Jason-Gunthorpe/RDMA-cma-Execute-rdma_cm-destruction-from-a-handler-properly/20200627-084914
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1590a2e1c681b0991bd42c992cabfd380e0338f2
config: mips-allyesconfig (attached as .config)
compiler: mips-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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips

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

All errors (new ones prefixed by >>):

drivers/infiniband/core/cma.c: In function 'cma_send_device_removal_put':
>> drivers/infiniband/core/cma.c:4787:3: error: implicit declaration of function 'spin_unlock_irqsave'; did you mean 'spin_lock_irqsave'? [-Werror=implicit-function-declaration]
4787 | spin_unlock_irqsave(&id_priv->lock, flags);
| ^~~~~~~~~~~~~~~~~~~
| spin_lock_irqsave
>> drivers/infiniband/core/cma.c:4789:3: error: implicit declaration of function 'cm_id_put'; did you mean 'cma_id_put'? [-Werror=implicit-function-declaration]
4789 | cm_id_put(id_priv);
| ^~~~~~~~~
| cma_id_put
drivers/infiniband/core/cma.c: In function 'cma_process_remove':
drivers/infiniband/core/cma.c:4813:6: warning: unused variable 'ret' [-Wunused-variable]
4813 | int ret;
| ^~~
cc1: some warnings being treated as errors

vim +4787 drivers/infiniband/core/cma.c

4775
4776 static void cma_send_device_removal_put(struct rdma_id_private *id_priv)
4777 {
4778 struct rdma_cm_event event = { .event = RDMA_CM_EVENT_DEVICE_REMOVAL };
4779 enum rdma_cm_state state;
4780 unsigned long flags;
4781
4782 /* Record that we want to remove the device */
4783 mutex_lock(&id_priv->handler_mutex);
4784 spin_lock_irqsave(&id_priv->lock, flags);
4785 state = id_priv->state;
4786 if (state == RDMA_CM_DESTROYING || state == RDMA_CM_DEVICE_REMOVAL) {
> 4787 spin_unlock_irqsave(&id_priv->lock, flags);
4788 mutex_unlock(&id_priv->handler_mutex);
> 4789 cm_id_put(id_priv);
4790 return;
4791 }
4792 id_priv->state = RDMA_CM_DEVICE_REMOVAL;
4793 spin_unlock_irqsave(&id_priv->lock, flags);
4794
4795 if (cma_cm_event_handler(id_priv, &event)) {
4796 mutex_unlock(&id_priv->handler_mutex);
4797 cm_id_put(id_priv);
4798 trace_cm_id_destroy(id_priv);
4799 _destroy_id(id_priv, state);
4800 return;
4801 }
4802 mutex_unlock(&id_priv->handler_mutex);
4803
4804 /* The thread that assigns state does the cancel */
4805 cma_cancel_operation(id_priv, state);
4806
4807 cm_id_put(id_priv);
4808 }
4809

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

Attachment: .config.gz
Description: application/gzip