Skip to content

Commit 0d88b86

Browse files
committed
Merge branch 'sparc64-jump-to-boot-prom'
Vijay Kumar says: ==================== sparc64: Jump to boot prom from console on panic V3 changes: - patch 02/04: Added SERIAL_SUNHV conditional group for sunhv_migrate_hvcons_irq in smp_send_stop(). V2 changes: - Added cover letter patch Currently Stop-A (L1A) does not make the kernel switch to OBP on panic. This patchset addresses this issue. Also, now we can cause a jump to OBP by sending 'break' twice from sunhv console. On bare metal, one can send a break by typing Esc + 'B' + Sysrq (or whatever). On LDOM, press Ctrl + ] in telnet, and then "send break" at the telnet prompt. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents f41e546 + 4cfe140 commit 0d88b86

File tree

5 files changed

+34
-4
lines changed

5 files changed

+34
-4
lines changed

Documentation/sparc/console.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Steps for sending 'break' on sunhv console:
2+
===========================================
3+
4+
On Baremetal:
5+
1. press Esc + 'B'
6+
7+
On LDOM:
8+
1. press Ctrl + ']'
9+
2. telnet> send break

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: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,7 @@ void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs)
14431443

14441444
static void stop_this_cpu(void *dummy)
14451445
{
1446+
set_cpu_online(smp_processor_id(), false);
14461447
prom_stopself();
14471448
}
14481449

@@ -1451,9 +1452,15 @@ void smp_send_stop(void)
14511452
int cpu;
14521453

14531454
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
14541459
for_each_online_cpu(cpu) {
1455-
if (cpu == smp_processor_id())
1460+
if (cpu == this_cpu)
14561461
continue;
1462+
1463+
set_cpu_online(cpu, false);
14571464
#ifdef CONFIG_SUN_LDOMS
14581465
if (ldom_domaining_enabled) {
14591466
unsigned long hv_err;

drivers/tty/serial/sunhv.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static int receive_chars_getchar(struct uart_port *port)
116116

117117
static int receive_chars_read(struct uart_port *port)
118118
{
119-
int saw_console_brk = 0;
119+
static int saw_console_brk;
120120
int limit = 10000;
121121

122122
while (limit-- > 0) {
@@ -128,6 +128,9 @@ static int receive_chars_read(struct uart_port *port)
128128
bytes_read = 0;
129129

130130
if (stat == CON_BREAK) {
131+
if (saw_console_brk)
132+
sun_do_break();
133+
131134
if (uart_handle_break(port))
132135
continue;
133136
saw_console_brk = 1;
@@ -151,6 +154,7 @@ static int receive_chars_read(struct uart_port *port)
151154
if (port->sysrq != 0 && *con_read_page) {
152155
for (i = 0; i < bytes_read; i++)
153156
uart_handle_sysrq_char(port, con_read_page[i]);
157+
saw_console_brk = 0;
154158
}
155159

156160
if (port->state == NULL)
@@ -398,6 +402,12 @@ static struct uart_driver sunhv_reg = {
398402

399403
static struct uart_port *sunhv_port;
400404

405+
void sunhv_migrate_hvcons_irq(int cpu)
406+
{
407+
/* Migrate hvcons irq to param cpu */
408+
irq_force_affinity(sunhv_port->irq, cpumask_of(cpu));
409+
}
410+
401411
/* Copy 's' into the con_write_page, decoding "\n" into
402412
* "\r\n" along the way. We have to return two lengths
403413
* because the caller needs to know how much to advance

kernel/panic.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ void panic(const char *fmt, ...)
273273
extern int stop_a_enabled;
274274
/* Make sure the user can actually press Stop-A (L1-A) */
275275
stop_a_enabled = 1;
276-
pr_emerg("Press Stop-A (L1-A) to return to the boot prom\n");
276+
pr_emerg("Press Stop-A (L1-A) from sun keyboard or send break\n"
277+
"twice on console to return to the boot prom\n");
277278
}
278279
#endif
279280
#if defined(CONFIG_S390)

0 commit comments

Comments
 (0)