Re: [PATCH 4/8] serial: fsl_lpuart: handle break and make sysrq work

From: Johan Hovold
Date: Wed May 12 2021 - 05:31:01 EST


On Tue, May 11, 2021 at 10:01:44PM +0200, Michael Walle wrote:
> Although there is already (broken) sysrq characters handling, a break
> condition was never detected. There is also a possible deadlock because
> we might call handle_sysrq() while still holding the port lock.

Where's the possible deadlock?

First, as you point out above the driver currently doesn't detect breaks
so the sysrq handler is never called and there's no risk for deadlocks
in the console code.

Second, the driver's console implementation explicitly handles being
called recursively so would not deadlock after you start detecting
breaks either.

> Add support for break detection and use the proper
> uart_unlock_and_check_sysrq() to defer calling handle_sysrq().

Johan