Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1519945 > unrolled thread
| Started by | Vijay Kumar <vijay.ac.kumar@oracle.com> |
|---|---|
| First post | 2016-11-11 19:20 +0100 |
| Last post | 2016-11-19 16:50 +0100 |
| Articles | 6 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v2 0/4] sparc64: Jump to boot prom from console on panic Vijay Kumar <vijay.ac.kumar@oracle.com> - 2016-11-11 19:20 +0100
[PATCH v2 4/4] Documentation/sparc: Steps for sending break on sunhv console Vijay Kumar <vijay.ac.kumar@oracle.com> - 2016-11-11 19:20 +0100
[PATCH v2 3/4] sparc64: Send break twice from console to return to boot prom Vijay Kumar <vijay.ac.kumar@oracle.com> - 2016-11-11 19:20 +0100
[PATCH v2 1/4] sparc64: Set cpu state to offline when stopped Vijay Kumar <vijay.ac.kumar@oracle.com> - 2016-11-11 19:20 +0100
[PATCH v2 2/4] sparc64: Migrate hvcons irq to panicked cpu Vijay Kumar <vijay.ac.kumar@oracle.com> - 2016-11-11 19:20 +0100
Re: [PATCH v2 2/4] sparc64: Migrate hvcons irq to panicked cpu David Miller <davem@davemloft.net> - 2016-11-19 16:50 +0100
| From | Vijay Kumar <vijay.ac.kumar@oracle.com> |
|---|---|
| Date | 2016-11-11 19:20 +0100 |
| Subject | [PATCH v2 0/4] sparc64: Jump to boot prom from console on panic |
| Message-ID | <sCoAF-7P3-1@gated-at.bofh.it> |
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.
sparc64: Set cpu state to offline when stopped
sparc64: Migrate hvcons irq to panicked cpu
sparc64: Send break twice from console to return to boot prom
Documentation/sparc: Steps for sending break on sunhv console
Documentation/sparc/console.txt | 9 +++++++++
arch/sparc/include/asm/setup.h | 1 +
arch/sparc/kernel/smp_64.c | 9 ++++++++-
drivers/tty/serial/sunhv.c | 12 +++++++++++-
kernel/panic.c | 3 ++-
5 files changed, 31 insertions(+), 3 deletions(-)
create mode 100644 Documentation/sparc/console.txt
--
1.7.1
[toc] | [next] | [standalone]
| From | Vijay Kumar <vijay.ac.kumar@oracle.com> |
|---|---|
| Date | 2016-11-11 19:20 +0100 |
| Subject | [PATCH v2 4/4] Documentation/sparc: Steps for sending break on sunhv console |
| Message-ID | <sCoAF-7P3-13@gated-at.bofh.it> |
| In reply to | #1519945 |
Documented the steps for sending break on sunhv console. Signed-off-by: Vijay Kumar <vijay.ac.kumar@oracle.com> --- Documentation/sparc/console.txt | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/Documentation/sparc/console.txt b/Documentation/sparc/console.txt new file mode 100644 index 0000000..ab55353 --- /dev/null +++ b/Documentation/sparc/console.txt @@ -0,0 +1,9 @@ +Steps for sending 'break' on sunhv console: +=========================================== + +On Baremetal: + 1. press Esc + 'B' + +On LDOM: + 1. press Ctrl + ']' + 2. telnet> send break -- 1.7.1
[toc] | [prev] | [next] | [standalone]
| From | Vijay Kumar <vijay.ac.kumar@oracle.com> |
|---|---|
| Date | 2016-11-11 19:20 +0100 |
| Subject | [PATCH v2 3/4] sparc64: Send break twice from console to return to boot prom |
| Message-ID | <sCoAG-7P3-23@gated-at.bofh.it> |
| In reply to | #1519945 |
Now we can also jump to boot prom from sunhv console by sending
break twice on console for both running and panicked kernel
cases.
Signed-off-by: Vijay Kumar <vijay.ac.kumar@oracle.com>
---
drivers/tty/serial/sunhv.c | 6 +++++-
kernel/panic.c | 3 ++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c
index 59828d8..33c35b4 100644
--- a/drivers/tty/serial/sunhv.c
+++ b/drivers/tty/serial/sunhv.c
@@ -116,7 +116,7 @@ static int receive_chars_getchar(struct uart_port *port)
static int receive_chars_read(struct uart_port *port)
{
- int saw_console_brk = 0;
+ static int saw_console_brk;
int limit = 10000;
while (limit-- > 0) {
@@ -128,6 +128,9 @@ static int receive_chars_read(struct uart_port *port)
bytes_read = 0;
if (stat == CON_BREAK) {
+ if (saw_console_brk)
+ sun_do_break();
+
if (uart_handle_break(port))
continue;
saw_console_brk = 1;
@@ -151,6 +154,7 @@ static int receive_chars_read(struct uart_port *port)
if (port->sysrq != 0 && *con_read_page) {
for (i = 0; i < bytes_read; i++)
uart_handle_sysrq_char(port, con_read_page[i]);
+ saw_console_brk = 0;
}
if (port->state == NULL)
diff --git a/kernel/panic.c b/kernel/panic.c
index ca8cea1..4fe3b28 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -240,7 +240,8 @@ void panic(const char *fmt, ...)
extern int stop_a_enabled;
/* Make sure the user can actually press Stop-A (L1-A) */
stop_a_enabled = 1;
- pr_emerg("Press Stop-A (L1-A) to return to the boot prom\n");
+ pr_emerg("Press Stop-A (L1-A) from sun keyboard or send break\n"
+ "twice on console to return to the boot prom\n");
}
#endif
#if defined(CONFIG_S390)
--
1.7.1
[toc] | [prev] | [next] | [standalone]
| From | Vijay Kumar <vijay.ac.kumar@oracle.com> |
|---|---|
| Date | 2016-11-11 19:20 +0100 |
| Subject | [PATCH v2 1/4] sparc64: Set cpu state to offline when stopped |
| Message-ID | <sCoAG-7P3-25@gated-at.bofh.it> |
| In reply to | #1519945 |
CPU needs to be marked offline before stopping it. When not marked
offline, the xcall receives HV_EWOULDBLOCK and so assumes that not all
CPUs received the message, and retries. After 10000 retries, it finally
fails with fatal mondo timeout.
Signed-off-by: Vijay Kumar <vijay.ac.kumar@oracle.com>
---
arch/sparc/kernel/smp_64.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index d3035ba..14138ad 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1435,6 +1435,7 @@ void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs)
static void stop_this_cpu(void *dummy)
{
+ set_cpu_online(smp_processor_id(), false);
prom_stopself();
}
@@ -1446,6 +1447,8 @@ void smp_send_stop(void)
for_each_online_cpu(cpu) {
if (cpu == smp_processor_id())
continue;
+
+ set_cpu_online(cpu, false);
#ifdef CONFIG_SUN_LDOMS
if (ldom_domaining_enabled) {
unsigned long hv_err;
--
1.7.1
[toc] | [prev] | [next] | [standalone]
| From | Vijay Kumar <vijay.ac.kumar@oracle.com> |
|---|---|
| Date | 2016-11-11 19:20 +0100 |
| Subject | [PATCH v2 2/4] sparc64: Migrate hvcons irq to panicked cpu |
| Message-ID | <sCoAG-7P3-27@gated-at.bofh.it> |
| In reply to | #1519945 |
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
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2016-11-19 16:50 +0100 |
| Subject | Re: [PATCH v2 2/4] sparc64: Migrate hvcons irq to panicked cpu |
| Message-ID | <sFg3U-6NE-21@gated-at.bofh.it> |
| In reply to | #1519953 |
From: Vijay Kumar <vijay.ac.kumar@oracle.com>
Date: Fri, 11 Nov 2016 10:11:57 -0800
> @@ -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);
> +
You can't unconditionally call into code that might be configured
out by a Kconfig option, as you are doing here.
If SERIAL_SUNHV=n this change will thus result in a build error.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web