linux_dsm_epyc7002/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
usnic_abi.h
usnic_common_pkt_hdr.h
usnic_common_util.h
usnic_debugfs.c infiniband: remove redundant condition check before debugfs_remove 2018-09-11 09:37:05 -06:00
usnic_debugfs.h
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_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
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_ib.h
usnic_log.h
usnic_transport.c IB/usnic: fix spelling mistake "unvalid" -> "invalid" 2018-09-25 14:35:06 -06:00
usnic_transport.h
usnic_uiom_interval_tree.c
usnic_uiom_interval_tree.h
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_vnic.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
usnic_vnic.h
usnic.h