Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: serial: 21285: fix lockup on open

Commit 293f89959483 ("tty: serial: 21285: stop using the unused[]
variable from struct uart_port") introduced a bug which stops the
transmit interrupt being disabled when there are no characters to
transmit - disabling the transmit interrupt at the interrupt controller
is the only way to stop an interrupt storm. If this interrupt is not
disabled when there are no transmit characters, we end up with an
interrupt storm which prevents the machine making forward progress.

Fixes: 293f89959483 ("tty: serial: 21285: stop using the unused[] variable from struct uart_port")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/E1kU4GS-0006lE-OO@rmk-PC.armlinux.org.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Russell King and committed by
Greg Kroah-Hartman
82776f6c 3650b228

+6 -6
+6 -6
drivers/tty/serial/21285.c
··· 50 50 51 51 static bool is_enabled(struct uart_port *port, int bit) 52 52 { 53 - unsigned long private_data = (unsigned long)port->private_data; 53 + unsigned long *private_data = (unsigned long *)&port->private_data; 54 54 55 - if (test_bit(bit, &private_data)) 55 + if (test_bit(bit, private_data)) 56 56 return true; 57 57 return false; 58 58 } 59 59 60 60 static void enable(struct uart_port *port, int bit) 61 61 { 62 - unsigned long private_data = (unsigned long)port->private_data; 62 + unsigned long *private_data = (unsigned long *)&port->private_data; 63 63 64 - set_bit(bit, &private_data); 64 + set_bit(bit, private_data); 65 65 } 66 66 67 67 static void disable(struct uart_port *port, int bit) 68 68 { 69 - unsigned long private_data = (unsigned long)port->private_data; 69 + unsigned long *private_data = (unsigned long *)&port->private_data; 70 70 71 - clear_bit(bit, &private_data); 71 + clear_bit(bit, private_data); 72 72 } 73 73 74 74 #define is_tx_enabled(port) is_enabled(port, tx_enabled_bit)