mbox series

[0/3] serial: qcom-geni: fix receiver enable

Message ID 20240916172642.7814-1-johan+linaro@kernel.org
Headers show
Series serial: qcom-geni: fix receiver enable | expand

Message

Johan Hovold Sept. 16, 2024, 5:26 p.m. UTC
This series is a follow-up to the console fixes that have been merged
for 6.12-rc1 but that can interact badly with some pre-existing bugs.

Specifically, the receiver could end up being disabled when
set_termios() races with the console code during boot.

Johan


Johan Hovold (3):
  serial: qcom-geni: fix premature receiver enable
  serial: qcom-geni: fix shutdown race
  serial: qcom-geni: fix receiver enable

 drivers/tty/serial/qcom_geni_serial.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

Comments

Johan Hovold Sept. 17, 2024, 9:11 a.m. UTC | #1
On Mon, Sep 16, 2024 at 07:26:42PM +0200, Johan Hovold wrote:
> The receiver should be enabled in the startup() callback and there is no
> need to stop it on every termios update.
> 
> Since commit 6f3c3cafb115 ("serial: qcom-geni: disable interrupts during
> console writes") the calls to manipulate the secondary interrupts, which
> were done without holding the port lock, can lead to the receiver being
> left disabled when set_termios() races with the console code (e.g. when
> init opens the tty during boot).
> 
> Fixes: 6f3c3cafb115 ("serial: qcom-geni: disable interrupts during console writes")
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>

Turns out the DMA implementation is broken and currently depends on
these bogus calls to stop and restart rx in set_termios().

I won't have time to look at this for a couple of weeks due to
conferences, so please hold off on merging these until I'm back.

Johan