serial/sysrq: Cleanup ifdeffery
Subsystems (27)
cover serial/sysrq: Cleanup ifdeffery
The original purpose of the patches set was to add a way to enable sysrq on a uart where currently it can be constantly either on or off (CONFIG_MAGIC_SYSRQ_SERIAL), see the last patch:
"serial/sysrq: Add MAGIC_SYSRQ_SERIAL_SEQUENCE"
But to do that, I had to add uart_try_toggle_sysrq() and I didn't want to bloat serial_core.h even more. So, I did cleanup by removing SUPPORT_SYSRQ resulting in a nice diff-stat and lesser ifdeffery.
Most patches are one-liners, I decided to keep them separated per-driver to let reviewers easier follow the purpose.
Dmitry Safonov (58):
sysrq: Remove sysrq_handler_registered
serial: Move sysrq members above
serial_core: Un-ifdef sysrq SUPPORT_SYSRQ
tty/serial: Migrate aspeed_vuart to use has_sysrq tty/serial: Migrate 8250_fsl to use has_sysrq tty/serial: Migrate bcm63xx_uart to use has_sysrq tty/serial: Migrate 8250_omap to use has_sysrq tty/serial: Migrate 8250_port to use has_sysrq tty/serial: Migrate amba-pl01* to use has_sysrq tty/serial: Migrate apbuart to use has_sysrq tty/serial: Migrate arc_uart to use has_sysrq tty/serial: Migrate atmel_serial to use has_sysrq tty/serial: Migrate clps711x to use has_sysrq tty/serial: Migrate cpm_uart to use has_sysrq tty/serial: Migrate dz to use has_sysrq
tty/serial: Migrate efm32-uart to use has_sysrq tty/serial: Migrate fsl_linflexuart to use has_sysrq tty/serial: Migrate fsl_lpuart to use has_sysrq tty/serial: Migrate imx to use has_sysrq
tty/serial: Migrate ip22zilog to use has_sysrq tty/serial: Migrate meson_uart to use has_sysrq tty/serial: Migrate milbeaut_usio to use has_sysrq tty/serial: Migrate mpc52xx_uart to use has_sysrq tty/serial: Don't zero port->sysrq
tty/serial: Migrate msm_serial to use has_sysrq tty/serial: Migrate mux to use has_sysrq
tty/serial: Migrate mxs-auart to use has_sysrq tty/serial: Migrate omap-serial to use has_sysrq tty/serial: Migrate pch_uart to use has_sysrq tty/serial: Don't check port->sysrq
tty/serial: Migrate pmac_zilog to use has_sysrq tty/serial: Migrate pnx8xxx_uart to use has_sysrq serial/f81534: Don't check port->sysrq
tty/serial: Migrate pxa to use has_sysrq
tty/serial: Migrate qcom_geni_serial to use has_sysrq tty/serial: Migrate sa1100 to use has_sysrq
tty/serial: Migrate samsung_tty to use has_sysrq tty/serial: Migrate sb1250-duart to use has_sysrq tty/serial: Migrate sccnxp to use has_sysrq
tty/serial: Migrate serial_txx9 to use has_sysrq tty/serial: Migrate sh-sci to use has_sysrq
tty/serial: Migrate sprd_serial to use has_sysrq tty/serial: Migrate st-asc to use has_sysrq
tty/serial: Migrate stm32-usart to use has_sysrq tty/serial: Migrate sunhv to use has_sysrq
tty/serial: Migrate sunsab to use has_sysrq
tty/serial: Migrate sunsu to use has_sysrq
tty/serial: Migrate sunzilog to use has_sysrq serial/ucc_uart: Remove ifdef SUPPORT_SYSRQ
tty/serial: Migrate vr41xx_siu to use has_sysrq tty/serial: Migrate vt8500_serial to use has_sysrq tty/serial: Migrate xilinx_uartps to use has_sysrq tty/serial: Migrate zs to use has_sysrq
serial_core: Remove SUPPORT_SYSRQ ifdeffery
usb/serial: Don't handle break when CONFIG_MAGIC_SYSRQ is disabled
serial_core: Move sysrq functions from header file sysctl/sysrq: Remove __sysrq_enabled copy
serial/sysrq: Add MAGIC_SYSRQ_SERIAL_SEQUENCE
arch/powerpc/kernel/legacy_serial.c | 4 +- drivers/tty/serial/8250/8250_aspeed_vuart.c | 5 +- drivers/tty/serial/8250/8250_fsl.c | 4 - drivers/tty/serial/8250/8250_of.c | 4 +- drivers/tty/serial/8250/8250_omap.c | 5 +- drivers/tty/serial/8250/8250_port.c | 5 +- drivers/tty/serial/amba-pl010.c | 5 +- drivers/tty/serial/amba-pl011.c | 6 +- drivers/tty/serial/apbuart.c | 5 +- drivers/tty/serial/arc_uart.c | 5 +- drivers/tty/serial/atmel_serial.c | 9 +- drivers/tty/serial/bcm63xx_uart.c | 5 +- drivers/tty/serial/clps711x.c | 5 +- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 9 +- drivers/tty/serial/dz.c | 5 +- drivers/tty/serial/efm32-uart.c | 5 +- drivers/tty/serial/fsl_linflexuart.c | 8 +- drivers/tty/serial/fsl_lpuart.c | 9 +- drivers/tty/serial/imx.c | 7 +- drivers/tty/serial/ip22zilog.c | 7 +- drivers/tty/serial/meson_uart.c | 5 +- drivers/tty/serial/milbeaut_usio.c | 5 +- drivers/tty/serial/mpc52xx_uart.c | 11 +- drivers/tty/serial/msm_serial.c | 5 +- drivers/tty/serial/mux.c | 5 +- drivers/tty/serial/mxs-auart.c | 5 +- drivers/tty/serial/omap-serial.c | 5 +- drivers/tty/serial/pch_uart.c | 12 +- drivers/tty/serial/pmac_zilog.c | 5 +- drivers/tty/serial/pnx8xxx_uart.c | 7 +- drivers/tty/serial/pxa.c | 5 +- drivers/tty/serial/qcom_geni_serial.c | 5 +- drivers/tty/serial/sa1100.c | 7 +- drivers/tty/serial/samsung_tty.c | 5 +- drivers/tty/serial/sb1250-duart.c | 5 +- drivers/tty/serial/sccnxp.c | 5 +- drivers/tty/serial/serial_core.c | 123 ++++++++++++++++++++ drivers/tty/serial/serial_txx9.c | 5 +- drivers/tty/serial/sh-sci.c | 10 +- drivers/tty/serial/sprd_serial.c | 5 +- drivers/tty/serial/st-asc.c | 5 +- drivers/tty/serial/stm32-usart.c | 5 +- drivers/tty/serial/sunhv.c | 5 +- drivers/tty/serial/sunsab.c | 5 +- drivers/tty/serial/sunsu.c | 5 +- drivers/tty/serial/sunzilog.c | 6 +- drivers/tty/serial/ucc_uart.c | 2 - drivers/tty/serial/vr41xx_siu.c | 5 +- drivers/tty/serial/vt8500_serial.c | 5 +- drivers/tty/serial/xilinx_uartps.c | 5 +- drivers/tty/serial/zs.c | 5 +- drivers/tty/sysrq.c | 16 +-- drivers/usb/serial/f81534.c | 6 +- drivers/usb/serial/generic.c | 10 +- include/linux/serial_core.h | 92 ++------------- include/linux/sysrq.h | 1 + kernel/sysctl.c | 41 ++++--- lib/Kconfig.debug | 8 ++ 58 files changed, 238 insertions(+), 346 deletions(-)
Signature · 1 line
2.24.0
PATCH 1/58 sysrq: Remove sysrq_handler_registered
sysrq_toggle_support() can be called in parallel, in return calling input_(un)register_handler(), which fortunately is safe to call in parallel and regardless of registered/unregistered status of sysrq_handler.
Remove sysrq_handler_registered as it doesn't have any function there and may confuse reader about possible race.
--- drivers/tty/sysrq.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/tty/sysrq.c +1 -8
@@ -967,8 +967,6 @@ static struct input_handler sysrq_handler = { .id_table = sysrq_ids, }; -static bool sysrq_handler_registered; -static inline void sysrq_register_handler (void ) {int error;
@@ -978,16 +976,11 @@ static inline void sysrq_register_handler(void) error =input_register_handler (&sysrq_handler);if (error)pr_err ("Failed to register input handler, error %d" , error); -else - sysrq_handler_registered = true; }static inline void sysrq_unregister_handler (void ) { -if (sysrq_handler_registered) { -input_unregister_handler (&sysrq_handler); - sysrq_handler_registered = false; - } +input_unregister_handler (&sysrq_handler); } static int sysrq_reset_seq_param_set(const char *buffer,
Signature · 1 line
2.24.0
PATCH 2/58 serial: Move sysrq members above
In reply to Dmitry SafonovAt the current place members those follow are:
: upf_t flags;
: upstat_t status;
: int hw_stopped;
: unsigned int mctrl;
: unsigned int timeout;
: unsigned int type;
: const struct uart_ops *ops;
Together, they give (*ops) 8-byte align on 64-bit platforms. And sysrq_ch introduces 4-byte padding.
On the other side, above:
: struct device *dev;
: unsigned char hub6;
: unsigned char suspended;
: unsigned char unused[2];
: const char *name;
Adds another 4-byte padding.
Moving sysrq members just before hub6 allows to save 8 bytes per-uart_port on 64-bit platforms:
On my gcc, x86_64 sizeof(struct uart_port) goes from 528 to 520.
--- include/linux/serial_core.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
include/linux/serial_core.h +6 -5
@@ -161,11 +161,6 @@ struct uart_port {struct uart_icount icount;/* statistics */ struct console *cons;/* struct console, if any */ -#if defined(CONFIG_SERIAL_CORE_CONSOLE ) || defined(SUPPORT_SYSRQ ) -unsigned long sysrq;/* sysrq timeout */ -unsigned int sysrq_ch;/* char for sysrq */ -#endif -/* flags must be updated while holding port mutex */ upf_t flags;
@@ -244,6 +239,12 @@ struct uart_port {resource_size_t mapbase;/* for ioremap */ resource_size_t mapsize;struct device *dev;/* parent device */ + +#if defined(CONFIG_SERIAL_CORE_CONSOLE ) || defined(SUPPORT_SYSRQ ) +unsigned long sysrq;/* sysrq timeout */ +unsigned int sysrq_ch;/* char for sysrq */ +#endif +unsigned char hub6;/* this should be in the 8250 driver */ unsigned char suspended;unsigned char unused[2 ];
Signature · 1 line
2.24.0
Greg Kroah-Hartman
maintainerRe: [PATCH 02/58] serial: Move sysrq members above
Quoted 47 lines · Dmitry Safonov
At the current place members those follow are:
:upf_tflags;
:upstat_tstatus;
: inthw_stopped;
: unsigned int mctrl;
: unsigned int timeout;
: unsigned int type;
: const structuart_ops*ops;Together, they give (*ops) 8-byte align on 64-bit platforms. And
sysrq_chintroduces 4-byte padding.On the other side, above:
: struct device *dev;
: unsigned char hub6;
: unsigned char suspended;
: unsigned char unused[2];
: const char *name;Adds another 4-byte padding.
Moving sysrq members just before
hub6allows to save 8 bytes per-uart_port on 64-bit platforms:
On my gcc,x86_64sizeof(struct uart_port)goes from 528 to 520.Signed-off-by Dmitry Safonov <[email protected]>--- include/linux/serial_core.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)include/linux/serial_core.h +0
-5@@ -161,11 +161,6 @@ struct uart_port {struct uart_icount icount;/* statistics */ struct console *cons;/* struct console, if any */ -#if defined(CONFIG_SERIAL_CORE_CONSOLE ) || defined(SUPPORT_SYSRQ ) -unsigned long sysrq;/* sysrq timeout */ -unsigned int sysrq_ch;/* char for sysrq */ -#endif -/* flags must be updated while holding port mutex */ upf_t flags;
include/linux/serial_core.h struct uart_port { · line 246
Quoted 8 lines
include/linux/serial_core.h +5
-0@@ -244,6 +239,12 @@ struct uart_port {resource_size_t mapbase;/* for ioremap */ resource_size_t mapsize;struct device *dev;/* parent device */ + +#if defined(CONFIG_SERIAL_CORE_CONSOLE ) || defined(SUPPORT_SYSRQ ) +unsigned long sysrq;/* sysrq timeout */ +unsigned int sysrq_ch;/* char for sysrq */ +#endif
Let's just always have these 2 fields in the structure, no need for a #ifdef at all, right? There is no real "savings" from removing them (8 bytes for a structure that is maybe created 2-4 times per machine?)
That way it would keep any of this mess of if the SUPPORT_SYSRQ is enabled or not to keep everything in sync.
thanks,
greg k-h
PATCH 3/58 serial_core: Un-ifdef sysrq SUPPORT_SYSRQ
In reply to Dmitry SafonovThe SUPPORT_SYSRQ is messy: every .c source should define it before including "serial_core.h" if sysrq is supported or struct uart_port will differ in sizes. Also this prevents moving to serial_core.c functions:uart_handle_sysrq_char(), uart_prepare_sysrq_char(), uart_unlock_and_check_sysrq().
It doesn't save many bytes in the structure, and a better way to reduce it's size would be making rs485 and iso7816 pointers.
Introduce has_sysrq member to be used by serial line drivers further.
--- include/linux/serial_core.h | 77 +++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 34 deletions(-)
include/linux/serial_core.h +43 -34
@@ -240,14 +240,13 @@ struct uart_port {resource_size_t mapsize;struct device *dev;/* parent device */ -#if defined(CONFIG_SERIAL_CORE_CONSOLE ) || defined(SUPPORT_SYSRQ )unsigned long sysrq;/* sysrq timeout */ unsigned int sysrq_ch;/* char for sysrq */ -#endif +unsigned char has_sysrq;unsigned char hub6;/* this should be in the 8250 driver */ unsigned char suspended; -unsigned char unused[2 ]; +unsigned char unused;const char *name;/* port name */ struct attribute_group *attr_group;/* port specific attributes */ const struct attribute_group **tty_groups;/* all attributes (serial core use only) */
@@ -461,31 +460,46 @@ extern void uart_handle_cts_change(struct uart_port *uport,extern void uart_insert_char (struct uart_port *port,unsigned int status,unsigned int overrun,unsigned int ch,unsigned int flag); -#if defined(SUPPORT_SYSRQ ) && defined(CONFIG_MAGIC_SYSRQ_SERIAL )static inline int uart_handle_sysrq_char (struct uart_port *port,unsigned int ch) { -if (port->sysrq) { -if (ch &&time_before (jiffies, port->sysrq)) { -handle_sysrq (ch); - port->sysrq =0 ; -return 1 ; - } +if (!IS_ENABLED (CONFIG_MAGIC_SYSRQ_SERIAL )) +return 0 ; + +if (!port->has_sysrq && !IS_ENABLED (SUPPORT_SYSRQ )) +return 0 ; + +if (!port->sysrq) +return 0 ; + +if (ch &&time_before (jiffies, port->sysrq)) { +handle_sysrq (ch); port->sysrq =0 ; +return 1 ; } + port->sysrq =0 ; +return 0 ; }static inline int uart_prepare_sysrq_char (struct uart_port *port,unsigned int ch) { -if (port->sysrq) { -if (ch &&time_before (jiffies, port->sysrq)) { - port->sysrq_ch = ch; - port->sysrq =0 ; -return 1 ; - } +if (!IS_ENABLED (CONFIG_MAGIC_SYSRQ_SERIAL )) +return 0 ; + +if (!port->has_sysrq && !IS_ENABLED (SUPPORT_SYSRQ )) +return 0 ; + +if (!port->sysrq) +return 0 ; + +if (ch &&time_before (jiffies, port->sysrq)) { + port->sysrq_ch = ch; port->sysrq =0 ; +return 1 ; } + port->sysrq =0 ; +return 0 ; } static inline void
@@ -493,6 +507,11 @@ uart_unlock_and_check_sysrq(struct uart_port *port, unsigned long irqflags) {int sysrq_ch; +if (!port->has_sysrq && !IS_ENABLED (SUPPORT_SYSRQ )) { +spin_unlock_irqrestore (&port->lock, irqflags); +return ; + } + sysrq_ch = port->sysrq_ch; port->sysrq_ch =0 ;
@@ -501,17 +520,6 @@ uart_unlock_and_check_sysrq(struct uart_port *port, unsigned long irqflags)if (sysrq_ch)handle_sysrq (sysrq_ch); } -#else -static inline int -uart_handle_sysrq_char (struct uart_port *port,unsigned int ch) {return 0 ; } -static inline int -uart_prepare_sysrq_char (struct uart_port *port,unsigned int ch) {return 0 ; } -static inline void -uart_unlock_and_check_sysrq (struct uart_port *port,unsigned long irqflags) -{ -spin_unlock_irqrestore (&port->lock, irqflags); -} -#endif /* * We do the SysRQ and SAK checking like this...
@@ -523,15 +531,16 @@ static inline int uart_handle_break(struct uart_port *port)if (port->handle_break) port->handle_break (port); -#ifdef SUPPORT_SYSRQ -if (port->cons && port->cons->index == port->line) { -if (!port->sysrq) { - port->sysrq = jiffies +HZ *5 ; -return 1 ; +if (port->has_sysrq ||IS_ENABLED (SUPPORT_SYSRQ )) { +if (port->cons && port->cons->index == port->line) { +if (!port->sysrq) { + port->sysrq = jiffies +HZ *5 ; +return 1 ; + } + port->sysrq =0 ; } - port->sysrq =0 ; } -#endif +if (port->flags &UPF_SAK )do_SAK (state->port.tty);return 0 ;
Signature · 1 line
2.24.0
Greg Kroah-Hartman
maintainerRe: [PATCH 03/58] serial_core: Un-ifdef sysrq SUPPORT_SYSRQ
Quoted 6 lines · Dmitry Safonov
The
SUPPORT_SYSRQis messy: every .c source should define it before including "serial_core.h" if sysrq is supported or structuart_portwill differ in sizes. Also this prevents moving toserial_core.cfunctions:uart_handle_sysrq_char(),uart_prepare_sysrq_char(),uart_unlock_and_check_sysrq().
Quoted 6 lines
It doesn't save many bytes in the structure, and a better way to reduce it's size would be making rs485 and iso7816 pointers.
Introduce
has_sysrqmember to be used by serial line drivers further.Signed-off-by Dmitry Safonov <[email protected]>
Ah, you did what I asked here in patch 3. Nevermind on my comments on patch 2 :)
looks good, thanks!
greg k-h
Greg Kroah-Hartman
maintainerRe: [PATCH 03/58] serial_core: Un-ifdef sysrq SUPPORT_SYSRQ
In reply to Dmitry SafonovQuoted 8 lines · Dmitry Safonov
The
SUPPORT_SYSRQis messy: every .c source should define it before including "serial_core.h" if sysrq is supported or structuart_portwill differ in sizes. Also this prevents moving toserial_core.cfunctions:uart_handle_sysrq_char(),uart_prepare_sysrq_char(),uart_unlock_and_check_sysrq().It doesn't save many bytes in the structure, and a better way to reduce it's size would be making rs485 and iso7816 pointers.
Yes, the whole thing needs some work with the tool 'pahole' to fix it up.
thanks,
greg k-h
Greg Kroah-Hartman
maintainerRe: [PATCH 03/58] serial_core: Un-ifdef sysrq SUPPORT_SYSRQ
In reply to Dmitry SafonovQuoted 23 lines · Dmitry Safonov
The
SUPPORT_SYSRQis messy: every .c source should define it before including "serial_core.h" if sysrq is supported or structuart_portwill differ in sizes. Also this prevents moving toserial_core.cfunctions:uart_handle_sysrq_char(),uart_prepare_sysrq_char(),uart_unlock_and_check_sysrq().It doesn't save many bytes in the structure, and a better way to reduce it's size would be making rs485 and iso7816 pointers.
Introduce
has_sysrqmember to be used by serial line drivers further.Signed-off-by Dmitry Safonov <[email protected]>--- include/linux/serial_core.h | 77 +++++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 34 deletions(-)include/linux/serial_core.h +0
-0@@ -240,14 +240,13 @@ struct uart_port {resource_size_t mapsize;struct device *dev;/* parent device */
include/linux/serial_core.h struct uart_port { · line 250
Quoted 10 lines
include/linux/serial_core.h +1
-3-#if defined(CONFIG_SERIAL_CORE_CONSOLE ) || defined(SUPPORT_SYSRQ )unsigned long sysrq;/* sysrq timeout */ unsigned int sysrq_ch;/* char for sysrq */ -#endif +unsigned char has_sysrq;unsigned char hub6;/* this should be in the 8250 driver */ unsigned char suspended; -unsigned char unused[2 ];
Ugh, the samsung driver was using both of these fields to overload things for it's own use :(
It's not your fault, I'll go fix up that driver first before applying this one.
bah, what a horrid hack they did...
greg k-h
PATCH 4/58 tty/serial: Migrate aspeed_vuart to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/8250/8250_aspeed_vuart.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/8250/8250_aspeed_vuart.c +1 -4
@@ -5,10 +5,6 @@* Copyright (C) 2016 Jeremy Kerr <[email protected]>, IBM Corp. * Copyright (C) 2006 Arnd Bergmann <[email protected]>, IBM Corp. */ -#if defined(CONFIG_SERIAL_8250_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/device.h> #include <linux/module.h> #include <linux/of_address.h>
@@ -406,6 +402,7 @@ static int aspeed_vuart_probe(struct platform_device *pdev) port.port.unthrottle = aspeed_vuart_unthrottle; port.port.status =UPSTAT_SYNC_FIFO ; port.port.dev = &pdev->dev; + port.port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_8250_CONSOLE ); rc =sysfs_create_group (&vuart->dev->kobj, &aspeed_vuart_attr_group);if (rc <0 )
Signature · 1 line
2.24.0
Re: [PATCH 04/58] tty/serial: Migrate aspeed_vuart to use has_sysrq
Quoted 6 lines · Dmitry Safonov
The
SUPPORT_SYSRQifdeffery is not nice as:
- May create misunderstanding aboutsizeof(struct uart_port)between different objects
- Prevents moving functions fromserial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
Quoted 8 lines
In order to remove
SUPPORT_SYSRQ,has_sysrqvariable has been added. Initialise it in driver's probe and remove ifdeffery.Cc Andrew Jeffery <[email protected]>Cc Joel Stanley <[email protected]>Signed-off-by Dmitry Safonov <[email protected]>
PATCH 5/58 tty/serial: Migrate 8250_fsl to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- arch/powerpc/kernel/legacy_serial.c | 4 +++- drivers/tty/serial/8250/8250_fsl.c | 4 ---- drivers/tty/serial/8250/8250_of.c | 4 +++- 3 files changed, 6 insertions(+), 6 deletions(-)
arch/powerpc/kernel/legacy_serial.c +3 -1
@@ -479,8 +479,10 @@ static void __init fixup_port_irq(int index, port->irq = virq;#ifdef CONFIG_SERIAL_8250_FSL -if (of_device_is_compatible (np,"fsl,ns16550" )) +if (of_device_is_compatible (np,"fsl,ns16550" )) { port->handle_irq = fsl8250_handle_irq; + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_8250_CONSOLE ); + }#endif }
drivers/tty/serial/8250/8250_fsl.c +0 -4
@@ -1,8 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#if defined(CONFIG_SERIAL_8250_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/serial_reg.h> #include <linux/serial_8250.h>
drivers/tty/serial/8250/8250_of.c +3 -1
@@ -222,8 +222,10 @@ static int of_platform_serial_setup(struct platform_device *ofdev,if (IS_ENABLED (CONFIG_SERIAL_8250_FSL ) && (of_device_is_compatible (np,"fsl,ns16550" ) || -of_device_is_compatible (np,"fsl,16550-FIFO64" ))) +of_device_is_compatible (np,"fsl,16550-FIFO64" ))) { port->handle_irq = fsl8250_handle_irq; + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_8250_CONSOLE ); + }return 0 ; err_unprepare:
Signature · 1 line
2.24.0
PATCH 6/58 tty/serial: Migrate bcm63xx_uart to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/bcm63xx_uart.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/bcm63xx_uart.c +1 -4
@@ -10,10 +10,6 @@* my board. */ -#if defined(CONFIG_SERIAL_BCM63XX_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/init.h>
@@ -858,6 +854,7 @@ static int bcm_uart_probe(struct platform_device *pdev) port->fifosize =16 ; port->uartclk =clk_get_rate (clk) /2 ; port->line = pdev->id; + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_BCM63XX_CONSOLE );clk_put (clk); ret =uart_add_one_port (&bcm_uart_driver, port);
Signature · 1 line
2.24.0
PATCH 7/58 tty/serial: Migrate 8250_omap to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/8250/8250_omap.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/8250/8250_omap.c +1 -4
@@ -8,10 +8,6 @@* */ -#if defined(CONFIG_SERIAL_8250_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/clk.h> #include <linux/device.h> #include <linux/io.h>
@@ -1192,6 +1188,7 @@ static int omap8250_probe(struct platform_device *pdev) up.port.throttle = omap_8250_throttle; up.port.unthrottle = omap_8250_unthrottle; up.port.rs485_config = omap_8250_rs485_config; + up.port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_8250_CONSOLE ); ret =of_alias_get_id (np,"serial" );if (ret <0 ) {
Signature · 1 line
2.24.0
PATCH 8/58 tty/serial: Migrate 8250_port to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/8250/8250_port.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/8250/8250_port.c +1 -4
@@ -11,10 +11,6 @@* membase is an 'ioremapped' cookie. */ -#if defined(CONFIG_SERIAL_8250_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/module.h> #include <linux/moduleparam.h> #include <linux/ioport.h>
@@ -3055,6 +3051,7 @@ void serial8250_init_port(struct uart_8250_port *up)spin_lock_init (&port->lock); port->ops = &serial8250_pops; + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_8250_CONSOLE ); up->cur_iotype =0xFF ; }
Signature · 1 line
2.24.0
PATCH 9/58 tty/serial: Migrate amba-pl01* to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/amba-pl010.c | 5 +---- drivers/tty/serial/amba-pl011.c | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-)
drivers/tty/serial/amba-pl010.c +1 -4
@@ -15,10 +15,6 @@* and hooked into this driver. */ -#if defined(CONFIG_SERIAL_AMBA_PL010_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/module.h> #include <linux/ioport.h> #include <linux/init.h>
@@ -728,6 +724,7 @@ static int pl010_probe(struct amba_device *dev, const struct amba_id *id) uap->port.iotype =UPIO_MEM ; uap->port.irq = dev->irq[0 ]; uap->port.fifosize =16 ; + uap->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_AMBA_PL010_CONSOLE ); uap->port.ops = &amba_pl010_pops; uap->port.flags =UPF_BOOT_AUTOCONF ; uap->port.line = i;
drivers/tty/serial/amba-pl011.c +1 -5
@@ -16,11 +16,6 @@* and hooked into this driver. */ - -#if defined(CONFIG_SERIAL_AMBA_PL011_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/module.h> #include <linux/ioport.h> #include <linux/init.h>
@@ -2579,6 +2574,7 @@ static int pl011_setup_port(struct device *dev, struct uart_amba_port *uap, uap->port.mapbase = mmiobase->start; uap->port.membase = base; uap->port.fifosize = uap->fifosize; + uap->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_AMBA_PL011_CONSOLE ); uap->port.flags =UPF_BOOT_AUTOCONF ; uap->port.line = index;
Signature · 1 line
2.24.0
PATCH 10/58 tty/serial: Migrate apbuart to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/apbuart.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/apbuart.c +1 -4
@@ -11,10 +11,6 @@* Copyright (C) 2009 Kristoffer Glembo <[email protected]>, Aeroflex Gaisler AB */ -#if defined(CONFIG_SERIAL_GRLIB_GAISLER_APBUART_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/module.h> #include <linux/tty.h> #include <linux/tty_flip.h>
@@ -626,6 +622,7 @@ static int __init grlib_apbuart_configure(void) port->irq =0 ; port->iotype =UPIO_MEM ; port->ops = &grlib_apbuart_ops; + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_GRLIB_GAISLER_APBUART_CONSOLE ); port->flags =UPF_BOOT_AUTOCONF ; port->line = line; port->uartclk = *freq_hz;
Signature · 1 line
2.24.0
PATCH 11/58 tty/serial: Migrate arc_uart to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/arc_uart.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/arc_uart.c +1 -4
@@ -21,10 +21,6 @@* -check if sysreq works */ -#if defined(CONFIG_SERIAL_ARC_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/module.h> #include <linux/serial.h> #include <linux/console.h>
@@ -625,6 +621,7 @@ static int arc_serial_probe(struct platform_device *pdev) port->flags =UPF_BOOT_AUTOCONF ; port->line = dev_id; port->ops = &arc_serial_pops; + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_ARC_CONSOLE ); port->fifosize =ARC_UART_TX_FIFO_SIZE ;
Signature · 1 line
2.24.0
PATCH 12/58 tty/serial: Migrate atmel_serial to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
While at it, remove forward-declaration of atmel_console - it wasn't needed even at the moment the driver was first time introduced:
commit 1e6c9c2878c9 ("[ARM] 3242/2: AT91RM9200 support for 2.6 (Serial)")
--- drivers/tty/serial/atmel_serial.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/tty/serial/atmel_serial.c +1 -8
@@ -51,10 +51,6 @@#define ATMEL_RTS_HIGH_OFFSET 16#define ATMEL_RTS_LOW_OFFSET 20 -#if defined(CONFIG_SERIAL_ATMEL_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/serial_core.h> #include "serial_mctrl_gpio.h"
@@ -196,10 +192,6 @@ struct atmel_uart_port {static struct atmel_uart_port atmel_ports[ATMEL_MAX_UART ]; static DECLARE_BITMAP(atmel_ports_in_use, ATMEL_MAX_UART); -#ifdef SUPPORT_SYSRQ -static struct console atmel_console; -#endif -#if defined(CONFIG_OF )static const struct of_device_id atmel_serial_dt_ids[] = { { .compatible = "atmel,at91rm9200-usart-serial" },
@@ -2877,6 +2869,7 @@ static int atmel_serial_probe(struct platform_device *pdev) atmel_port = &atmel_ports[ret]; atmel_port->backup_imr =0 ; atmel_port->uart.line = ret; + atmel_port->uart.has_sysrq =IS_ENABLED (CONFIG_SERIAL_ATMEL_CONSOLE );atmel_serial_probe_fifos (atmel_port, pdev);atomic_set (&atmel_port->tasklet_shutdown,0 );
Signature · 7 lines
2.24.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 13/58 tty/serial: Migrate clps711x to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/clps711x.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/clps711x.c +1 -4
@@ -8,10 +8,6 @@* Copyright (C) 2000 Deep Blue Solutions Ltd. */ -#if defined(CONFIG_SERIAL_CLPS711X_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/module.h> #include <linux/device.h> #include <linux/console.h>
@@ -479,6 +475,7 @@ static int uart_clps711x_probe(struct platform_device *pdev) s->port.mapbase = res->start; s->port.type =PORT_CLPS711X ; s->port.fifosize =16 ; + s->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_CLPS711X_CONSOLE ); s->port.flags =UPF_SKIP_TEST |UPF_FIXED_TYPE ; s->port.uartclk =clk_get_rate (uart_clk); s->port.ops = &uart_clps711x_ops;
Signature · 1 line
2.24.0
PATCH 14/58 tty/serial: Migrate cpm_uart to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/tty/serial/cpm_uart/cpm_uart_core.c +2 -7
@@ -40,10 +40,6 @@#include <asm/fs_pd.h> #include <asm/udbg.h> -#if defined(CONFIG_SERIAL_CPM_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/serial_core.h> #include <linux/kernel.h>
@@ -347,9 +343,7 @@ static void cpm_uart_int_rx(struct uart_port *port)/* ASSUMPTION: it contains nothing valid */ i =0 ; } -#ifdef SUPPORT_SYSRQ port->sysrq =0 ; -#endif goto error_return; }
@@ -1204,7 +1198,8 @@ static int cpm_uart_init_port(struct device_node *np, pinfo->port.uartclk = ppc_proc_freq; pinfo->port.mapbase = (unsigned long )mem; pinfo->port.type =PORT_CPM ; - pinfo->port.ops = &cpm_uart_pops, + pinfo->port.ops = &cpm_uart_pops; + pinfo->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_CPM_CONSOLE ); pinfo->port.iotype =UPIO_MEM ; pinfo->port.fifosize = pinfo->tx_nrfifos * pinfo->tx_fifosize;spin_lock_init (&pinfo->port.lock);
Signature · 1 line
2.24.0
PATCH 15/58 tty/serial: Migrate dz to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/dz.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/dz.c +1 -4
@@ -29,10 +29,6 @@#undef DEBUG_DZ -#if defined(CONFIG_SERIAL_DZ_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/bitops.h> #include <linux/compiler.h> #include <linux/console.h>
@@ -787,6 +783,7 @@ static void __init dz_init_ports(void) uport->ops = &dz_ops; uport->line = line; uport->mapbase = base; + uport->has_sysrq =IS_ENABLED (CONFIG_SERIAL_DZ_CONSOLE ); } }
Signature · 1 line
2.24.0
PATCH 16/58 tty/serial: Migrate efm32-uart to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/efm32-uart.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/efm32-uart.c +1 -4
@@ -1,8 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#if defined(CONFIG_SERIAL_EFM32_UART_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/kernel.h> #include <linux/module.h> #include <linux/io.h>
@@ -748,6 +744,7 @@ static int efm32_uart_probe(struct platform_device *pdev) efm_port->port.type =PORT_EFMUART ; efm_port->port.iotype =UPIO_MEM32 ; efm_port->port.fifosize =2 ; + efm_port->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_EFM32_UART_CONSOLE ); efm_port->port.ops = &efm32_uart_pops; efm_port->port.flags =UPF_BOOT_AUTOCONF ;
Signature · 1 line
2.24.0
PATCH 17/58 tty/serial: Migrate fsl_linflexuart to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/fsl_linflexuart.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/tty/serial/fsl_linflexuart.c +1 -7
@@ -6,11 +6,6 @@* Copyright 2017-2019 NXP */ -#if defined(CONFIG_SERIAL_FSL_LINFLEXUART_CONSOLE ) && \ - defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/console.h> #include <linux/io.h> #include <linux/irq.h>
@@ -279,10 +274,8 @@ static irqreturn_t linflex_rxint(int irq, void *dev_id)if (brk) {uart_handle_break (sport); }else { -#ifdef SUPPORT_SYSRQ if (uart_handle_sysrq_char (sport, (unsigned char )rx))continue ; -#endif tty_insert_flip_char (port, rx, flg); } }
@@ -863,6 +856,7 @@ static int linflex_probe(struct platform_device *pdev) sport->irq =platform_get_irq (pdev,0 ); sport->ops = &linflex_pops; sport->flags =UPF_BOOT_AUTOCONF ; + sport->has_sysrq =IS_ENABLED (CONFIG_SERIAL_FSL_LINFLEXUART_CONSOLE ); linflex_ports[sport->line] = sport;
Signature · 1 line
2.24.0
PATCH 18/58 tty/serial: Migrate fsl_lpuart to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/fsl_lpuart.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/tty/serial/fsl_lpuart.c +1 -8
@@ -5,10 +5,6 @@* Copyright 2012-2014 Freescale Semiconductor, Inc. */ -#if defined(CONFIG_SERIAL_FSL_LPUART_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/clk.h> #include <linux/console.h> #include <linux/dma-mapping.h>
@@ -864,9 +860,7 @@ static void lpuart_rxint(struct lpuart_port *sport)if (sr &UARTSR1_OR ) flg =TTY_OVERRUN ; -#ifdef SUPPORT_SYSRQ sport->port.sysrq =0 ; -#endif }tty_insert_flip_char (port, rx, flg);
@@ -946,9 +940,7 @@ static void lpuart32_rxint(struct lpuart_port *sport)if (sr &UARTSTAT_OR ) flg =TTY_OVERRUN ; -#ifdef SUPPORT_SYSRQ sport->port.sysrq =0 ; -#endif }tty_insert_flip_char (port, rx, flg);
@@ -2461,6 +2453,7 @@ static int lpuart_probe(struct platform_device *pdev) sport->port.ops = &lpuart32_pops; else sport->port.ops = &lpuart_pops; + sport->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_FSL_LPUART_CONSOLE ); sport->port.flags =UPF_BOOT_AUTOCONF ;if (lpuart_is_32 (sport))
Signature · 1 line
2.24.0
PATCH 19/58 tty/serial: Migrate imx to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/imx.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/tty/serial/imx.c +1 -6
@@ -8,10 +8,6 @@* Copyright (C) 2004 Pengutronix */ -#if defined(CONFIG_SERIAL_IMX_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/module.h> #include <linux/ioport.h> #include <linux/init.h>
@@ -779,9 +775,7 @@ static irqreturn_t imx_uart_rxint(int irq, void *dev_id)if (rx &URXD_OVRRUN ) flg =TTY_OVERRUN ; -#ifdef SUPPORT_SYSRQ sport->port.sysrq =0 ; -#endif }if (sport->port.ignore_status_mask &URXD_DUMMY_READ )
@@ -2231,6 +2225,7 @@ static int imx_uart_probe(struct platform_device *pdev) sport->port.iotype =UPIO_MEM ; sport->port.irq = rxirq; sport->port.fifosize =32 ; + sport->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_IMX_CONSOLE ); sport->port.ops = &imx_uart_pops; sport->port.rs485_config = imx_uart_rs485_config; sport->port.flags =UPF_BOOT_AUTOCONF ;
Signature · 1 line
2.24.0
PATCH 20/58 tty/serial: Migrate ip22zilog to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/ip22zilog.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/tty/serial/ip22zilog.c +3 -4
@@ -38,10 +38,6 @@#include <asm/sgi/hpc3.h> #include <asm/sgi/ip22.h> -#if defined(CONFIG_SERIAL_IP22_ZILOG_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/serial_core.h> #include "ip22zilog.h"
@@ -1080,6 +1076,7 @@ static struct uart_driver ip22zilog_reg = {static void __init ip22zilog_prepare (void ) { +unsigned char sysrq_on =IS_ENABLED (CONFIG_SERIAL_IP22_ZILOG_CONSOLE );struct uart_ip22zilog_port *up;struct zilog_layout *rp;int channel, chip;
@@ -1115,6 +1112,7 @@ static void __init ip22zilog_prepare(void) up[(chip *2 ) +0 ].port.irq = zilog_irq; up[(chip *2 ) +0 ].port.uartclk =ZS_CLOCK ; up[(chip *2 ) +0 ].port.fifosize =1 ; + up[(chip *2 ) +0 ].port.has_sysrq = sysrq_on; up[(chip *2 ) +0 ].port.ops = &ip22zilog_pops; up[(chip *2 ) +0 ].port.type =PORT_IP22ZILOG ; up[(chip *2 ) +0 ].port.flags =0 ;
@@ -1126,6 +1124,7 @@ static void __init ip22zilog_prepare(void) up[(chip *2 ) +1 ].port.irq = zilog_irq; up[(chip *2 ) +1 ].port.uartclk =ZS_CLOCK ; up[(chip *2 ) +1 ].port.fifosize =1 ; + up[(chip *2 ) +1 ].port.has_sysrq = sysrq_on; up[(chip *2 ) +1 ].port.ops = &ip22zilog_pops; up[(chip *2 ) +1 ].port.type =PORT_IP22ZILOG ; up[(chip *2 ) +1 ].port.line = (chip *2 ) +1 ;
Signature · 1 line
2.24.0
PATCH 21/58 tty/serial: Migrate meson_uart to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/meson_uart.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/meson_uart.c +1 -4
@@ -5,10 +5,6 @@* Copyright (C) 2014 Carlo Caione <[email protected]> */ -#if defined(CONFIG_SERIAL_MESON_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/clk.h> #include <linux/console.h> #include <linux/delay.h>
@@ -703,6 +699,7 @@ static int meson_uart_probe(struct platform_device *pdev) port->mapsize =resource_size (res_mem); port->irq = res_irq->start; port->flags =UPF_BOOT_AUTOCONF |UPF_LOW_LATENCY ; + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_MESON_CONSOLE ); port->dev = &pdev->dev; port->line = pdev->id; port->type =PORT_MESON ;
Signature · 1 line
2.24.0
PATCH 22/58 tty/serial: Migrate milbeaut_usio to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/milbeaut_usio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/milbeaut_usio.c +1 -4
@@ -3,10 +3,6 @@* Copyright (C) 2018 Socionext Inc. */ -#if defined(CONFIG_SERIAL_MILBEAUT_USIO_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/clk.h> #include <linux/console.h> #include <linux/module.h>
@@ -537,6 +533,7 @@ static int mlb_usio_probe(struct platform_device *pdev) port->irq = mlb_usio_irq[index][RX ]; port->uartclk =clk_get_rate (clk); port->fifosize =128 ; + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_MILBEAUT_USIO_CONSOLE ); port->iotype =UPIO_MEM32 ; port->flags =UPF_BOOT_AUTOCONF |UPF_SPD_VHI ; port->line = index;
Signature · 1 line
2.24.0
PATCH 23/58 tty/serial: Migrate mpc52xx_uart to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/mpc52xx_uart.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/tty/serial/mpc52xx_uart.c +1 -6
@@ -44,10 +44,6 @@#include <asm/mpc52xx.h> #include <asm/mpc52xx_psc.h> -#if defined(CONFIG_SERIAL_MPC52xx_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/serial_core.h>
@@ -1382,12 +1378,10 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port) ch = psc_ops->read_char (port);/* Handle sysreq char */ -#ifdef SUPPORT_SYSRQ if (uart_handle_sysrq_char (port, ch)) { port->sysrq =0 ;continue ; } -#endif /* Store it */
@@ -1770,6 +1764,7 @@ static int mpc52xx_uart_of_probe(struct platform_device *op)spin_lock_init (&port->lock); port->uartclk = uartclk; port->fifosize =512 ; + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_MPC52xx_CONSOLE); port->iotype =UPIO_MEM ; port->flags =UPF_BOOT_AUTOCONF | (uart_console (port) ?0 :UPF_IOREMAP );
Signature · 1 line
2.24.0
PATCH 24/58 tty/serial: Don't zero port->sysrq
In reply to Dmitry Safonovuart_handle_sysrq_char() already does it.
--- drivers/tty/serial/mpc52xx_uart.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/mpc52xx_uart.c +1 -3
@@ -1378,10 +1378,8 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port) ch = psc_ops->read_char (port);/* Handle sysreq char */ -if (uart_handle_sysrq_char (port, ch)) { - port->sysrq =0 ; +if (uart_handle_sysrq_char (port, ch))continue ; - }/* Store it */
Signature · 1 line
2.24.0
PATCH 25/58 tty/serial: Migrate msm_serial to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/msm_serial.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/msm_serial.c +1 -4
@@ -7,10 +7,6 @@* Copyright (c) 2011, Code Aurora Forum. All rights reserved. */ -#if defined(CONFIG_SERIAL_MSM_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -# define SUPPORT_SYSRQ -#endif -#include <linux/kernel.h> #include <linux/atomic.h> #include <linux/dma-mapping.h>
@@ -1801,6 +1797,7 @@ static int msm_serial_probe(struct platform_device *pdev)if (unlikely (irq <0 ))return -ENXIO ; port->irq = irq; + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_MSM_CONSOLE );platform_set_drvdata (pdev, port);
Signature · 1 line
2.24.0
PATCH 26/58 tty/serial: Migrate mux to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/mux.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/mux.c +1 -4
@@ -25,11 +25,7 @@#include <asm/irq.h> #include <asm/parisc-device.h> -#if defined(CONFIG_SERIAL_MUX_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ )#include <linux/sysrq.h> -#define SUPPORT_SYSRQ -#endif -#include <linux/serial_core.h> #define MUX_OFFSET 0x800
@@ -483,6 +479,7 @@ static int __init mux_probe(struct parisc_device *dev) port->ops = &mux_pops; port->flags =UPF_BOOT_AUTOCONF ; port->line = port_cnt; + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_MUX_CONSOLE );/* The port->timeout needs to match what is present in * uart_wait_until_sent in serial_core.c. Otherwise
Signature · 1 line
2.24.0
PATCH 27/58 tty/serial: Migrate mxs-auart to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/mxs-auart.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/mxs-auart.c +1 -4
@@ -12,10 +12,6 @@* Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved. */ -#if defined(CONFIG_SERIAL_MXS_AUART_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h>
@@ -1693,6 +1689,7 @@ static int mxs_auart_probe(struct platform_device *pdev) s->port.fifosize =MXS_AUART_FIFO_SIZE ; s->port.uartclk =clk_get_rate (s->clk); s->port.type =PORT_IMX ; + s->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_MXS_AUART_CONSOLE );mxs_init_regs (s);
Signature · 1 line
2.24.0
PATCH 28/58 tty/serial: Migrate omap-serial to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/omap-serial.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/omap-serial.c +1 -4
@@ -16,10 +16,6 @@* this driver as required for the omap-platform. */ -#if defined(CONFIG_SERIAL_OMAP_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/module.h> #include <linux/init.h> #include <linux/console.h>
@@ -1680,6 +1676,7 @@ static int serial_omap_probe(struct platform_device *pdev) up->port.regshift =2 ; up->port.fifosize =64 ; up->port.ops = &serial_omap_pops; + up->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_OMAP_CONSOLE );if (pdev->dev.of_node) ret =of_alias_get_id (pdev->dev.of_node,"serial" );
Signature · 1 line
2.24.0
PATCH 29/58 tty/serial: Migrate pch_uart to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/pch_uart.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/tty/serial/pch_uart.c +1 -5
@@ -2,9 +2,6 @@/* *Copyright (C) 2011 LAPIS Semiconductor Co., Ltd. */ -#if defined(CONFIG_SERIAL_PCH_UART_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif #include <linux/kernel.h> #include <linux/serial_reg.h> #include <linux/slab.h>
@@ -587,12 +584,10 @@ static int pch_uart_hal_read(struct eg20t_port *priv, unsigned char *buf,if (uart_handle_break (port))continue ; } -#ifdef SUPPORT_SYSRQ if (port->sysrq) {if (uart_handle_sysrq_char (port, rbr))continue ; } -#endif buf[i++] = rbr; }
@@ -1796,6 +1791,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev, priv->port.flags =UPF_BOOT_AUTOCONF ; priv->port.fifosize = fifosize; priv->port.line = board->line_no; + priv->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_PCH_UART_CONSOLE ); priv->trigger =PCH_UART_HAL_TRIGGER_M ; snprintf(priv->irq_name, IRQ_NAME_SIZE,
Signature · 1 line
2.24.0
PATCH 30/58 tty/serial: Don't check port->sysrq
In reply to Dmitry Safonovuart_handle_sysrq_char() already handles it.
--- drivers/tty/serial/pch_uart.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/tty/serial/pch_uart.c +2 -4
@@ -584,10 +584,8 @@ static int pch_uart_hal_read(struct eg20t_port *priv, unsigned char *buf,if (uart_handle_break (port))continue ; } -if (port->sysrq) { -if (uart_handle_sysrq_char (port, rbr)) -continue ; - } +if (uart_handle_sysrq_char (port, rbr)) +continue ; buf[i++] = rbr; }
Signature · 1 line
2.24.0
PATCH 31/58 tty/serial: Migrate pmac_zilog to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/pmac_zilog.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/pmac_zilog.c +1 -4
@@ -61,10 +61,6 @@#define of_machine_is_compatible (x) (0)#endif -#if defined (CONFIG_SERIAL_PMACZILOG_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/serial.h> #include <linux/serial_core.h>
@@ -1721,6 +1717,7 @@ static int __init pmz_init_port(struct uart_pmac_port *uap) uap->control_reg = uap->port.membase; uap->data_reg = uap->control_reg +4 ; uap->port_type =0 ; + uap->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_PMACZILOG_CONSOLE );pmz_convert_to_zs (uap,CS8 ,0 ,9600 );
Signature · 1 line
2.24.0
PATCH 32/58 tty/serial: Migrate pnx8xxx_uart to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/pnx8xxx_uart.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/tty/serial/pnx8xxx_uart.c +1 -6
@@ -10,10 +10,6 @@* Copyright (C) 2000 Deep Blue Solutions Ltd. */ -#if defined(CONFIG_SERIAL_PNX8XXX_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/module.h> #include <linux/ioport.h> #include <linux/init.h>
@@ -220,9 +216,7 @@ static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport)else if (status &FIFO_TO_SM (PNX8XXX_UART_FIFO_RXFE )) flg =TTY_FRAME ; -#ifdef SUPPORT_SYSRQ sport->port.sysrq =0 ; -#endif }if (uart_handle_sysrq_char (&sport->port, ch))
@@ -800,6 +794,7 @@ static int pnx8xxx_serial_probe(struct platform_device *pdev)if (pnx8xxx_ports[i].port.mapbase != res->start)continue ; + pnx8xxx_ports[i].port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_PNX8XXX_CONSOLE ); pnx8xxx_ports[i].port.dev = &pdev->dev;uart_add_one_port (&pnx8xxx_reg, &pnx8xxx_ports[i].port);platform_set_drvdata (pdev, &pnx8xxx_ports[i]);
Signature · 1 line
2.24.0
PATCH 33/58 serial/f81534: Don't check port->sysrq
In reply to Dmitry Safonovusb_serial_handle_sysrq_char() already checks it.
--- drivers/usb/serial/f81534.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/usb/serial/f81534.c +2 -4
@@ -1238,10 +1238,8 @@ static void f81534_process_per_serial_block(struct usb_serial_port *port,schedule_work (&port_priv->lsr_work); } -if (port->port.console && port->sysrq) { -if (usb_serial_handle_sysrq_char (port, data[i])) -continue ; - } +if (usb_serial_handle_sysrq_char (port, data[i])) +continue ;tty_insert_flip_char (&port->port, data[i], tty_flag); }
Signature · 1 line
2.24.0
Johan Hovold
maintainerRe: [PATCH 33/58] serial/f81534: Don't check port->sysrq
Quoted 12 lines · Dmitry Safonov
usb_serial_handle_sysrq_char()already checks it.Signed-off-by Dmitry Safonov <[email protected]>--- drivers/usb/serial/f81534.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/usb/serial/f81534.c +0
-0
drivers/usb/serial/f81534.c static void f81534_process_per_serial_block(struct usb_serial_port *port, · line 1242
Quoted 9 lines
drivers/usb/serial/f81534.c +2
-4@@ -1238,10 +1238,8 @@ static void f81534_process_per_serial_block(struct usb_serial_port *port,schedule_work (&port_priv->lsr_work); } -if (port->port.console && port->sysrq) { -if (usb_serial_handle_sysrq_char (port, data[i])) -continue ; - } +if (usb_serial_handle_sysrq_char (port, data[i])) +continue ;
This is unrelated to the rest of the series.
Please break all usb-serial patches out of this series and submit them to me and the usb list for review.
Johan
Re: [PATCH 33/58] serial/f81534: Don't check port->sysrq
Hi Johan,
Quoted 9 lines · Johan Hovold
drivers/usb/serial/f81534.c static void f81534_process_per_serial_block(struct usb_serial_port *port, · line 1242
Quoted 6 lines · Dmitry Safonov
drivers/usb/serial/f81534.c +2
-4-if (port->port.console && port->sysrq) { -if (usb_serial_handle_sysrq_char (port, data[i])) -continue ; - } +if (usb_serial_handle_sysrq_char (port, data[i])) +continue ;This is unrelated to the rest of the series.
Right, will drop it from v2.
Quoted 3 lines
Please break all usb-serial patches out of this series and submit them to me and the usb list for review.
Thanks,
Dmitry
PATCH 34/58 tty/serial: Migrate pxa to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/pxa.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/pxa.c +1 -4
@@ -19,10 +19,6 @@*/ -#if defined(CONFIG_SERIAL_PXA_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/ioport.h> #include <linux/init.h> #include <linux/console.h>
@@ -879,6 +875,7 @@ static int serial_pxa_probe(struct platform_device *dev) sport->port.dev = &dev->dev; sport->port.flags =UPF_IOREMAP |UPF_BOOT_AUTOCONF ; sport->port.uartclk =clk_get_rate (sport->clk); + sport->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_PXA_CONSOLE ); ret =serial_pxa_probe_dt (dev, sport);if (ret >0 )
Signature · 1 line
2.24.0
PATCH 35/58 tty/serial: Migrate qcom_geni_serial to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/qcom_geni_serial.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/qcom_geni_serial.c +1 -4
@@ -1,10 +1,6 @@// SPDX-License-Identifier: GPL-2.0 // Copyright (c) 2017-2018, The Linux foundation. All rights reserved. -#if defined(CONFIG_SERIAL_QCOM_GENI_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -# define SUPPORT_SYSRQ -#endif -#include <linux/clk.h> #include <linux/console.h> #include <linux/io.h>
@@ -1308,6 +1304,7 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)if (irq <0 )return irq; uport->irq = irq; + uport->has_sysrq =IS_ENABLED (CONFIG_SERIAL_QCOM_GENI_CONSOLE );irq_set_status_flags (uport->irq,IRQ_NOAUTOEN ); ret = devm_request_irq(uport->dev, uport->irq, qcom_geni_serial_isr,
Signature · 1 line
2.24.0
PATCH 36/58 tty/serial: Migrate sa1100 to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/sa1100.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/tty/serial/sa1100.c +1 -6
@@ -7,10 +7,6 @@* Copyright (C) 2000 Deep Blue Solutions Ltd. */ -#if defined(CONFIG_SERIAL_SA1100_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/module.h> #include <linux/ioport.h> #include <linux/init.h>
@@ -214,9 +210,7 @@ sa1100_rx_chars(struct sa1100_port *sport)else if (status &UTSR1_TO_SM (UTSR1_FRE )) flg =TTY_FRAME ; -#ifdef SUPPORT_SYSRQ sport->port.sysrq =0 ; -#endif }if (uart_handle_sysrq_char (&sport->port, ch))
@@ -860,6 +854,7 @@ static int sa1100_serial_resume(struct platform_device *dev)static int sa1100_serial_add_one_port (struct sa1100_port *sport,struct platform_device *dev) { sport->port.dev = &dev->dev; + sport->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_SA1100_CONSOLE );// mctrl_gpio_init() requires that the GPIO driver supports interrupts, // but we need to support GPIO drivers for hardware that has no such
Signature · 1 line
2.24.0
PATCH 37/58 tty/serial: Migrate samsung_tty to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/samsung_tty.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/samsung_tty.c +1 -4
@@ -21,10 +21,6 @@* BJD, 04-Nov-2004 */ -#if defined(CONFIG_SERIAL_SAMSUNG_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/dmaengine.h> #include <linux/dma-mapping.h> #include <linux/slab.h>
@@ -1909,6 +1905,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) ourport->port.fifosize = ourport->drv_data->fifosize[index]; else if (ourport->info->fifosize) ourport->port.fifosize = ourport->info->fifosize; + ourport->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_SAMSUNG_CONSOLE );/* * DMA transfers must be aligned at least to cache line size,
Signature · 1 line
2.24.0
PATCH 38/58 tty/serial: Migrate sb1250-duart to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/sb1250-duart.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/sb1250-duart.c +1 -4
@@ -15,10 +15,6 @@* "BCM1250/BCM1125/BCM1125H User Manual", Broadcom Corporation */ -#if defined(CONFIG_SERIAL_SB1250_DUART_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/compiler.h> #include <linux/console.h> #include <linux/delay.h>
@@ -813,6 +809,7 @@ static void __init sbd_probe_duarts(void) uport->ops = &sbd_ops; uport->line = line; uport->mapbase =SBD_CHANREGS (line); + uport->has_sysrq =IS_ENABLED (CONFIG_SERIAL_SB1250_DUART_CONSOLE ); } } }
Signature · 1 line
2.24.0
PATCH 39/58 tty/serial: Migrate sccnxp to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/sccnxp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/sccnxp.c +1 -4
@@ -7,10 +7,6 @@* Based on sc26xx.c, by Thomas Bogendörfer ([email protected]) */ -#if defined(CONFIG_SERIAL_SCCNXP_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/clk.h> #include <linux/delay.h> #include <linux/err.h>
@@ -1000,6 +996,7 @@ static int sccnxp_probe(struct platform_device *pdev) s->port[i].regshift = s->pdata.reg_shift; s->port[i].uartclk = uartclk; s->port[i].ops = &sccnxp_ops; + s->port[i].has_sysrq =IS_ENABLED (CONFIG_SERIAL_SCCNXP_CONSOLE );uart_add_one_port (&s->uart, &s->port[i]);/* Set direction to input */ if (s->chip->flags &SCCNXP_HAVE_IO )
Signature · 1 line
2.24.0
PATCH 40/58 tty/serial: Migrate serial_txx9 to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/serial_txx9.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/serial_txx9.c +1 -4
@@ -12,10 +12,6 @@* Serial driver for TX3927/TX4927/TX4925/TX4938 internal SIO controller */ -#if defined(CONFIG_SERIAL_TXX9_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/module.h> #include <linux/ioport.h> #include <linux/init.h>
@@ -1095,6 +1091,7 @@ static int serial_txx9_probe(struct platform_device *dev) port.flags = p->flags; port.mapbase = p->mapbase; port.dev = &dev->dev; + port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_TXX9_CONSOLE ); ret =serial_txx9_register_port (&port);if (ret <0 ) { dev_err(&dev->dev, "unable to register port at index %d "
Signature · 1 line
2.24.0
PATCH 41/58 tty/serial: Migrate sh-sci to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/sh-sci.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/tty/serial/sh-sci.c +2 -8
@@ -15,10 +15,6 @@* Modified to support SH7300 SCIF. Takashi Kusuda (Jun 2003). * Removed SH7300 support (Jul 2007). */ -#if defined(CONFIG_SERIAL_SH_SCI_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#undef DEBUG#include <linux/clk.h>
@@ -2887,6 +2883,7 @@ static int sci_init_single(struct platform_device *dev, port->ops = &sci_uart_ops; port->iotype =UPIO_MEM ; port->line = index; + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_SH_SCI_CONSOLE ); res =platform_get_resource (dev,IORESOURCE_MEM ,0 );if (res ==NULL )
@@ -3015,12 +3012,9 @@ static void serial_console_write(struct console *co, const char *s,unsigned long flags;int locked =1 ; -#if defined(SUPPORT_SYSRQ )if (port->sysrq) locked =0 ; - else -#endif -if (oops_in_progress) +else if (oops_in_progress) locked =spin_trylock_irqsave (&port->lock, flags);else spin_lock_irqsave (&port->lock, flags);
Signature · 1 line
2.24.0
PATCH 42/58 tty/serial: Migrate sprd_serial to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/sprd_serial.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/sprd_serial.c +1 -4
@@ -3,10 +3,6 @@* Copyright (C) 2012-2015 Spreadtrum Communications Inc. */ -#if defined(CONFIG_SERIAL_SPRD_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/clk.h> #include <linux/console.h> #include <linux/delay.h>
@@ -1227,6 +1223,7 @@ static int sprd_probe(struct platform_device *pdev) up->fifosize =SPRD_FIFO_SIZE ; up->ops = &serial_sprd_ops; up->flags =UPF_BOOT_AUTOCONF ; + up->has_sysrq =IS_ENABLED (CONFIG_SERIAL_SPRD_CONSOLE ); ret =sprd_clk_init (up);if (ret)
Signature · 1 line
2.24.0
Re: [PATCH 42/58] tty/serial: Migrate sprd_serial to use has_sysrq
Quoted 7 lines · Dmitry Safonov
The
SUPPORT_SYSRQifdeffery is not nice as:
- May create misunderstanding aboutsizeof(struct uart_port)between different objects
- Prevents moving functions fromserial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
Quoted 7 lines
In order to remove
SUPPORT_SYSRQ,has_sysrqvariable has been added. Initialise it in driver's probe and remove ifdeffery.Cc Baolin Wang <[email protected]>Cc Chunyan Zhang <[email protected]>Cc Orson Zhai <[email protected]>Signed-off-by Dmitry Safonov <[email protected]>
Quoted 30 lines
--- drivers/tty/serial/sprd_serial.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/tty/serial/sprd_serial.c +1
-5@@ -3,10 +3,6 @@* Copyright (C) 2012-2015 Spreadtrum Communications Inc. */ -#if defined(CONFIG_SERIAL_SPRD_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/clk.h> #include <linux/console.h> #include <linux/delay.h> @@ -1227,6 +1223,7 @@ static int sprd_probe(struct platform_device *pdev) up->fifosize =SPRD_FIFO_SIZE ; up->ops = &serial_sprd_ops; up->flags =UPF_BOOT_AUTOCONF ; + up->has_sysrq =IS_ENABLED (CONFIG_SERIAL_SPRD_CONSOLE ); ret =sprd_clk_init (up);if (ret) --2.24.0
PATCH 43/58 tty/serial: Migrate st-asc to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/st-asc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/st-asc.c +1 -4
@@ -5,10 +5,6 @@* Copyright (C) 2003-2013 STMicroelectronics (R&D) Limited */ -#if defined(CONFIG_SERIAL_ST_ASC_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/module.h> #include <linux/serial.h> #include <linux/console.h>
@@ -730,6 +726,7 @@ static int asc_init_port(struct asc_port *ascport, port->fifosize =ASC_FIFO_SIZE ; port->dev = &pdev->dev; port->irq =platform_get_irq (pdev,0 ); + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_ST_ASC_CONSOLE ); res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); port->membase =devm_ioremap_resource (&pdev->dev, res);
Signature · 7 lines
2.24.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 44/58 tty/serial: Migrate stm32-usart to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/stm32-usart.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/stm32-usart.c +1 -4
@@ -8,10 +8,6 @@* Inspired by st-asc.c from STMicroelectronics (c) */ -#if defined(CONFIG_SERIAL_STM32_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/clk.h> #include <linux/console.h> #include <linux/delay.h>
@@ -926,6 +922,7 @@ static int stm32_init_port(struct stm32_port *stm32port, port->ops = &stm32_uart_ops; port->dev = &pdev->dev; port->fifosize = stm32port->info->cfg.fifosize; + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_STM32_CONSOLE ); ret =platform_get_irq (pdev,0 );if (ret <=0 )
Signature · 1 line
2.24.0
PATCH 45/58 tty/serial: Migrate sunhv to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/sunhv.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/sunhv.c +1 -4
@@ -25,10 +25,6 @@#include <asm/irq.h> #include <asm/setup.h> -#if defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/serial_core.h> #include <linux/sunserialcore.h>
@@ -552,6 +548,7 @@ static int hv_probe(struct platform_device *op) sunhv_port = port; + port->has_sysrq =1 ; port->line =0 ; port->ops = &sunhv_pops; port->type =PORT_SUNHV ;
Signature · 1 line
2.24.0
PATCH 46/58 tty/serial: Migrate sunsab to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/sunsab.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/sunsab.c +1 -4
@@ -40,10 +40,6 @@#include <asm/prom.h> #include <asm/setup.h> -#if defined(CONFIG_SERIAL_SUNSAB_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/serial_core.h> #include <linux/sunserialcore.h>
@@ -985,6 +981,7 @@ static int sunsab_init_one(struct uart_sunsab_port *up, up->port.fifosize =SAB82532_XMIT_FIFO_SIZE ; up->port.iotype =UPIO_MEM ; + up->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_SUNSAB_CONSOLE );writeb (SAB82532_IPC_IC_ACT_LOW , &up->regs->w.ipc);
Signature · 1 line
2.24.0
PATCH 47/58 tty/serial: Migrate sunsu to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/sunsu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/sunsu.c +1 -4
@@ -44,10 +44,6 @@#include <asm/prom.h> #include <asm/setup.h> -#if defined(CONFIG_SERIAL_SUNSU_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/serial_core.h> #include <linux/sunserialcore.h>
@@ -1475,6 +1471,7 @@ static int su_probe(struct platform_device *op) up->port.type =PORT_UNKNOWN ; up->port.uartclk = (SU_BASE_BAUD *16 ); + up->port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_SUNSU_CONSOLE ); err =0 ;if (up->su_type =SU_PORT_KBD || up->su_type =SU_PORT_MS ) {
Signature · 1 line
2.24.0
PATCH 48/58 tty/serial: Migrate sunzilog to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/sunzilog.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/tty/serial/sunzilog.c +2 -4
@@ -40,10 +40,6 @@#include <asm/prom.h> #include <asm/setup.h> -#if defined(CONFIG_SERIAL_SUNZILOG_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/serial_core.h> #include <linux/sunserialcore.h>
@@ -1444,6 +1440,7 @@ static int zs_probe(struct platform_device *op) up[0 ].port.line = (inst *2 ) +0 ; up[0 ].port.dev = &op->dev; up[0 ].flags |=SUNZILOG_FLAG_IS_CHANNEL_A ; + up[0 ].port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_SUNZILOG_CONSOLE );if (keyboard_mouse) up[0 ].flags |=SUNZILOG_FLAG_CONS_KEYB ;sunzilog_init_hw (&up[0 ]);
@@ -1461,6 +1458,7 @@ static int zs_probe(struct platform_device *op) up[1 ].port.line = (inst *2 ) +1 ; up[1 ].port.dev = &op->dev; up[1 ].flags |=0 ; + up[1 ].port.has_sysrq =IS_ENABLED (CONFIG_SERIAL_SUNZILOG_CONSOLE );if (keyboard_mouse) up[1 ].flags |=SUNZILOG_FLAG_CONS_MOUSE ;sunzilog_init_hw (&up[1 ]);
Signature · 1 line
2.24.0
PATCH 49/58 serial/ucc_uart: Remove ifdef SUPPORT_SYSRQ
In reply to Dmitry Safonovucc_uart doesn't seem to support console over itself, so maybe it can be deleted with uart_handle_sysrq_char() from the file.
--- drivers/tty/serial/ucc_uart.c | 2 -- 1 file changed, 2 deletions(-)
drivers/tty/serial/ucc_uart.c +0 -2
@@ -551,9 +551,7 @@ static void qe_uart_int_rx(struct uart_qe_port *qe_port)/* Overrun does not affect the current character ! */ if (status &BD_SC_OV )tty_insert_flip_char (tport,0 ,TTY_OVERRUN ); -#ifdef SUPPORT_SYSRQ port->sysrq =0 ; -#endif goto error_return; }
Signature · 1 line
2.24.0
PATCH 50/58 tty/serial: Migrate vr41xx_siu to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/vr41xx_siu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/vr41xx_siu.c +1 -4
@@ -7,10 +7,6 @@* Based on drivers/serial/8250.c, by Russell King. */ -#if defined(CONFIG_SERIAL_VR41XX_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/console.h> #include <linux/errno.h> #include <linux/init.h>
@@ -869,6 +865,7 @@ static int siu_probe(struct platform_device *dev) port = &siu_uart_ports[i]; port->ops = &siu_uart_ops; port->dev = &dev->dev; + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_VR41XX_CONSOLE ); retval =uart_add_one_port (&siu_uart_driver, port);if (retval <0 ) {
Signature · 1 line
2.24.0
PATCH 51/58 tty/serial: Migrate vt8500_serial to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/vt8500_serial.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/vt8500_serial.c +1 -4
@@ -7,10 +7,6 @@* Author: Robert Love <[email protected]> */ -#if defined(CONFIG_SERIAL_VT8500_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -# define SUPPORT_SYSRQ -#endif -#include <linux/hrtimer.h> #include <linux/delay.h> #include <linux/io.h>
@@ -703,6 +699,7 @@ static int vt8500_serial_probe(struct platform_device *pdev) vt8500_port->uart.line = port; vt8500_port->uart.dev = &pdev->dev; vt8500_port->uart.flags =UPF_IOREMAP |UPF_BOOT_AUTOCONF ; + vt8500_port->uart.has_sysrq =IS_ENABLED (CONFIG_SERIAL_VT8500_CONSOLE );/* Serial core uses the magic "16" everywhere - adjust for it */ vt8500_port->uart.uartclk = 16 * clk_get_rate(vt8500_port->clk) /
Signature · 1 line
2.24.0
PATCH 52/58 tty/serial: Migrate xilinx_uartps to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/xilinx_uartps.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/xilinx_uartps.c +1 -4
@@ -9,10 +9,6 @@* in the code. */ -#if defined(CONFIG_SERIAL_XILINX_PS_UART_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/platform_device.h> #include <linux/serial.h> #include <linux/console.h>
@@ -1634,6 +1630,7 @@ static int cdns_uart_probe(struct platform_device *pdev) port->flags =UPF_BOOT_AUTOCONF ; port->ops = &cdns_uart_ops; port->fifosize =CDNS_UART_FIFO_SIZE ; + port->has_sysrq =IS_ENABLED (CONFIG_SERIAL_XILINX_PS_UART_CONSOLE );/* * Register the port.
Signature · 1 line
2.24.0
PATCH 53/58 tty/serial: Migrate zs to use has_sysrq
In reply to Dmitry SafonovThe SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)
In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery.
--- drivers/tty/serial/zs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/zs.c +1 -4
@@ -44,10 +44,6 @@* complicated and prevents the use of some automatic modes of operation. */ -#if defined(CONFIG_SERIAL_ZS_CONSOLE ) && defined(CONFIG_MAGIC_SYSRQ ) -#define SUPPORT_SYSRQ -#endif -#include <linux/bug.h> #include <linux/console.h> #include <linux/delay.h>
@@ -1106,6 +1102,7 @@ static int __init zs_probe_sccs(void) zport->scc = &zs_sccs[chip]; zport->clk_mode =16 ; + uport->has_sysrq =IS_ENABLED (CONFIG_SERIAL_ZS_CONSOLE ); uport->irq = zs_parms.irq[chip]; uport->uartclk =ZS_CLOCK ; uport->fifosize =1 ;
Signature · 1 line
2.24.0
PATCH 54/58 serial_core: Remove SUPPORT_SYSRQ ifdeffery
In reply to Dmitry SafonovNo one defines it anymore.
--- include/linux/serial_core.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
include/linux/serial_core.h +4 -10
@@ -466,10 +466,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)if (!IS_ENABLED (CONFIG_MAGIC_SYSRQ_SERIAL ))return 0 ; -if (!port->has_sysrq && !IS_ENABLED (SUPPORT_SYSRQ )) -return 0 ; - -if (!port->sysrq) +if (!port->has_sysrq || !port->sysrq)return 0 ;if (ch &&time_before (jiffies, port->sysrq)) {
@@ -487,10 +484,7 @@ uart_prepare_sysrq_char(struct uart_port *port, unsigned int ch)if (!IS_ENABLED (CONFIG_MAGIC_SYSRQ_SERIAL ))return 0 ; -if (!port->has_sysrq && !IS_ENABLED (SUPPORT_SYSRQ )) -return 0 ; - -if (!port->sysrq) +if (!port->has_sysrq || !port->sysrq)return 0 ;if (ch &&time_before (jiffies, port->sysrq)) {
@@ -507,7 +501,7 @@ uart_unlock_and_check_sysrq(struct uart_port *port, unsigned long irqflags) {int sysrq_ch; -if (!port->has_sysrq && !IS_ENABLED (SUPPORT_SYSRQ )) { +if (!port->has_sysrq) {spin_unlock_irqrestore (&port->lock, irqflags);return ; }
@@ -531,7 +525,7 @@ static inline int uart_handle_break(struct uart_port *port)if (port->handle_break) port->handle_break (port); -if (port->has_sysrq ||IS_ENABLED (SUPPORT_SYSRQ )) { +if (port->has_sysrq) {if (port->cons && port->cons->index == port->line) {if (!port->sysrq) { port->sysrq = jiffies +HZ *5 ;
Signature · 1 line
2.24.0
Greg Kroah-Hartman
maintainerRe: [PATCH 54/58] serial_core: Remove SUPPORT_SYSRQ ifdeffery
Quoted 6 lines · Dmitry Safonov
No one defines it anymore.
Signed-off-by Dmitry Safonov <[email protected]>--- include/linux/serial_core.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
I've applied this series up to here, skipping the usb-serial driver patch that Johan called out.
Can you rebase your series and resend the remaining based on my tty-next tree, after these patches move there (give them 24 hours to get through 0-day testing.)
thanks,
greg k-h
Re: [PATCH 54/58] serial_core: Remove SUPPORT_SYSRQ ifdeffery
Quoted 8 lines · Greg Kroah-Hartman
Quoted 6 lines · Dmitry Safonov
No one defines it anymore.
Signed-off-by Dmitry Safonov <[email protected]>--- include/linux/serial_core.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
Quoted 6 lines
I've applied this series up to here, skipping the usb-serial driver patch that Johan called out.
Can you rebase your series and resend the remaining based on my tty-next tree, after these patches move there (give them 24 hours to get through 0-day testing.)
Thanks much, Greg, will do!
Thanks,
Dmitry
PATCH 55/58 usb/serial: Don't handle break when CONFIG_MAGIC_SYSRQ is disabled
In reply to Dmitry SafonovWhile at it, remove ifdeffery around usb_serial_handle_sysrq_char() as it doesn't save much from .text anyway.
--- drivers/usb/serial/generic.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/usb/serial/generic.c +3 -7
@@ -571,7 +571,6 @@ int usb_serial_generic_get_icount(struct tty_struct *tty, }EXPORT_SYMBOL_GPL (usb_serial_generic_get_icount); -#ifdef CONFIG_MAGIC_SYSRQ int usb_serial_handle_sysrq_char (struct usb_serial_port *port,unsigned int ch) {if (port->sysrq && port->port.console) {
@@ -584,16 +583,13 @@ int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch) }return 0 ; } -#else -int usb_serial_handle_sysrq_char (struct usb_serial_port *port,unsigned int ch) -{ -return 0 ; -} -#endif EXPORT_SYMBOL_GPL (usb_serial_handle_sysrq_char);int usb_serial_handle_break (struct usb_serial_port *port) { +if (!IS_ENABLED (CONFIG_MAGIC_SYSRQ )) +return 0 ; +if (!port->sysrq) { port->sysrq = jiffies +HZ *5 ;return 1 ;
Signature · 1 line
2.24.0
PATCH 56/58 serial_core: Move sysrq functions from header file
In reply to Dmitry SafonovIt's not worth to have them in every serial driver and I'm about to add another one.
--- drivers/tty/serial/serial_core.c | 83 +++++++++++++++++++++++++++++++ include/linux/serial_core.h | 84 ++------------------------------ 2 files changed, 88 insertions(+), 79 deletions(-)
drivers/tty/serial/serial_core.c +83 -0
@@ -3080,6 +3080,89 @@ void uart_insert_char(struct uart_port *port, unsigned int status, }EXPORT_SYMBOL_GPL (uart_insert_char); +int uart_handle_sysrq_char (struct uart_port *port,unsigned int ch) +{ +if (!IS_ENABLED (CONFIG_MAGIC_SYSRQ_SERIAL )) +return 0 ; + +if (!port->has_sysrq || !port->sysrq) +return 0 ; + +if (ch &&time_before (jiffies, port->sysrq)) { +handle_sysrq (ch); + port->sysrq =0 ; +return 1 ; + } + port->sysrq =0 ; + +return 0 ; +} +EXPORT_SYMBOL_GPL (uart_handle_sysrq_char); + +int uart_prepare_sysrq_char (struct uart_port *port,unsigned int ch) +{ +if (!IS_ENABLED (CONFIG_MAGIC_SYSRQ_SERIAL )) +return 0 ; + +if (!port->has_sysrq || !port->sysrq) +return 0 ; + +if (ch &&time_before (jiffies, port->sysrq)) { + port->sysrq_ch = ch; + port->sysrq =0 ; +return 1 ; + } + port->sysrq =0 ; + +return 0 ; +} +EXPORT_SYMBOL_GPL (uart_prepare_sysrq_char); + +void uart_unlock_and_check_sysrq (struct uart_port *port,unsigned long irqflags) +{ +int sysrq_ch; + +if (!port->has_sysrq) { +spin_unlock_irqrestore (&port->lock, irqflags); +return ; + } + + sysrq_ch = port->sysrq_ch; + port->sysrq_ch =0 ; + +spin_unlock_irqrestore (&port->lock, irqflags); + +if (sysrq_ch) +handle_sysrq (sysrq_ch); +} +EXPORT_SYMBOL_GPL (uart_unlock_and_check_sysrq); + +/* +* We do the SysRQ and SAK checking like this... +*/ +int uart_handle_break (struct uart_port *port) +{ +struct uart_state *state = port->state; + +if (port->handle_break) + port->handle_break (port); + +if (port->has_sysrq) { +if (port->cons && port->cons->index == port->line) { +if (!port->sysrq) { + port->sysrq = jiffies +HZ *5 ; +return 1 ; + } + port->sysrq =0 ; + } + } + +if (port->flags &UPF_SAK ) +do_SAK (state->port.tty); +return 0 ; +} +EXPORT_SYMBOL_GPL (uart_handle_break); +EXPORT_SYMBOL (uart_write_wakeup);EXPORT_SYMBOL (uart_register_driver);EXPORT_SYMBOL (uart_unregister_driver);
include/linux/serial_core.h +5 -79
90 lines not on this page · raw message
Signature · 1 line
2.24.0
PATCH 57/58 sysctl/sysrq: Remove __sysrq_enabled copy
In reply to Dmitry SafonovMany embedded boards have a disconnected TTL level serial which can generate some garbage that can lead to spurious false sysrq detects.
Currently, sysrq can be either completely disabled for serial console or always disabled (with CONFIG_MAGIC_SYSRQ_SERIAL), since
commit 732dbf3a6104 ("serial: do not accept sysrq characters via serial port")
At Arista, we have such boards that can generate BREAK and random garbage. While disabling sysrq for serial console would solve the problem with spurious false sysrq triggers, it's also desirable to have a way to enable sysrq back.
Having the way to enable sysrq was beneficial to debug lockups with a manual investigation in field and on the other side preventing false sysrq detections.
As a preparation to add sysrq_toggle_support() call into uart, remove a private copy of sysrq_enabled from sysctl - it should reflect the actual status of sysrq.
Furthermore, the private copy isn't correct already in case sysrq_always_enabled is true. So, remove __sysrq_enabled and use a getter-helper for sysrq enabled status.
--- drivers/tty/sysrq.c | 7 +++++++ include/linux/sysrq.h | 1 + kernel/sysctl.c | 41 ++++++++++++++++++++++------------------- 3 files changed, 30 insertions(+), 19 deletions(-)
drivers/tty/sysrq.c +7 -0
@@ -73,6 +73,13 @@ static bool sysrq_on_mask(int mask) (sysrq_enabled & mask); } +int sysrq_get_mask (void ) +{ +if (sysrq_always_enabled) +return 1 ; +return sysrq_enabled; +} +static int __init sysrq_always_enabled_setup (char *str) { sysrq_always_enabled = true;
include/linux/sysrq.h +1 -0
@@ -50,6 +50,7 @@ int unregister_sysrq_key(int key, struct sysrq_key_op *op);struct sysrq_key_op *__sysrq_get_key_op (int key);int sysrq_toggle_support (int enable_mask); +int sysrq_get_mask (void );#else
kernel/sysctl.c +22 -19
60 lines not on this page · raw message
Signature · 1 line
2.24.0
PATCH 58/58 serial/sysrq: Add MAGIC_SYSRQ_SERIAL_SEQUENCE
In reply to Dmitry SafonovMany embedded boards have a disconnected TTL level serial which can generate some garbage that can lead to spurious false sysrq detects.
Currently, sysrq can be either completely disabled for serial console or always disabled (with CONFIG_MAGIC_SYSRQ_SERIAL), since
commit 732dbf3a6104 ("serial: do not accept sysrq characters via serial port")
At Arista, we have such boards that can generate BREAK and random garbage. While disabling sysrq for serial console would solve the problem with spurious false sysrq triggers, it's also desirable to have a way to enable sysrq back.
As a measure of balance between on and off options, add MAGIC_SYSRQ_SERIAL_SEQUENCE which is a string sequence that can enable sysrq if it follows BREAK on a serial line. The longer the string - the less likely it may be in the garbage.
Having the way to enable sysrq was beneficial to debug lockups with a manual investigation in field and on the other side preventing false sysrq detections.
--- drivers/tty/serial/serial_core.c | 52 ++++++++++++++++++++++++++++---- include/linux/serial_core.h | 2 +- lib/Kconfig.debug | 8 +++++ 3 files changed, 55 insertions(+), 7 deletions(-)
drivers/tty/serial/serial_core.c +46 -6
@@ -3080,6 +3080,38 @@ void uart_insert_char(struct uart_port *port, unsigned int status, }EXPORT_SYMBOL_GPL (uart_insert_char); +const char sysrq_toggle_seq[] =CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE ; + +static void uart_sysrq_on (struct work_struct *w) +{ +sysrq_toggle_support (1 ); +pr_info ("SysRq is enabled by magic sequience on serial\n" ); +} +static DECLARE_WORK(sysrq_enable_work, uart_sysrq_on); + +static int uart_try_toggle_sysrq (struct uart_port *port,unsigned int ch) +{ +if (sysrq_toggle_seq[0 ] =='\0' ) +return 0 ; + +BUILD_BUG_ON (ARRAY_SIZE (sysrq_toggle_seq) >=sizeof (port->sysrq_seq)*U8_MAX ); +if (sysrq_toggle_seq[port->sysrq_seq] != ch) { + port->sysrq_seq =0 ; +return 0 ; + } + +/* Without the last \0 */ +if (++port->sysrq_seq < (ARRAY_SIZE (sysrq_toggle_seq) -1 )) { + port->sysrq = jiffies +HZ *5 ; +return 1 ; + } + +schedule_work (&sysrq_enable_work); + + port->sysrq =0 ; +return 1 ; +} +int uart_handle_sysrq_char (struct uart_port *port,unsigned int ch) {if (!IS_ENABLED (CONFIG_MAGIC_SYSRQ_SERIAL ))
@@ -3089,9 +3121,13 @@ int uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)return 0 ;if (ch &&time_before (jiffies, port->sysrq)) { -handle_sysrq (ch); - port->sysrq =0 ; -return 1 ; +if (sysrq_get_mask ()) { +handle_sysrq (ch); + port->sysrq =0 ; +return 1 ; + } +if (uart_try_toggle_sysrq (port, ch)) +return 1 ; } port->sysrq =0 ;
@@ -3108,9 +3144,13 @@ int uart_prepare_sysrq_char(struct uart_port *port, unsigned int ch)return 0 ;if (ch &&time_before (jiffies, port->sysrq)) { - port->sysrq_ch = ch; - port->sysrq =0 ; -return 1 ; +if (sysrq_get_mask ()) { + port->sysrq_ch = ch; + port->sysrq =0 ; +return 1 ; + } +if (uart_try_toggle_sysrq (port, ch)) +return 1 ; } port->sysrq =0 ;
include/linux/serial_core.h +1 -1
@@ -243,10 +243,10 @@ struct uart_port {unsigned long sysrq;/* sysrq timeout */ unsigned int sysrq_ch;/* char for sysrq */ unsigned char has_sysrq; +unsigned char sysrq_seq;/* index in sysrq_toggle_seq */ unsigned char hub6;/* this should be in the 8250 driver */ unsigned char suspended; -unsigned char unused;const char *name;/* port name */ struct attribute_group *attr_group;/* port specific attributes */ const struct attribute_group **tty_groups;/* all attributes (serial core use only) */
lib/Kconfig.debug +8 -0
@@ -431,6 +431,14 @@ config MAGIC_SYSRQ_SERIAL This option allows you to decide whether you want to enable the magic SysRq key. +config MAGIC_SYSRQ_SERIAL_SEQUENCE + string "Char sequence that enables magic SysRq over serial" + depends on MAGIC_SYSRQ_SERIAL + default "" + help + Specifies a sequence of characters that can follow BREAK to enable + SysRq on a serial console. + config DEBUG_FS bool "Debug Filesystem" help
Signature · 1 line
2.24.0
Le 13/12/2019 ? 01:05, Dmitry Safonov a ?crit?:
Quoted 68 lines
The original purpose of the patches set was to add a way to enable sysrq on a uart where currently it can be constantly either on or off (
CONFIG_MAGIC_SYSRQ_SERIAL), see the last patch:
"serial/sysrq: AddMAGIC_SYSRQ_SERIAL_SEQUENCE"But to do that, I had to add
uart_try_toggle_sysrq()and I didn't want to bloatserial_core.heven more. So, I did cleanup by removingSUPPORT_SYSRQresulting in a nice diff-stat and lesser ifdeffery.Most patches are one-liners, I decided to keep them separated per-driver to let reviewers easier follow the purpose.
Cc Greg Kroah-Hartman <[email protected]>Cc Jiri Slaby <[email protected]>Cc Vasiliy Khoruzhick <[email protected]>Cc linux-serial at vger.kernel.orgDmitry Safonov (58):
sysrq: Removesysrq_handler_registered
serial: Move sysrq members above
serial_core: Un-ifdef sysrqSUPPORT_SYSRQtty/serial: Migrateaspeed_vuartto usehas_sysrqtty/serial: Migrate 8250_fsl to usehas_sysrqtty/serial: Migratebcm63xx_uartto usehas_sysrqtty/serial: Migrate 8250_omap to usehas_sysrqtty/serial: Migrate 8250_port to usehas_sysrqtty/serial: Migrate amba-pl01* to usehas_sysrqtty/serial: Migrate apbuart to usehas_sysrqtty/serial: Migratearc_uartto usehas_sysrqtty/serial: Migrateatmel_serialto usehas_sysrqtty/serial: Migrate clps711x to usehas_sysrqtty/serial: Migratecpm_uartto usehas_sysrqtty/serial: Migrate dz to usehas_sysrqtty/serial: Migrate efm32-uart to usehas_sysrqtty/serial: Migratefsl_linflexuartto usehas_sysrqtty/serial: Migratefsl_lpuartto usehas_sysrqtty/serial: Migrate imx to usehas_sysrqtty/serial: Migrate ip22zilog to usehas_sysrqtty/serial: Migratemeson_uartto usehas_sysrqtty/serial: Migratemilbeaut_usioto usehas_sysrqtty/serial: Migratempc52xx_uartto usehas_sysrqtty/serial: Don't zeroport->sysrqtty/serial: Migratemsm_serialto usehas_sysrqtty/serial: Migrate mux to usehas_sysrqtty/serial: Migrate mxs-auart to usehas_sysrqtty/serial: Migrate omap-serial to usehas_sysrqtty/serial: Migratepch_uartto usehas_sysrqtty/serial: Don't checkport->sysrqtty/serial: Migratepmac_zilogto usehas_sysrqtty/serial: Migratepnx8xxx_uartto usehas_sysrqserial/f81534: Don't checkport->sysrqtty/serial: Migrate pxa to usehas_sysrqtty/serial: Migrateqcom_geni_serialto usehas_sysrqtty/serial: Migrate sa1100 to usehas_sysrqtty/serial: Migratesamsung_ttyto usehas_sysrqtty/serial: Migrate sb1250-duart to usehas_sysrqtty/serial: Migrate sccnxp to usehas_sysrqtty/serial: Migrateserial_txx9to usehas_sysrqtty/serial: Migrate sh-sci to usehas_sysrqtty/serial: Migratesprd_serialto usehas_sysrqtty/serial: Migrate st-asc to usehas_sysrqtty/serial: Migrate stm32-usart to usehas_sysrqtty/serial: Migrate sunhv to usehas_sysrqtty/serial: Migrate sunsab to usehas_sysrqtty/serial: Migrate sunsu to usehas_sysrqtty/serial: Migrate sunzilog to usehas_sysrqserial/ucc_uart: Remove ifdefSUPPORT_SYSRQtty/serial: Migratevr41xx_siuto usehas_sysrq
Quoted 8 lines
tty/serial: Migrate
vt8500_serialto usehas_sysrqtty/serial: Migratexilinx_uartpsto usehas_sysrqtty/serial: Migrate zs to usehas_sysrq
serial_core: RemoveSUPPORT_SYSRQifdeffery
usb/serial: Don't handle break whenCONFIG_MAGIC_SYSRQis disabled
serial_core: Move sysrq functions from header file sysctl/sysrq: Remove__sysrq_enabledcopy
serial/sysrq: AddMAGIC_SYSRQ_SERIAL_SEQUENCE
powerpc patchwork didn't get the full series, see
https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=148198
Can't find them on linux-serial patchwork either
(https://patches.linaro.org/project/linux-serial/list/)
It is impossible to review/test powerpc bits without the first patches of the series, where can the entire series be found ?
Christophe
Quoted 61 lines
arch/powerpc/kernel/legacy_serial.c | 4 +- drivers/tty/serial/8250/8250_aspeed_vuart.c | 5 +- drivers/tty/serial/8250/8250_fsl.c | 4 - drivers/tty/serial/8250/8250_of.c | 4 +- drivers/tty/serial/8250/8250_omap.c | 5 +- drivers/tty/serial/8250/8250_port.c | 5 +- drivers/tty/serial/amba-pl010.c | 5 +- drivers/tty/serial/amba-pl011.c | 6 +- drivers/tty/serial/apbuart.c | 5 +- drivers/tty/serial/arc_uart.c | 5 +- drivers/tty/serial/atmel_serial.c | 9 +- drivers/tty/serial/bcm63xx_uart.c | 5 +- drivers/tty/serial/clps711x.c | 5 +- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 9 +- drivers/tty/serial/dz.c | 5 +- drivers/tty/serial/efm32-uart.c | 5 +- drivers/tty/serial/fsl_linflexuart.c | 8 +- drivers/tty/serial/fsl_lpuart.c | 9 +- drivers/tty/serial/imx.c | 7 +- drivers/tty/serial/ip22zilog.c | 7 +- drivers/tty/serial/meson_uart.c | 5 +- drivers/tty/serial/milbeaut_usio.c | 5 +- drivers/tty/serial/mpc52xx_uart.c | 11 +- drivers/tty/serial/msm_serial.c | 5 +- drivers/tty/serial/mux.c | 5 +- drivers/tty/serial/mxs-auart.c | 5 +- drivers/tty/serial/omap-serial.c | 5 +- drivers/tty/serial/pch_uart.c | 12 +- drivers/tty/serial/pmac_zilog.c | 5 +- drivers/tty/serial/pnx8xxx_uart.c | 7 +- drivers/tty/serial/pxa.c | 5 +- drivers/tty/serial/qcom_geni_serial.c | 5 +- drivers/tty/serial/sa1100.c | 7 +- drivers/tty/serial/samsung_tty.c | 5 +- drivers/tty/serial/sb1250-duart.c | 5 +- drivers/tty/serial/sccnxp.c | 5 +- drivers/tty/serial/serial_core.c | 123 ++++++++++++++++++++ drivers/tty/serial/serial_txx9.c | 5 +- drivers/tty/serial/sh-sci.c | 10 +- drivers/tty/serial/sprd_serial.c | 5 +- drivers/tty/serial/st-asc.c | 5 +- drivers/tty/serial/stm32-usart.c | 5 +- drivers/tty/serial/sunhv.c | 5 +- drivers/tty/serial/sunsab.c | 5 +- drivers/tty/serial/sunsu.c | 5 +- drivers/tty/serial/sunzilog.c | 6 +- drivers/tty/serial/ucc_uart.c | 2 - drivers/tty/serial/vr41xx_siu.c | 5 +- drivers/tty/serial/vt8500_serial.c | 5 +- drivers/tty/serial/xilinx_uartps.c | 5 +- drivers/tty/serial/zs.c | 5 +- drivers/tty/sysrq.c | 16 +-- drivers/usb/serial/f81534.c | 6 +- drivers/usb/serial/generic.c | 10 +- include/linux/serial_core.h | 92 ++------------- include/linux/sysrq.h | 1 + kernel/sysctl.c | 41 ++++--- lib/Kconfig.debug | 8 ++ 58 files changed, 238 insertions(+), 346 deletions(-)
Hi Christophe,
Quoted 1 line · Christophe Leroy
Le 13/12/2019 ? 01:05, Dmitry Safonov a ?crit?:
[..]
Quoted 3 lines
powerpc patchwork didn't get the full series, see
https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=148198
Yes, I was under impression that architecture mail-lists want related patches. But now I see that from the patchwork point of view it's better to have the whole series in inbox.
Quoted 2 lines
Can't find them on linux-serial patchwork either
(https://patches.linaro.org/project/linux-serial/list/)
I'm not sure - maybe the frequency of checking is low? I see all patches in linux-serial ml:
https://marc.info/?l=linux-serial&r=1&b=201912&w=2
Quoted 2 lines
It is impossible to review/test powerpc bits without the first patches of the series, where can the entire series be found ?
Sorry for the inconvenience.
I can resend without Cc'ing all people just to ppc mail-list if that works for you. Or you can clone it directly from my github:
https://github.com/0x7f454c46/linux/tree/sysrq-serial-seq-v1
Thanks,
Dmitry