From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751591AbdGaWJN (ORCPT ); Mon, 31 Jul 2017 18:09:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:46002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751059AbdGaWJL (ORCPT ); Mon, 31 Jul 2017 18:09:11 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51CA422B6C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Mon, 31 Jul 2017 18:09:08 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: LKML , QLogic-Storage-Upstream@qlogic.com, martin.petersen@oracle.com, James Bottomley , linux-scsi , Christoph Hellwig , Sebastian Andrzej Siewior Subject: Re: [patch 3/5] scsi/bnx2i: Prevent recursive cpuhotplug locking Message-ID: <20170731180908.290381d7@gandalf.local.home> In-Reply-To: <20170724105341.468351363@linutronix.de> References: <20170724105255.715647116@linutronix.de> <20170724105341.468351363@linutronix.de> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 24 Jul 2017 12:52:58 +0200 Thomas Gleixner wrote: > The BNX2I module init/exit code installs/removes the hotplug callbacks with > the cpu hotplug lock held. This worked with the old CPU locking > implementation which allowed recursive locking, but with the new percpu > rwsem based mechanism this is not longer allowed. > > Use the _cpuslocked() variants to fix this. > > Reported-by: Steven Rostedt Tested-by: Steven Rostedt (VMware) (makes the lockdep splat go away) -- Steve > Signed-off-by: Thomas Gleixner > --- > drivers/scsi/bnx2i/bnx2i_init.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > --- a/drivers/scsi/bnx2i/bnx2i_init.c > +++ b/drivers/scsi/bnx2i/bnx2i_init.c > @@ -516,15 +516,16 @@ static int __init bnx2i_mod_init(void) > for_each_online_cpu(cpu) > bnx2i_percpu_thread_create(cpu); > > - err = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, > - "scsi/bnx2i:online", > - bnx2i_cpu_online, NULL); > + err = cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ONLINE_DYN, > + "scsi/bnx2i:online", > + bnx2i_cpu_online, NULL); > if (err < 0) > goto remove_threads; > bnx2i_online_state = err; > > - cpuhp_setup_state_nocalls(CPUHP_SCSI_BNX2I_DEAD, "scsi/bnx2i:dead", > - NULL, bnx2i_cpu_dead); > + cpuhp_setup_state_nocalls_cpuslocked(CPUHP_SCSI_BNX2I_DEAD, > + "scsi/bnx2i:dead", > + NULL, bnx2i_cpu_dead); > put_online_cpus(); > return 0; > > @@ -574,8 +575,8 @@ static void __exit bnx2i_mod_exit(void) > for_each_online_cpu(cpu) > bnx2i_percpu_thread_destroy(cpu); > > - cpuhp_remove_state_nocalls(bnx2i_online_state); > - cpuhp_remove_state_nocalls(CPUHP_SCSI_BNX2I_DEAD); > + cpuhp_remove_state_nocalls_cpuslocked(bnx2i_online_state); > + cpuhp_remove_state_nocalls_cpuslocked(CPUHP_SCSI_BNX2I_DEAD); > put_online_cpus(); > > iscsi_unregister_transport(&bnx2i_iscsi_transport); >