This is a note to let you know that I've just added the patch titled tty: xilinx_uartps: Check clk_enable return value to the 6.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: tty-xilinx_uartps-check-clk_enable-return-value.patch and it can be found in the queue-6.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 31fd5c63792320bddb19fe67ea3cbb4cf3c9391e Author: Shubhrajyoti Datta <shubhrajyoti.datta@xxxxxxxxxx> Date: Fri Jul 29 17:17:42 2022 +0530 tty: xilinx_uartps: Check clk_enable return value [ Upstream commit 957e8c047bf25bd24271ab049f06dc47f382973f ] If clocks are not enabled the register access may hang the system. Check for the clock enable return value and bail out if not enabled. Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xxxxxxxxxx> Link: https://lore.kernel.org/r/20220729114748.18332-2-shubhrajyoti.datta@xxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Stable-dep-of: b8a6c3b3d465 ("tty: xilinx_uartps: Fix the ignore_status") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 9e01fe6c0ab8..51fd09e14eda 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1329,12 +1329,20 @@ static int cdns_uart_resume(struct device *device) unsigned long flags; u32 ctrl_reg; int may_wake; + int ret; may_wake = device_may_wakeup(device); if (console_suspend_enabled && uart_console(port) && !may_wake) { - clk_enable(cdns_uart->pclk); - clk_enable(cdns_uart->uartclk); + ret = clk_enable(cdns_uart->pclk); + if (ret) + return ret; + + ret = clk_enable(cdns_uart->uartclk); + if (ret) { + clk_disable(cdns_uart->pclk); + return ret; + } spin_lock_irqsave(&port->lock, flags);