diff mbox series

[1/7] rpmsg: qcom_smd: Don't print error during probe deferral

Message ID 20240424-apcs-mboxes-v1-1-6556c47cb501@z3ntu.xyz (mailing list archive)
State Changes Requested
Headers show
Series Use mboxes instead of syscon for APCS (arm32 & arm64) | expand

Commit Message

Luca Weiss April 24, 2024, 4:23 p.m. UTC
When the mailbox driver has not probed yet, skip printing the error
message since it's just going to confuse users.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 drivers/rpmsg/qcom_smd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Bjorn Andersson April 24, 2024, 4:54 p.m. UTC | #1
On Wed, Apr 24, 2024 at 06:23:54PM +0200, Luca Weiss wrote:
> When the mailbox driver has not probed yet, skip printing the error
> message since it's just going to confuse users.
> 
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  drivers/rpmsg/qcom_smd.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
> index 43f601c84b4f..6fc299657adf 100644
> --- a/drivers/rpmsg/qcom_smd.c
> +++ b/drivers/rpmsg/qcom_smd.c
> @@ -1502,7 +1502,8 @@ struct qcom_smd_edge *qcom_smd_register_edge(struct device *parent,
>  
>  	ret = qcom_smd_parse_edge(&edge->dev, node, edge);
>  	if (ret) {
> -		dev_err(&edge->dev, "failed to parse smd edge\n");
> +		if (ret != -EPROBE_DEFER)
> +			dev_err(&edge->dev, "failed to parse smd edge\n");

In the described case, this error message would not be entirely
accurate, and the cause is not accurately captured in devices_deferred.

Unless I'm mistaken, it seems like qcom_smd_parse_edge() will also print
a more useful error in every other case, except after the mbox_chan !=
-ENODEV check..

How about making that:

	if (PTR_ERR(edge->mbox_chan) != -ENODEV) {
		ret = dev_err_probe(dev, PTR_ERR(edge->mbox_chan),
				    "failed to acquire IPC mailbox\n");
		goto put_node;
	}

And then drop the error print here in qcom_smd_register_edge().

It would bring us the devices_deferred tracking, and it would avoid the
double print in all other cases.

Regards,
Bjorn

>  		goto unregister_dev;
>  	}
>  
> 
> -- 
> 2.44.0
>
diff mbox series

Patch

diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index 43f601c84b4f..6fc299657adf 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -1502,7 +1502,8 @@  struct qcom_smd_edge *qcom_smd_register_edge(struct device *parent,
 
 	ret = qcom_smd_parse_edge(&edge->dev, node, edge);
 	if (ret) {
-		dev_err(&edge->dev, "failed to parse smd edge\n");
+		if (ret != -EPROBE_DEFER)
+			dev_err(&edge->dev, "failed to parse smd edge\n");
 		goto unregister_dev;
 	}