]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
serial: 8250_dw: handle clock enable errors in runtime_resume
authorArtem Shimko <a.shimko.dev@gmail.com>
Tue, 4 Nov 2025 14:54:25 +0000 (17:54 +0300)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:20:38 +0000 (07:20 -0500)
commit4abd527092acd6d847d42e5dc5c0dfb12d50d2e4
treefaecc9a871de083934355a36a4f7c50c2909bb26
parent16101d4a4f70b5119830d163b4d3421305a79f19
serial: 8250_dw: handle clock enable errors in runtime_resume

[ Upstream commit d31228143a489ba6ba797896a07541ce06828c09 ]

Add error checking for clk_prepare_enable() calls in
dw8250_runtime_resume(). Currently if either clock fails to enable,
the function returns success while leaving clocks in inconsistent state.

This change implements comprehensive error handling by checking the return
values of both clk_prepare_enable() calls. If the second clock enable
operation fails after the first clock has already been successfully
enabled, the code now properly cleans up by disabling and unpreparing
the first clock before returning. The error code is then propagated to
the caller, ensuring that clock enable failures are properly reported
rather than being silently ignored.

Signed-off-by: Artem Shimko <a.shimko.dev@gmail.com>
Link: https://patch.msgid.link/20251104145433.2316165-2-a.shimko.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/8250/8250_dw.c