OpenCloudOS-Kernel/drivers/infiniband/hw/usnic
Parvi Kaustubhi 8036e90f92 IB/usnic: Fix potential deadlock
Acquiring the rtnl lock while holding usdev_lock could result in a
deadlock.

For example:

usnic_ib_query_port()
| mutex_lock(&us_ibdev->usdev_lock)
 | ib_get_eth_speed()
  | rtnl_lock()

rtnl_lock()
| usnic_ib_netdevice_event()
 | mutex_lock(&us_ibdev->usdev_lock)

This commit moves the usdev_lock acquisition after the rtnl lock has been
released.

This is safe to do because usdev_lock is not protecting anything being
accessed in ib_get_eth_speed(). Hence, the correct order of holding locks
(rtnl -> usdev_lock) is not violated.

Signed-off-by: Parvi Kaustubhi <pkaustub@cisco.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2018-12-19 16:30:16 -07:00
..
Kconfig IB/usnic: usnic should not select INFINIBAND_USER_ACCESS 2018-07-25 21:25:54 -06:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
usnic.h usnic: add missing clauses to BSD license 2015-10-06 13:43:25 -04:00
usnic_abi.h usnic: add missing clauses to BSD license 2015-10-06 13:43:25 -04:00
usnic_common_pkt_hdr.h RDMA: Adding ethertype ETH_P_IBOE 2017-01-10 14:05:11 -05:00
usnic_common_util.h {net,IB}/{rxe,usnic}: Utilize generic mac to eui32 function 2017-04-25 14:21:34 -04:00
usnic_debugfs.c infiniband: remove redundant condition check before debugfs_remove 2018-09-11 09:37:05 -06:00
usnic_debugfs.h usnic: add missing clauses to BSD license 2015-10-06 13:43:25 -04:00
usnic_fwd.c RDMA/usnic: Suppress a compiler warning 2018-07-26 11:39:06 -06:00
usnic_fwd.h RDMA/usnic: Suppress a compiler warning 2018-07-26 11:39:06 -06:00
usnic_ib.h usnic: add missing clauses to BSD license 2015-10-06 13:43:25 -04:00
usnic_ib_main.c RDMA/usnic: Initialize ib_device_ops struct 2018-12-12 07:40:15 -07:00
usnic_ib_qp_grp.c IB/usnic: fix spelling mistake "miniumum" -> "minimum" 2018-11-29 15:59:40 -07:00
usnic_ib_qp_grp.h RDMA/usnic: Instantiate data structures once 2017-10-14 20:47:07 -04:00
usnic_ib_sysfs.c RDMA/drivers: Use core provided API for registering device attributes 2018-10-17 03:45:01 -06:00
usnic_ib_sysfs.h RDMA/drivers: Use core provided API for registering device attributes 2018-10-17 03:45:01 -06:00
usnic_ib_verbs.c IB/usnic: Fix potential deadlock 2018-12-19 16:30:16 -07:00
usnic_ib_verbs.h RDMA: Mark if destroy address handle is in a sleepable context 2018-12-19 16:28:03 -07:00
usnic_log.h usnic: add missing clauses to BSD license 2015-10-06 13:43:25 -04:00
usnic_transport.c IB/usnic: fix spelling mistake "unvalid" -> "invalid" 2018-09-25 14:35:06 -06:00
usnic_transport.h usnic: add missing clauses to BSD license 2015-10-06 13:43:25 -04:00
usnic_uiom.c RDMA/usnic: Do not use ucontext->tgid 2018-09-20 16:19:30 -04:00
usnic_uiom.h RDMA/usnic: Do not use ucontext->tgid 2018-09-20 16:19:30 -04:00
usnic_uiom_interval_tree.c lib/interval_tree: fast overlap detection 2017-09-08 18:26:49 -07:00
usnic_uiom_interval_tree.h lib/interval_tree: fast overlap detection 2017-09-08 18:26:49 -07:00
usnic_vnic.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
usnic_vnic.h usnic: add missing clauses to BSD license 2015-10-06 13:43:25 -04:00