linux/drivers/infiniband/hw
Parvi Kaustubhi 5bb3c1e9d4 IB/usnic: Fix deadlock
There is a dead lock in usnic ib_register and netdev_notify path.

	usnic_ib_discover_pf()
	| mutex_lock(&usnic_ib_ibdev_list_lock);
	 | usnic_ib_device_add();
	  | ib_register_device()
	   | usnic_ib_query_port()
	    | mutex_lock(&us_ibdev->usdev_lock);
	     | ib_get_eth_speed()
	      | rtnl_lock()

order of lock: &usnic_ib_ibdev_list_lock -> usdev_lock -> rtnl_lock

	rtnl_lock()
	 | usnic_ib_netdevice_event()
	  | mutex_lock(&usnic_ib_ibdev_list_lock);

order of lock: rtnl_lock -> &usnic_ib_ibdev_list_lock

Solution is to use the core's lock-free ib_device_get_by_netdev() scheme
to lookup ib_dev while handling netdev & inet events.

Signed-off-by: Parvi Kaustubhi <pkaustub@cisco.com>
Reviewed-by: Govindarajulu Varadarajan <gvaradar@cisco.com>
Reviewed-by: Tanmay Inamdar <tinamdar@cisco.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2019-02-19 20:52:19 -07:00
..
bnxt_re IB/{hw,sw}: Remove 'uobject->context' dependency in object creation APIs 2019-02-15 15:38:38 -07:00
cxgb3 IB/{hw,sw}: Remove 'uobject->context' dependency in object creation APIs 2019-02-15 15:38:38 -07:00
cxgb4 RDMA/cxgb4: Remove kref accounting for sync operation 2019-02-15 21:39:15 -07:00
hfi1 IB/hfi1: Fix a build warning for TID RDMA READ 2019-02-15 15:55:50 -07:00
hns IB/{hw,sw}: Remove 'uobject->context' dependency in object creation APIs 2019-02-15 15:38:38 -07:00
i40iw IB/{hw,sw}: Remove 'uobject->context' dependency in object creation APIs 2019-02-15 15:38:38 -07:00
mlx4 IB/{hw,sw}: Remove 'uobject->context' dependency in object creation APIs 2019-02-15 15:38:38 -07:00
mlx5 IB/{hw,sw}: Remove 'uobject->context' dependency in object creation APIs 2019-02-15 15:38:38 -07:00
mthca IB/{hw,sw}: Remove 'uobject->context' dependency in object creation APIs 2019-02-15 15:38:38 -07:00
nes RDMA/nes: Remove useless usecnt variable and redundant memset 2019-02-15 21:39:15 -07:00
ocrdma RDMA/ocrdma: Use for_each_sg_dma_page iterator on umem SGL 2019-02-11 15:24:55 -07:00
qedr IB/{hw,sw}: Remove 'uobject->context' dependency in object creation APIs 2019-02-15 15:38:38 -07:00
qib Merge branch 'wip/dl-for-next' into for-next 2019-02-09 12:54:04 -05:00
usnic IB/usnic: Fix deadlock 2019-02-19 20:52:19 -07:00
vmw_pvrdma RDMA/vmw_pvrdma: Use for_each_sg_dma_page iterator on umem SGL 2019-02-11 15:24:55 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00