Skip to content

Commit 7bf94b9

Browse files
vijaykumar-sgregkh
authored andcommitted
sparc64: Migrate hvcons irq to panicked cpu
[ Upstream commit 7dd4fcf5b70694dc961eb6b954673e4fc9730dbd ] 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> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d14591e commit 7bf94b9

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
@@ -1443,8 +1443,12 @@ void smp_send_stop(void)
14431443
int cpu;
14441444

14451445
if (tlb_type == hypervisor) {
1446+
int this_cpu = smp_processor_id();
1447+
#ifdef CONFIG_SERIAL_SUNHV
1448+
sunhv_migrate_hvcons_irq(this_cpu);
1449+
#endif
14461450
for_each_online_cpu(cpu) {
1447-
if (cpu == smp_processor_id())
1451+
if (cpu == this_cpu)
14481452
continue;
14491453
#ifdef CONFIG_SUN_LDOMS
14501454
if (ldom_domaining_enabled) {

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)