linux-hardened/drivers/infiniband/hw/cxgb4
Bharat Potnuri 1c8f1da5d8 iw_cxgb4: Fix possible circular dependency locking warning
Locking sequence of iw_cxgb4 and RoCE drivers in ib_register_device() is
slightly different and this leads to possible circular dependency locking
warning when both the devices are brought up.

Here is the locking sequence upto ib_register_device():
iw_cxgb4: rtnl_mutex(net stack) --> uld_mutex --> device_mutex
RoCE drivers: device_mutex --> rtnl_mutex

Here is the possibility of cross locking:

	CPU #0 (iw_cxgb4) 		     CPU #1 (RoCE drivers)

-> on interface up cxgb4_up()
executed with rtnl_mutex held
-> hold uld_mutex and try
registering ib device
					-> In ib_register_device() hold
					   device_mutex
-> hold device mutex in
ib_register_device
					-> try acquiring rtnl_mutex in
					   ib_enum_roce_netdev()

Current patch schedules the ib_register_device() functionality of
iw_cxgb4 to a workqueue to prevent the possible cross-locking.
Also rename the labels in c4iw_reister_device().

Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2017-11-13 16:59:22 -05:00
..
cm.c iw_cxgb4: remove BUG_ON() usage. 2017-11-13 15:01:25 -05:00
cq.c iw_cxgb4: remove BUG_ON() usage. 2017-11-13 15:01:25 -05:00
device.c iw_cxgb4: Fix possible circular dependency locking warning 2017-11-13 16:59:22 -05:00
ev.c iw_cxgb4: change pr_debug to appropriate log level 2017-09-27 10:13:15 -04:00
id_table.c iw_cxgb4: remove BUG_ON() usage. 2017-11-13 15:01:25 -05:00
iw_cxgb4.h iw_cxgb4: Fix possible circular dependency locking warning 2017-11-13 16:59:22 -05:00
Kconfig IB/{cxgb3,cxgb4}: Remove unneeded config dependencies 2017-09-27 08:54:19 -04:00
Makefile libcxgb,iw_cxgb4,cxgbit: add cxgb_get_4tuple() 2016-09-15 20:49:19 -04:00
mem.c iw_cxgb4: add referencing to wait objects 2017-09-29 11:46:41 -04:00
provider.c iw_cxgb4: Fix possible circular dependency locking warning 2017-11-13 16:59:22 -05:00
qp.c iw_cxgb4: remove BUG_ON() usage. 2017-11-13 15:01:25 -05:00
resource.c iw_cxgb4: Remove __func__ parameter from pr_debug() 2017-09-27 10:13:14 -04:00
t4.h iw_cxgb4: remove BUG_ON() usage. 2017-11-13 15:01:25 -05:00
t4fw_ri_api.h RDMA/cxgb4: Annotate r2 and stag as __be32 2017-11-10 13:04:09 -05:00