linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: 8250_dw: handle reset control deassert error
@ 2025-10-09  8:13 Artem Shimko
  2025-10-15 16:35 ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Artem Shimko @ 2025-10-09  8:13 UTC (permalink / raw)
  To: Ilpo Järvinen, Andy Shevchenko, Greg Kroah-Hartman,
	Jiri Slaby, Philipp Zabel
  Cc: a.shimko.dev, linux-kernel, linux-serial

Check the return value of reset_control_deassert() in the probe
function to prevent continuing probe when reset deassertion fails.

Previously, reset_control_deassert() was called without checking its
return value, which could lead to probe continuing even when the
device reset wasn't properly deasserted.

The fix checks the return value and returns an error with dev_err_probe()
if reset deassertion fails, providing better error handling and
diagnostics.

Signed-off-by: Artem Shimko <a.shimko.dev@gmail.com>
---
Hello maintainers and reviewers,

This patch adds proper error handling for reset_control_deassert() in the 
DesignWare 8250 serial driver probe function.

Currently, if reset deassertion fails, the driver continues probing which
could lead to operating a UART device that is still held in reset. This patch
ensures we properly check the return value and fail the probe with a
meaningful error message if reset deassertion fails.

The change follows the same pattern as other drivers handling reset controls
and provides consistent error handling behavior.

Thank you for your consideration.

Best regards,
Artem Shimko

 drivers/tty/serial/8250/8250_dw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index a53ba04d9770..710ae4d40aec 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -635,7 +635,9 @@ static int dw8250_probe(struct platform_device *pdev)
 	if (IS_ERR(data->rst))
 		return PTR_ERR(data->rst);
 
-	reset_control_deassert(data->rst);
+	err = reset_control_deassert(data->rst);
+	if (err)
+		return dev_err_probe(dev, err, "failed to deassert resets\n");
 
 	err = devm_add_action_or_reset(dev, dw8250_reset_control_assert, data->rst);
 	if (err)
-- 
2.43.0


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

end of thread, other threads:[~2025-10-19  9:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-09  8:13 [PATCH] serial: 8250_dw: handle reset control deassert error Artem Shimko
2025-10-15 16:35 ` Andy Shevchenko
2025-10-19  8:53   ` [PATCH v2] " Artem Shimko
2025-10-19  9:00     ` Greg KH
2025-10-19  9:51       ` [PATCH v3] " Artem Shimko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).