]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sparc64: Migrate hvcons irq to panicked cpu
authorVijay Kumar <vijay.ac.kumar@oracle.com>
Wed, 1 Feb 2017 19:34:38 +0000 (11:34 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 15 Jun 2017 03:43:56 +0000 (20:43 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7dd4fcf5b70694dc961eb6b954673e4fc9730dbd)

Signed-off-by: Vijay Kumar <vijay.ac.kumar@oracle.com>
Orabug: 24297427

arch/sparc/include/asm/setup.h
arch/sparc/kernel/smp_64.c
drivers/tty/serial/sunhv.c

index 29d64b1758ed2a0ceb795a07c10205e6f923e6c6..478bf6bb4598b345dd7f590beee86f43893e7645 100644 (file)
@@ -59,8 +59,11 @@ extern atomic_t dcpage_flushes;
 extern atomic_t dcpage_flushes_xcall;
 
 extern int sysctl_tsb_ratio;
-#endif
 
+#ifdef CONFIG_SERIAL_SUNHV
+void sunhv_migrate_hvcons_irq(int cpu);
+#endif
+#endif
 void sun_do_break(void);
 extern int stop_a_enabled;
 extern int scons_pwroff;
index e846288e2a3b8e880dd8214f136b8e3a24698646..d4b08210bcd70ba330053d4a8e617ea71a5cc616 100644 (file)
@@ -1544,8 +1544,12 @@ void smp_send_stop(void)
        int cpu;
 
        if (tlb_type == hypervisor) {
+               int this_cpu = smp_processor_id();
+#ifdef CONFIG_SERIAL_SUNHV
+               sunhv_migrate_hvcons_irq(this_cpu);
+#endif
                for_each_online_cpu(cpu) {
-                       if (cpu == smp_processor_id())
+                       if (cpu == this_cpu)
                                continue;
 
                        set_cpu_online(cpu, false);
index 0fedd8bf5ee30e93221045cb6d544b315810754f..6e84e857a0b7df8f7427b928b462e6bf2a95e6cf 100644 (file)
@@ -418,6 +418,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