linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vijay Kumar <vijay.ac.kumar@oracle.com>
To: davem@davemloft.net, sparclinux@vger.kernel.org
Cc: karl.volz@oracle.com, rob.gardner@oracle.com,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/4] sparc64: Migrate hvcons irq to panicked cpu
Date: Fri, 11 Nov 2016 10:11:57 -0800	[thread overview]
Message-ID: <1478887919-10361-3-git-send-email-vijay.ac.kumar@oracle.com> (raw)
In-Reply-To: <1478887919-10361-1-git-send-email-vijay.ac.kumar@oracle.com>

On panic, all other CPUs are stopped except the one which had
hit panic. To keep console alive, we need to migrate hvcons irq
to panicked CPU.

Signed-off-by: Vijay Kumar <vijay.ac.kumar@oracle.com>
---
 arch/sparc/include/asm/setup.h |    1 +
 arch/sparc/kernel/smp_64.c     |    6 +++++-
 drivers/tty/serial/sunhv.c     |    6 ++++++
 3 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/arch/sparc/include/asm/setup.h b/arch/sparc/include/asm/setup.h
index 29d64b1..41691a5 100644
--- a/arch/sparc/include/asm/setup.h
+++ b/arch/sparc/include/asm/setup.h
@@ -61,6 +61,7 @@ extern atomic_t dcpage_flushes_xcall;
 extern int sysctl_tsb_ratio;
 #endif
 
+void sunhv_migrate_hvcons_irq(int cpu);
 void sun_do_break(void);
 extern int stop_a_enabled;
 extern int scons_pwroff;
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index 14138ad..52dc4b7 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1444,8 +1444,12 @@ void smp_send_stop(void)
 	int cpu;
 
 	if (tlb_type == hypervisor) {
+		int this_cpu = smp_processor_id();
+
+		sunhv_migrate_hvcons_irq(this_cpu);
+
 		for_each_online_cpu(cpu) {
-			if (cpu == smp_processor_id())
+			if (cpu == this_cpu)
 				continue;
 
 			set_cpu_online(cpu, false);
diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c
index 4e603d0..59828d8 100644
--- a/drivers/tty/serial/sunhv.c
+++ b/drivers/tty/serial/sunhv.c
@@ -398,6 +398,12 @@ static struct uart_driver sunhv_reg = {
 
 static struct uart_port *sunhv_port;
 
+void sunhv_migrate_hvcons_irq(int cpu)
+{
+	/* Migrate hvcons irq to param cpu */
+	irq_force_affinity(sunhv_port->irq, cpumask_of(cpu));
+}
+
 /* Copy 's' into the con_write_page, decoding "\n" into
  * "\r\n" along the way.  We have to return two lengths
  * because the caller needs to know how much to advance
-- 
1.7.1

  parent reply	other threads:[~2016-11-11 18:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-11 18:11 [PATCH v2 0/4] sparc64: Jump to boot prom from console on panic Vijay Kumar
2016-11-11 18:11 ` [PATCH v2 1/4] sparc64: Set cpu state to offline when stopped Vijay Kumar
2016-11-11 18:11 ` Vijay Kumar [this message]
2016-11-19 15:48   ` [PATCH v2 2/4] sparc64: Migrate hvcons irq to panicked cpu David Miller
2016-11-28 18:33     ` Vijay Kumar
2016-11-11 18:11 ` [PATCH v2 3/4] sparc64: Send break twice from console to return to boot prom Vijay Kumar
2016-11-11 18:11 ` [PATCH v2 4/4] Documentation/sparc: Steps for sending break on sunhv console Vijay Kumar

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=1478887919-10361-3-git-send-email-vijay.ac.kumar@oracle.com \
    --to=vijay.ac.kumar@oracle.com \
    --cc=davem@davemloft.net \
    --cc=karl.volz@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob.gardner@oracle.com \
    --cc=sparclinux@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).