From: Stephan Gerhold <stephan.gerhold@linaro.org>
To: me@samcday.com
Cc: Sumit Garg <sumit.garg@kernel.org>,
u-boot-qcom@groups.io, u-boot@lists.denx.de,
Casey Connolly <casey.connolly@linaro.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Tom Rini <trini@konsulko.com>,
Michal Simek <michal.simek@amd.com>,
Angelo Dureghello <angelo@kernel-space.org>,
Eugen Hristev <ehristev@kernel.org>,
Kuan-Wei Chiu <visitorckw@gmail.com>, Yao Zi <me@ziyao.cc>,
Simon Glass <sjg@chromium.org>,
Sughosh Ganu <sughosh.ganu@arm.com>,
George Chan <gchan9527@gmail.com>,
Antony Kurniawan Soemardi <linux@smankusors.com>,
Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>,
Tien Fong Chee <tien.fong.chee@altera.com>,
Peng Fan <peng.fan@nxp.com>,
Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>,
Anshul Dalal <anshuld@ti.com>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Tingting Meng <tingting.meng@altera.com>,
Alice Guo <alice.guo@nxp.com>,
Quentin Schulz <quentin.schulz@cherry.de>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Luca Weiss <luca.weiss@fairphone.com>,
Aswin Murugan <aswin.murugan@oss.qualcomm.com>,
David Wronek <david.wronek@mainlining.org>,
Danila Tikhonov <danila@jiaxyga.com>,
Varadarajan Narayanan <quic_varada@quicinc.com>,
Lukasz Majewski <lukma@denx.de>,
Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>,
Jens Reidel <adrian@mainlining.org>
Subject: Re: [PATCH RESEND 15/16] serial: msm: wait for TX empty before reinit
Date: Mon, 1 Jun 2026 10:41:13 +0200 [thread overview]
Message-ID: <ah1FqUGQYaS15Cad@linaro.org> (raw)
In-Reply-To: <20260601-qcom-armv7-v1-15-05a08d87e476@samcday.com>
On Mon, Jun 01, 2026 at 06:12:56PM +1000, Sam Day via B4 Relay wrote:
> From: Sam Day <me@samcday.com>
>
> At least on UARTDM 1.3, I was noticing the early UART debug banner
> getting corrupted. It turns out this is because U-Boot was
> re-initializing the UARTDM block and writing to it before it had
> finished shifting out the FIFO from the previous bootloader. Waiting for
> TX_EMPTY in the status register consistently fixes the issue.
>
> Signed-off-by: Sam Day <me@samcday.com>
> ---
> drivers/serial/serial_msm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/serial/serial_msm.c b/drivers/serial/serial_msm.c
> index 10948e2aede..db085d68a0d 100644
> --- a/drivers/serial/serial_msm.c
> +++ b/drivers/serial/serial_msm.c
> @@ -351,6 +351,8 @@ static inline void _debug_uart_init(void)
> * - HMIBSC: GCC_BLSP1_UART1_APPS_CLK
> */
> //apq8016_clk_init_uart(0x1800000, <uart_clk_id>);
> + while (!(readl(init_serial_data.base + UARTDM_SR) & UARTDM_SR_TX_EMPTY))
> + ;
I think you need to add some timeout here. There is some funky SoC where
the UART is left in some half-disabled state and this bit will never
become unset. Maybe it was MSM8909, I don't remember exactly. I have
similar code in TF-A and there I had to add the timeout to prevent the
device from getting completely stuck during boot sometimes because of
this loop:
https://github.com/ARM-software/arm-trusted-firmware/blob/da738d5eae93af342fdc4995dd3c05acb4c9d757/plat/qti/bear/msm8916/aarch32/uartdm_console.S#L68-L81
Thanks,
Stephan
next prev parent reply other threads:[~2026-06-01 12:12 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-01 8:12 [PATCH RESEND 00/16] MSM8960 / mach-snapdragon ARMv7 support Sam Day via B4 Relay
2026-06-01 8:12 ` [PATCH RESEND 01/16] serial: msm: UARTDM <1.4 support Sam Day via B4 Relay
2026-06-01 8:12 ` [PATCH RESEND 02/16] timer: Qualcomm KPSS timer support Sam Day via B4 Relay
2026-06-01 8:12 ` [PATCH RESEND 03/16] arm: save_prev_bl_data: ARM32 support Sam Day via B4 Relay
2026-06-01 8:12 ` [PATCH RESEND 04/16] mach-snapdragon: qcom_parse_memory 32-bit support Sam Day via B4 Relay
2026-06-01 8:12 ` [PATCH RESEND 05/16] mach-snapdragon: gate ARM64 features Sam Day via B4 Relay
2026-06-01 8:12 ` [PATCH RESEND 06/16] mach-snapdragon: introduce ARCH_SNAPDRAGON_ARM32 Sam Day via B4 Relay
2026-06-01 8:12 ` [PATCH RESEND 07/16] configs: introduce qcom_armv7_defconfig Sam Day via B4 Relay
2026-06-01 8:12 ` [PATCH RESEND 08/16] board: qualcomm: add MSM8960 debug UART config Sam Day via B4 Relay
2026-06-01 8:12 ` [PATCH RESEND 09/16] sysreset: qcom-pshold: offset support Sam Day via B4 Relay
2026-06-01 8:12 ` [PATCH RESEND 10/16] pinctrl: qcom: configurable GPIO offset/stride Sam Day via B4 Relay
2026-06-01 8:12 ` [PATCH RESEND 11/16] pinctrl: qcom: introduce MSM8960 driver Sam Day via B4 Relay
2026-06-01 8:12 ` [PATCH RESEND 12/16] mach-snapdragon: parse incoming ARM32 ATAGS Sam Day via B4 Relay
2026-06-03 13:47 ` Casey Connolly
2026-06-03 22:27 ` Sam Day
2026-06-04 15:01 ` Casey Connolly
2026-06-07 3:41 ` Sam Day
2026-06-01 8:12 ` [PATCH RESEND 13/16] clk: qcom: MSM8960 GCC driver Sam Day via B4 Relay
2026-06-01 8:12 ` [PATCH RESEND 14/16] clk: qcom: arch-agnostic pointer fmtstrings Sam Day via B4 Relay
2026-06-01 8:12 ` [PATCH RESEND 15/16] serial: msm: wait for TX empty before reinit Sam Day via B4 Relay
2026-06-01 8:41 ` Stephan Gerhold [this message]
2026-06-07 1:26 ` Sam Day
2026-06-01 8:12 ` [PATCH RESEND 16/16] button: remap phone HOMEPAGE button Sam Day via B4 Relay
2026-06-01 8:16 ` [PATCH RESEND 00/16] MSM8960 / mach-snapdragon ARMv7 support Luca Weiss
2026-06-06 21:36 ` Antony Kurniawan Soemardi
2026-06-06 23:18 ` Sam Day
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ah1FqUGQYaS15Cad@linaro.org \
--to=stephan.gerhold@linaro.org \
--cc=adrian@mainlining.org \
--cc=alice.guo@nxp.com \
--cc=alif.zakuan.yuslaimi@altera.com \
--cc=angelo@kernel-space.org \
--cc=anshuld@ti.com \
--cc=aswin.murugan@oss.qualcomm.com \
--cc=balaji.selvanathan@oss.qualcomm.com \
--cc=casey.connolly@linaro.org \
--cc=danila@jiaxyga.com \
--cc=david.wronek@mainlining.org \
--cc=ehristev@kernel.org \
--cc=gchan9527@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=linux@smankusors.com \
--cc=luca.weiss@fairphone.com \
--cc=lukma@denx.de \
--cc=marek.vasut+renesas@mailbox.org \
--cc=me@samcday.com \
--cc=me@ziyao.cc \
--cc=michal.simek@amd.com \
--cc=neil.armstrong@linaro.org \
--cc=peng.fan@nxp.com \
--cc=quentin.schulz@cherry.de \
--cc=quic_varada@quicinc.com \
--cc=rayagonda.kokatanur@broadcom.com \
--cc=sjg@chromium.org \
--cc=sughosh.ganu@arm.com \
--cc=sumit.garg@kernel.org \
--cc=tien.fong.chee@altera.com \
--cc=tingting.meng@altera.com \
--cc=trini@konsulko.com \
--cc=u-boot-qcom@groups.io \
--cc=u-boot@lists.denx.de \
--cc=visitorckw@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox