From: Frank Li <Frank.li@nxp.com>
To: Zhaoyang Yu <2426767509@qq.com>
Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org,
shawnguo@kernel.org, s.hauer@pengutronix.de,
kernel@pengutronix.de, festevam@gmail.com,
linux-serial@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] serial: auart: check clk_enable() return in console write
Date: Mon, 2 Mar 2026 16:47:34 -0500 [thread overview]
Message-ID: <aaYFdpi1jKvyu3Yr@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <tencent_AB29FADF1FAD67D818283B6BB4FDF66F2F08@qq.com>
On Sun, Mar 01, 2026 at 04:22:56PM +0000, Zhaoyang Yu wrote:
> Add a check for clk_enable() in auart_console_write(). If
> clk_enable() fails, return immediately to avoid accessing
> hardware registers while the clock is not enabled.
>
> Signed-off-by: Zhaoyang Yu <2426767509@qq.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/tty/serial/mxs-auart.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
> index cc65c9fb6446..693b491f1e75 100644
> --- a/drivers/tty/serial/mxs-auart.c
> +++ b/drivers/tty/serial/mxs-auart.c
> @@ -1318,7 +1318,8 @@ auart_console_write(struct console *co, const char *str, unsigned int count)
> s = auart_port[co->index];
> port = &s->port;
>
> - clk_enable(s->clk);
> + if (clk_enable(s->clk))
> + return;
>
> /* First save the CR then disable the interrupts */
> old_ctrl2 = mxs_read(s, REG_CTRL2);
> --
> 2.34.1
>
prev parent reply other threads:[~2026-03-02 21:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-01 16:22 Zhaoyang Yu
2026-03-02 21:47 ` Frank Li [this message]
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=aaYFdpi1jKvyu3Yr@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=2426767509@qq.com \
--cc=festevam@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=imx@lists.linux.dev \
--cc=jirislaby@kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/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
all inboxes | Powered by JetHome®