Skip to content

Commit 7dd4fcf

Browse files
vijaykumar-sdavem330
authored andcommitted
sparc64: Migrate hvcons irq to panicked cpu
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>
1 parent cffb3e7 commit 7dd4fcf

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

‎arch/sparc/include/asm/setup.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ extern atomic_t dcpage_flushes;
5959
extern atomic_t dcpage_flushes_xcall;
6060

6161
extern int sysctl_tsb_ratio;
62-
#endif
6362

63+
#ifdef CONFIG_SERIAL_SUNHV
64+
void sunhv_migrate_hvcons_irq(int cpu);
65+
#endif
66+
#endif
6467
void sun_do_break(void);
6568
extern int stop_a_enabled;
6669
extern int scons_pwroff;

‎arch/sparc/kernel/smp_64.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,8 +1452,12 @@ void smp_send_stop(void)
14521452
int cpu;
14531453

14541454
if (tlb_type == hypervisor) {
1455+
int this_cpu = smp_processor_id();
1456+
#ifdef CONFIG_SERIAL_SUNHV
1457+
sunhv_migrate_hvcons_irq(this_cpu);
1458+
#endif
14551459
for_each_online_cpu(cpu) {
1456-
if (cpu == smp_processor_id())
1460+
if (cpu == this_cpu)
14571461
continue;
14581462

14591463
set_cpu_online(cpu, false);

‎drivers/tty/serial/sunhv.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,12 @@ static struct uart_driver sunhv_reg = {
398398

399399
static struct uart_port *sunhv_port;
400400

401+
void sunhv_migrate_hvcons_irq(int cpu)
402+
{
403+
/* Migrate hvcons irq to param cpu */
404+
irq_force_affinity(sunhv_port->irq, cpumask_of(cpu));
405+
}
406+
401407
/* Copy 's' into the con_write_page, decoding "\n" into
402408
* "\r\n" along the way. We have to return two lengths
403409
* because the caller needs to know how much to advance

0 commit comments

Comments
 (0)