mbox_request_channel() returning value was changed in case of error.
It uses returning value of of_parse_phandle_with_args().
It is returning with -ENOENT instead of -ENODEV when no mboxes property
exists.
Fixes: 24fdd5074b20 ("mailbox: use error ret code of of_parse_phandle_with_args()")
Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org>
---
drivers/rpmsg/qcom_smd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index 40d386809d6b78e209861c23d934e1b9fd743606..e552a9af578e48cfd854a228a4d91e4fa04bf29d 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -1368,7 +1368,7 @@ static int qcom_smd_parse_edge(struct device *dev,
edge->mbox_client.knows_txdone = true;
edge->mbox_chan = mbox_request_channel(&edge->mbox_client, 0);
if (IS_ERR(edge->mbox_chan)) {
- if (PTR_ERR(edge->mbox_chan) != -ENODEV) {
+ if (PTR_ERR(edge->mbox_chan) != -ENOENT) {
ret = PTR_ERR(edge->mbox_chan);
goto put_node;
}
--
2.49.0
On Mon, Apr 21, 2025 at 04:04:16AM +0200, Barnabás Czémán wrote:
> mbox_request_channel() returning value was changed in case of error.
> It uses returning value of of_parse_phandle_with_args().
> It is returning with -ENOENT instead of -ENODEV when no mboxes property
> exists.
Why? What is the rationale?
>
> Fixes: 24fdd5074b20 ("mailbox: use error ret code of of_parse_phandle_with_args()")
> Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org>
> ---
> drivers/rpmsg/qcom_smd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
> index 40d386809d6b78e209861c23d934e1b9fd743606..e552a9af578e48cfd854a228a4d91e4fa04bf29d 100644
> --- a/drivers/rpmsg/qcom_smd.c
> +++ b/drivers/rpmsg/qcom_smd.c
> @@ -1368,7 +1368,7 @@ static int qcom_smd_parse_edge(struct device *dev,
> edge->mbox_client.knows_txdone = true;
> edge->mbox_chan = mbox_request_channel(&edge->mbox_client, 0);
> if (IS_ERR(edge->mbox_chan)) {
> - if (PTR_ERR(edge->mbox_chan) != -ENODEV) {
> + if (PTR_ERR(edge->mbox_chan) != -ENOENT) {
> ret = PTR_ERR(edge->mbox_chan);
> goto put_node;
> }
>
> --
> 2.49.0
>
--
With best wishes
Dmitry
On 2025-04-21 12:38, Dmitry Baryshkov wrote:
> On Mon, Apr 21, 2025 at 04:04:16AM +0200, Barnabás Czémán wrote:
>> mbox_request_channel() returning value was changed in case of error.
>> It uses returning value of of_parse_phandle_with_args().
>> It is returning with -ENOENT instead of -ENODEV when no mboxes
>> property
>> exists.
>
> Why? What is the rationale?
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/of/base.c#n1390
mailbox: use error ret code of of_parse_phandle_with_args() this commit
was changed the return value
from ENODEV to use retrun value of of_parse_phandle_with_args what is
returnung with EINVAL or ENOENT.
It makes skipping fallback path to parse qcom,ipc if there is no mboxes
property defined.
As far as I know qcom,ipc now only needed for rpm smd-edge on some SoCs
like 8939, 8916, 8976, 8917.
arm64: dts: qcom: msm8939: revert use of APCS mbox for RPM
>
>>
>> Fixes: 24fdd5074b20 ("mailbox: use error ret code of
>> of_parse_phandle_with_args()")
>> Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org>
>> ---
>> drivers/rpmsg/qcom_smd.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
>> index
>> 40d386809d6b78e209861c23d934e1b9fd743606..e552a9af578e48cfd854a228a4d91e4fa04bf29d
>> 100644
>> --- a/drivers/rpmsg/qcom_smd.c
>> +++ b/drivers/rpmsg/qcom_smd.c
>> @@ -1368,7 +1368,7 @@ static int qcom_smd_parse_edge(struct device
>> *dev,
>> edge->mbox_client.knows_txdone = true;
>> edge->mbox_chan = mbox_request_channel(&edge->mbox_client, 0);
>> if (IS_ERR(edge->mbox_chan)) {
>> - if (PTR_ERR(edge->mbox_chan) != -ENODEV) {
>> + if (PTR_ERR(edge->mbox_chan) != -ENOENT) {
>> ret = PTR_ERR(edge->mbox_chan);
>> goto put_node;
>> }
>>
>> --
>> 2.49.0
>>
On Mon, Apr 21, 2025 at 01:40:50PM +0200, barnabas.czeman@mainlining.org wrote: > On 2025-04-21 12:38, Dmitry Baryshkov wrote: > > On Mon, Apr 21, 2025 at 04:04:16AM +0200, Barnabás Czémán wrote: > > > mbox_request_channel() returning value was changed in case of error. > > > It uses returning value of of_parse_phandle_with_args(). > > > It is returning with -ENOENT instead of -ENODEV when no mboxes > > > property > > > exists. > > > > Why? What is the rationale? > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/of/base.c#n1390 > mailbox: use error ret code of of_parse_phandle_with_args() this commit was > changed the return value > from ENODEV to use retrun value of of_parse_phandle_with_args what is > returnung with EINVAL or ENOENT. > It makes skipping fallback path to parse qcom,ipc if there is no mboxes > property defined. > As far as I know qcom,ipc now only needed for rpm smd-edge on some SoCs like > 8939, 8916, 8976, 8917. > arm64: dts: qcom: msm8939: revert use of APCS mbox for RPM > > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> -- With best wishes Dmitry
© 2016 - 2025 Red Hat, Inc.