Skip to content

Commit

Permalink
serial: drop debugging WARN_ON_ONCE() from uart_put_char()
Browse files Browse the repository at this point in the history
Pengfei Xu reports, that the -next commit 1788cf6 (tty: serial:
switch from circ_buf to kfifo) tries to emit a WARNING and that leads to
lockdep errors. Obviously we cannot print anything from uart_put_char()!

This WARN_ON_ONCE() was/is a debug aid to check if the condition in
uart_put_char() can happen at all. Pengfei Xu confirmed it can. Unlike
me and kbuild bot in my queue.

Second, I completely forgot about it, so I did not remove it in the
final version, nor mentioned it in the commit log.

Drop it now as we are all good. And we even have stack traces (and a
reproducer)!

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Reported-by: Pengfei Xu <pengfei.xu@intel.com>
Link: https://lore.kernel.org/r/20240416071904.21440-1-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jiri Slaby (SUSE) authored and Greg Kroah-Hartman committed Apr 17, 2024
1 parent 35fad98 commit 5f1149d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/tty/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ static int uart_put_char(struct tty_struct *tty, u8 c)
int ret = 0;

port = uart_port_lock(state, flags);
if (WARN_ON_ONCE(!state->port.xmit_buf)) {
if (!state->port.xmit_buf) {
uart_port_unlock(port, flags);
return 0;
}
Expand Down

0 comments on commit 5f1149d

Please sign in to comment.