mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] serial: auart: check clk_enable() return in console write
@ 2026-03-01 16:22 Zhaoyang Yu
  2026-03-02 21:47 ` Frank Li
  0 siblings, 1 reply; 2+ messages in thread
From: Zhaoyang Yu @ 2026-03-01 16:22 UTC (permalink / raw)
  To: gregkh, jirislaby, shawnguo, s.hauer
  Cc: kernel, festevam, linux-serial, imx, linux-arm-kernel,
	linux-kernel, Zhaoyang Yu

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>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] serial: auart: check clk_enable() return in console write
  2026-03-01 16:22 [PATCH] serial: auart: check clk_enable() return in console write Zhaoyang Yu
@ 2026-03-02 21:47 ` Frank Li
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Li @ 2026-03-02 21:47 UTC (permalink / raw)
  To: Zhaoyang Yu
  Cc: gregkh, jirislaby, shawnguo, s.hauer, kernel, festevam,
	linux-serial, imx, linux-arm-kernel, linux-kernel

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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-02 21:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-01 16:22 [PATCH] serial: auart: check clk_enable() return in console write Zhaoyang Yu
2026-03-02 21:47 ` Frank Li

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®