[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <jlhgtwkeezoca34wbqipvsgr4muxov5wmgrswleo2k7zqitzfr@4ngriyb2udra>
Date: Thu, 10 Jul 2025 10:30:45 -0700
From: Breno Leitao <leitao@...ian.org>
To: Leo Yan <leo.yan@....com>
Cc: Mark Rutland <mark.rutland@....com>, ankita@...dia.com,
bwicaksono@...dia.com, rmk+kernel@...linux.org.uk, catalin.marinas@....com,
linux-serial@...r.kernel.org, rmikey@...a.com, linux-arm-kernel@...ts.infradead.org,
usamaarif642@...il.com, linux-kernel@...r.kernel.org, paulmck@...nel.org
Subject: Re: arm64: csdlock at early boot due to slow serial (?)
Hello Leo,
On Thu, Jul 10, 2025 at 02:35:57PM +0100, Leo Yan wrote:
> > serial: amba-pl011: Fix boot performance by switching to console_initcall()
> >
> > Replace arch_initcall() with console_initcall() for PL011 driver initialization
> > to resolve severe boot performance issues.
>
> pl011_init() registers as an AMBA device, so the PL011 driver depends
> on the AMBA bus initialization. The AMBA bus is initialized with:
>
> postcore_initcall(amba_init);
>
> Therefore, the PL011 driver is initialized with arch_initcall(), which
> occurs later than the postcore init.
>
> My understanding is that console_initcall() is invoked much earlier
> than other initcalls triggered by do_initcalls(). With your change, I
> saw the PL011 driver fails to register on Juno-r2 board, due to AMBA bus
> driver is not ready for a console init.
You are absolutely correct. I confirm that the machine is fast because
pl011 is not working, which is sad and embarassing.
> The atomic path is introduced recently by the commit:
>
> 2eb2608618ce ("serial: amba-pl011: Implement nbcon console")
>
> My conclusion is that changing the initcall will not disable the atomic
> path, changing to console_initcall() will cause AMBA device init
> failure, and as a result, the clock operations will not be invoked.
> Thus, I am curious if you have ruled out the issue is caused by the UART
> clock (as I mentioned in another reply).
>
> BTW, since the atomic path is enabled in the commit 2eb2608618ce, what
> is the result after reverting the commit?
I've reverted commit 2eb2608618ce ("serial: amba-pl011: Implement nbcon
console"), and I don't see the CSD locks anymoer. The serial speed is
the same and continue to be slow, but, the CSD lock is not there. Here
is the time spent on the serial flush when reverting the commit above
[ 0.309561] printk: legacy console [ttyAMA0] enabled
[ 8.657938] ACPI: PCI Root Bridge [PCI2] (domain 0002 [bus 00-ff])
Thanks
--breno
Powered by blists - more mailing lists