Re: [PATCH] Adding ctrl-o sysrq hack support to 8250 driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 On Fri, Dec 09, Olaf Hering wrote:

> > If it is a POWER4-only problem, why isn't there a dependency on
> > CONFIG_POWER4 over here? I don't like to have the ctrl-o sysrq stuff
> > enabled on my regular PC if it only matters to some rare (in absolute
> > numbers) system.

The system with the build tree on it just crashed hard.
Thats what I saved from the screen session:

Index: linux-2.6.15-rc5-olh/drivers/serial/8250.c
===================================================================
--- linux-2.6.15-rc5-olh.orig/drivers/serial/8250.c
+++ linux-2.6.15-rc5-olh/drivers/serial/8250.c
@@ -85,6 +85,8 @@ static unsigned int share_irqs = SERIAL8
 #define CONFIG_SERIAL_MANY_PORTS 1
 #endif

+#define arch_8250_sysrq_via_ctrl_o(x) (0)
+
 /*
  * HUB6 is always on.  This will be removed once the header
  * files have been cleaned.
@@ -1154,6 +1156,10 @@ receive_chars(struct uart_8250_port *up,
                         */
                }
                ch = serial_inp(up, UART_RX);
+
+               if (arch_8250_sysrq_via_ctrl_o(ch, &up->port))
+                       goto ignore_char;
+
                flag = TTY_NORMAL;
                up->port.icount.rx++;

Index: linux-2.6.15-rc5-olh/include/asm-powerpc/serial.h
===================================================================
--- linux-2.6.15-rc5-olh.orig/include/asm-powerpc/serial.h
+++ linux-2.6.15-rc5-olh/include/asm-powerpc/serial.h
@@ -15,4 +15,11 @@
 /* Default baud base if not found in device-tree */
 #define BASE_BAUD ( 1843200 / 16 )

+
+#if defined(SUPPORT_SYSRQ) && defined(CONFIG_PPC_PSERIES)
+       /* Handle the SysRq ^O Hack, but only on the system console */
+#undef arch_8250_sysrq_via_ctrl_o
+#define arch_8250_sysrq_via_ctrl_o(ch, port) ((ch) == '\x0f' && uart_handle_break((port)))
+#endif
+
 #endif /* _PPC64_SERIAL_H */



-- 
short story of a lazy sysadmin:
 alias appserv=wotan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux