From: Steven Rostedt <rostedt@goodmis.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
QLogic-Storage-Upstream@qlogic.com, martin.petersen@oracle.com,
James Bottomley <James.Bottomley@HansenPartnership.com>,
linux-scsi <linux-scsi@vger.kernel.org>,
Christoph Hellwig <hch@lst.de>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: Re: [patch 3/5] scsi/bnx2i: Prevent recursive cpuhotplug locking
Date: Mon, 31 Jul 2017 18:09:08 -0400 [thread overview]
Message-ID: <20170731180908.290381d7@gandalf.local.home> (raw)
In-Reply-To: <20170724105341.468351363@linutronix.de>
On Mon, 24 Jul 2017 12:52:58 +0200
Thomas Gleixner <tglx@linutronix.de> 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 <rostedt@goodmis.org>
Tested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
(makes the lockdep splat go away)
-- Steve
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> ---
> 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);
>
next prev parent reply other threads:[~2017-07-31 22:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-24 10:52 [patch 0/5] scsi/bnx2*: Plug hotplug race, correct locking and simplify hotplug code Thomas Gleixner
2017-07-24 10:52 ` [patch 1/5] scsi/bnx2fc: Plug CPU hotplug race Thomas Gleixner
2017-07-24 10:52 ` [patch 2/5] scsi/bnx2fc: Prevent recursive cpuhotplug locking Thomas Gleixner
2017-07-24 10:52 ` [patch 3/5] scsi/bnx2i: " Thomas Gleixner
2017-07-31 22:09 ` Steven Rostedt [this message]
2017-07-24 10:52 ` [patch 4/5] scsi/bnx2fc: Simplify CPU hotplug code Thomas Gleixner
2017-07-24 10:53 ` [patch 5/5] scsi/bnx2i: Simplify cpu " Thomas Gleixner
2017-07-25 13:27 ` [patch 0/5] scsi/bnx2*: Plug hotplug race, correct locking and simplify " Chad Dupuis
2017-07-27 1:58 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170731180908.290381d7@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=QLogic-Storage-Upstream@qlogic.com \
--cc=bigeasy@linutronix.de \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®