RE: [PATCH] printk: nbcon: check uart port is nbcon or not in nbcon_release

From: Chang, Junxiao
Date: Wed Jan 17 2024 - 03:45:18 EST


There are several serial ports in one Intel ADL hardware, they are enumerated as ttyS0, ttyS1, ttyS4, and so on. Multiple console options might be appended to kernel command line. For example, "console=ttyS0,115200n8 console=ttyS4,115200n8 console=ttyS5,115200n8".

In this case, several uarts "cons" pointers are same.

During booting up process, login thread "agetty" might shutdown all uart. All uart ports could release nbcon lock even if they are "non nbcon" console However, in "nbcon_acquire" API, if uart is not nbcon, it returns directly didn't lock anything.

This patch fixes a boot hang issue which could be reproduced every time with Intel ADL hardware/v6.6.7-rt18 kernel. BTW, this issue couldn't be reproduced with v6.6.7-rt17 kernel.

Thanks,
Junxiao

-----Original Message-----
From: John Ogness <john.ogness@xxxxxxxxxxxxx>
Sent: Wednesday, January 17, 2024 4:24 PM
To: Chang, Junxiao <junxiao.chang@xxxxxxxxx>; bigeasy@xxxxxxxxxxxxx; tglx@xxxxxxxxxxxxx; rostedt@xxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
Cc: Li, Hao3 <hao3.li@xxxxxxxxx>; Li, Lili <lili.li@xxxxxxxxx>; Gao, Jianfeng <jianfeng.gao@xxxxxxxxx>; linux-rt-users@xxxxxxxxxxxxxxx
Subject: Re: [PATCH] printk: nbcon: check uart port is nbcon or not in nbcon_release

On 2024-01-17, Junxiao Chang <junxiao.chang@xxxxxxxxx> wrote:
> Different uart ports might have same console pointer,

Please explain how this is possible. It would be a major bug.

John