Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a32426e2 authored by John Stultz's avatar John Stultz Committed by Alistair Delva
Browse files

ANDROID: tty: serdev: Fix broken serial console input

Since commit c550a54f2302 ("ANDROID: serdev: add platform device
support"), the serial console on the db845c has stopped taking
input.

Digging in it seems when the tty used for the console is
switched to serdev via serdev_tty_port_register(), the
client_ops are changed here:
  https://android.googlesource.com/kernel/common/+/android-mainline/drivers/tty/serdev/serdev-ttyport.c#288

The problem being, the new client_ops->receive_buf function
ttyport_receive_buf() starts failing on the SERPORT_ACTIVE
test here:
  https://android.googlesource.com/kernel/common/+/android-mainline/drivers/tty/serdev/serdev-ttyport.c#32

Which seems to be due to the fact that the tty was already
opened and being used as the console when it was switched to
serdev. Thus ctrl_ops->open function never gets called, which
prevents the SERPORT_ACTIVE bit from being set:
  https://android.googlesource.com/kernel/common/+/android-mainline/drivers/tty/serdev/serdev-ttyport.c#141

Now this was at first confusing as on the HiKey960 we don't see
the issue. But in the HiKey960 case it seem the check here:
  https://android.googlesource.com/kernel/common/+/android-mainline/drivers/tty/serdev/core.c#737


fails preventing the tty from being switched to serdev.

Thus this patch tries to avoid switching the tty to serdev if
the tty port's console value is true.

With this, the serial console continues to function.

Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
Signed-off-by: default avatarAlistair Delva <adelva@google.com>
Bug: 147453872
Change-Id: Id2747dc8c4ac633d71afabaf252d2bb69d206123
parent d32a4878
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment