On Fri, Aug 12, 2016 at 11:17:37AM -0400, ira.weiny@intel.com wrote: > From: Mike Marciniszyn > > 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: [] debugfs_use_file_start+0x5/0x90 > [ 231.746955] #1: (&p->lock){+.+.+.}, at: [] seq_read+0x4c/0x3c0 > [ 231.755873] #2: (rcu_read_lock){......}, at: [] _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 > Signed-off-by: Mike Marciniszyn > CC: # 4.6.x- > > --- > Changes from V1: > use do.. while loop to execute first iter call. Thanks, Reviewed-by: Leon Romanovsky