Skip to contentSkip to conversation

serial: 8250_dw: handle reset control deassert error

PATCH Superseded Artem Shimko 3 participants 5 messages Oct 9, 2025 – Oct 19, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: 8250_dw: handle reset control deassert error

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.

---
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(-)
drivers/tty/serial/8250/8250_dw.c +3 -1
index a53ba04d9770..710ae4d40aec 100644
@@ -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)
Signature · 1 line
2.43.0
#1 lore raw
Quoted 10 lines · Artem Shimko

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.

If it's not applied yet, it deserves the Fixes tag, I believe.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw

PATCH v2 1/1 serial: 8250_dw: handle reset control deassert error

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.

Fixes acbdad8dd1ab ("serial: 8250_dw: simplify optional reset handling")

---
Hi Andy,

Thank you for your review.

The v1 patch hasn't been applied.

I've addressed your comments in v2 - could you please take a look when you have time?

Best regards,
Artem Shimko

ChangeLog:
v1:
* https://lore.kernel.org/all/[email protected]/T/#u
v2:
* Add fix tag to commit description

 drivers/tty/serial/8250/8250_dw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/tty/serial/8250/8250_dw.c +3 -1
index a53ba04d9770..710ae4d40aec 100644
@@ -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)
Signature · 1 line
2.43.0
maintainer
#3 lore raw
Quoted 53 lines · Artem Shimko

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.

Fixes acbdad8dd1ab ("serial: 8250_dw: simplify optional reset handling")

---
Hi Andy,

Thank you for your review.

The v1 patch hasn't been applied.

I've addressed your comments in v2 - could you please take a look when you have time?

Best regards,
Artem Shimko

ChangeLog:
v1:
* https://lore.kernel.org/all/[email protected]/T/#u
v2:
* Add fix tag to commit description

 drivers/tty/serial/8250/8250_dw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/tty/serial/8250/8250_dw.c +3 -1
index a53ba04d9770..710ae4d40aec 100644
@@ -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)
Signature · 1 line
2.43.0

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.

You are receiving this message because of the following common error(s) as indicated below:

- You have marked a patch with a "Fixes:" tag for a commit that is in an older released kernel, yet you do not have a cc: stable line in the signed-off-by area at all, which means that the patch will not be applied to any older kernel releases. To properly fix this, please follow the documented rules in the Documentation/process/stable-kernel-rules.rst file for how to resolve this.

If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.

thanks,

greg k-h's patch email bot

#4 lore raw

PATCH v3 1/1 serial: 8250_dw: handle reset control deassert error

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.

Fixes acbdad8dd1ab ("serial: 8250_dw: simplify optional reset handling")

---
Hi,

Done.

Thank you!

Best regards,
Artem Shimko

ChangeLog:
v1:
* https://lore.kernel.org/all/[email protected]/T/#u
v2:
* https://lore.kernel.org/all/[email protected]/
v3:
* Add Cc: [email protected]

 drivers/tty/serial/8250/8250_dw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/tty/serial/8250/8250_dw.c +3 -1
index a53ba04d9770..710ae4d40aec 100644
@@ -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)
Signature · 1 line
2.43.0