Re: arm64: csdlock at early boot due to slow serial (?)
From: Mark Rutland
Date: Thu Jul 03 2025 - 06:34:56 EST
Hi Breno,
On Wed, Jul 02, 2025 at 10:10:21AM -0700, Breno Leitao wrote:
> Hello,
>
> I'm observing two unusual behaviors during the boot process on my SBSA
> ARM machine, with upstream kernel (6.16-rc4):
Can you say which SoC in particular that is? Knowing that would help to
identify whether there's some known erratum, clocking issue, etc.
Likewise that might imply more folk to add to Cc.
[...]
> At timestamp 9.69 seconds, the serial console is still flushing messages from
> 0.92 seconds, indicating that the initial 9-second gap is spent looping in
> cpu_relax()—about 20,000 times per message, which is clearly suboptimal.
>
> Further debugging revealed the following sequence with the pl011 registers:
>
> 1) uart_console_write()
> 2) REG_FR has BUSY | RXFE | TXFF for a while (~1k cpu_relax())
> 3) RXFE and TXFF are cleaned, and BUSY stay on for another 17k-19k cpu_relax()
>
> Michael has reported a hardware issue where the BUSY bit could get
> stuck (see commit d8a4995bcea1: "tty: pl011: Work around QDF2400 E44 stuck BUSY
> bit"), which is very similar. TXFE goes down, but BUSY is(?) still stuck for long.
Looking at the commit message, that was an issue with the a "custom
(non-PrimeCell) implementation of the SBSA UART" present on QDF400. I
assume that was soemthing that Qualcomm Datacenter Technologies designed
themselves.
It's possible that your SoC has a similar issue with whatever IP block
is being used as the UART, but the issue in that commit certainly
doesn't apply to most PL011 / SBSA-UART implementations.
> If I am having the same hardware issue, I suppose I need to change that logic
> to exist the cpu_relax() loop by checking when Transmit FIFO Empty (TXFE) is 0
> instead of BUSY.
If you have the same issue, then applying the same workaround makes
sense. As above, it's not clear that this is necessarily the same issue.
Any more detail that you can share regarding the SoC would be very
helpful.
Mark.