linux/drivers/infiniband/hw
Mike Marciniszyn c62fb260a8 IB/hfi1,IB/qib: Fix qp_stats sleep with rcu read lock held
The qp init function does a kzalloc() while holding the RCU
lock that encounters the following warning with a debug kernel
when a cat of the qp_stats is done:

[  231.723948] rcu_scheduler_active = 1, debug_locks = 0
[  231.731939] 3 locks held by cat/11355:
[  231.736492]  #0:  (debugfs_srcu){......}, at: [<ffffffff813001a5>] debugfs_use_file_start+0x5/0x90
[  231.746955]  #1:  (&p->lock){+.+.+.}, at: [<ffffffff81289a6c>] seq_read+0x4c/0x3c0
[  231.755873]  #2:  (rcu_read_lock){......}, at: [<ffffffffa0a0c535>] _qp_stats_seq_start+0x5/0xd0 [hfi1]
[  231.766862]

The init functions do an implicit next which requires the rcu read lock
before the kzalloc().

Fix for both drivers is to change the scope of the init function to only
do the allocation and the initialization of the just allocated iter.

The implict next is moved back into the respective start functions to fix
the issue.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
CC: <stable@vger.kernel.org> # 4.6.x-
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-08-22 14:31:34 -04:00
..
cxgb3 Merge branches 'cxgb4' and 'mlx5' into k.o/for-4.8 2016-08-03 20:58:45 -04:00
cxgb4 Merge branches 'cxgb4' and 'mlx5' into k.o/for-4.8 2016-08-03 20:58:45 -04:00
hfi1 IB/hfi1,IB/qib: Fix qp_stats sleep with rcu read lock held 2016-08-22 14:31:34 -04:00
i40iw Round one of 4.8 code 2016-08-04 20:10:31 -04:00
mlx4 IB/mlx4: Return EAGAIN for any error in mlx4_ib_poll_one 2016-08-22 14:26:53 -04:00
mlx5 Round one of 4.8 code 2016-08-04 20:10:31 -04:00
mthca Merge branches 'misc' and 'rxe' into k.o/for-4.8-1 2016-08-04 11:13:47 -04:00
nes IB/nes: Support device FW version string 2016-06-23 12:08:34 -04:00
ocrdma IB/ocrdma: Support device FW version string 2016-06-23 12:08:34 -04:00
qib IB/hfi1,IB/qib: Fix qp_stats sleep with rcu read lock held 2016-08-22 14:31:34 -04:00
usnic IB/usnic: Support device FW version string 2016-06-23 12:08:34 -04:00
Makefile IB/hfi1: Move driver out of staging 2016-05-26 11:35:14 -04:00