Skip to contentSkip to conversation

serial: digicolor: fix sysrq handling

PATCH In review Arnd Bergmann 2 participants 2 messages Jan 13, 2015 – Jan 14, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: digicolor: fix sysrq handling

Trying to build the digicolor-usart driver when sysrq is disabled results in a compile error:

drivers/tty/serial/digicolor-usart.c: In function 'digicolor_uart_console_write':
drivers/tty/serial/digicolor-usart.c:407:33: error: 'struct uart_port' has no member named 'sysrq'

Like a lot of other drivers, this one requires an #ifdef to avoid accessing the sysrq field here. While looking into this, I noticed that the case where sysrq support is enabled is also broken, because the driver fails to set the SUPPORT_SYSRQ macro.

This patch hopefully fixes both, but I do not hardware to test if sysrq is actually working now.

drivers/tty/serial/digicolor-usart.c +6 -1
index 09ce0b3764e2..1e4bdd895804 100644
@@ -23,6 +23,10 @@
 #include <linux/platform_device.h>
 #include <linux/workqueue.h>
 
+#if defined(CONFIG_SERIAL_CONEXANT_DIGICOLOR_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+#define SUPPORT_SYSRQ
+#endif
+
 #define UA_ENABLE			0x00
 #define UA_ENABLE_ENABLE		BIT(0)
 
@@ -403,10 +407,11 @@ static void digicolor_uart_console_write(struct console *co, const char *c,
 	u8 status;
 	unsigned long flags;
 	int locked = 1;
-
+#ifdef SUPPORT_SYSRQ
 	if (port->sysrq || oops_in_progress)
 		locked = spin_trylock_irqsave(&port->lock, flags);
 	else
+#endif
 		spin_lock_irqsave(&port->lock, flags);
 
 	uart_console_write(port, c, n, digicolor_uart_console_putchar);
maintainer
#1 lore raw

Hi Arnd,

Quoted 6 lines · Arnd Bergmann

Trying to build the digicolor-usart driver when sysrq is disabled results in a compile error:

drivers/tty/serial/digicolor-usart.c: In function 'digicolor_uart_console_write':
drivers/tty/serial/digicolor-usart.c:407:33: error: 'struct uart_port' has no member named 'sysrq'

Quoted 7 lines

Like a lot of other drivers, this one requires an #ifdef to avoid accessing the sysrq field here. While looking into this, I noticed that the case where sysrq support is enabled is also broken, because the driver fails to set the SUPPORT_SYSRQ macro.

This patch hopefully fixes both, but I do not hardware to test if sysrq is actually working now.

Unfortunately the hardware is not able to detect the BREAK condition, so it is not possible to support sysrq on this hardware. I'll send a patch removing sysrq reference.

Thanks for build testing and reporting.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -