From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Cristian Marussi <cristian.marussi@arm.com>, long.yunjian@zte.com.cn
Cc: sudeep.holla@arm.com, peng.fan@nxp.com, justin.chen@broadcom.com,
florian.fainelli@broadcom.com, arm-scmi@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, fang.yumeng@zte.com.cn,
mou.yi@zte.com.cn, ouyang.maochun@zte.com.cn,
xu.lifeng1@zte.com.cn
Subject: Re: [PATCH] firmware: arm_scmi: Use dev_err_probe() simplify the code
Date: Fri, 16 May 2025 17:23:37 +0200 [thread overview]
Message-ID: <18ff08db-9d0a-40bb-b84d-785d25e2b8fc@wanadoo.fr> (raw)
In-Reply-To: <aCXzPGvPayVyiMHG@pluto>
Le 15/05/2025 à 15:59, Cristian Marussi a écrit :
> On Thu, May 15, 2025 at 08:38:55PM +0800, long.yunjian@zte.com.cn wrote:
>> From: Yumeng Fang <fang.yumeng@zte.com.cn>
>>
>
> Hi,
>
>> In the probe path, dev_err() can be replaced with dev_err_probe()
>> which will check if error code is -EPROBE_DEFER and prints the
>> error name. It also sets the defer probe reason which can be
>> checked later through debugfs.
>
> All true...but...if you look at the main scmi_probe() function all of these
> failures are trapped at that level currently on the return path...
>
> see the call chain from
>
> scmi_probe()
> ....
> ret = scmi_channels_setup(info);
> ...
>
> ...so your probe errors will be overridden there with a more generic message
> left in debugfs at the top level.
This is only true only when -EPROBE_DEFER is returned.
In other cases, I think that we would get 2 messages. The specific one
from scmi_channels_setup() and a generic one from scmi_probe().
in such a case, the one in scmi_channels_setup() will be better, because
it will log the error code in a human readable format, which is not the
case now.
So, I think that the patch:
- simplify the code
- improve the error messages in some cases
If -EPROBE_DEFER is returned, I think that the additional call would
just but a harmless no-op.
CJ
>
> Thanks,
> Cristian
>
>
next prev parent reply other threads:[~2025-05-16 15:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-15 12:38 [PATCH] firmware: arm_scmi: Use dev_err_probe() simplify the code long.yunjian
2025-05-15 13:16 ` Dan Carpenter
2025-05-15 13:59 ` Cristian Marussi
2025-05-16 8:02 ` Dan Carpenter
2025-05-16 15:23 ` Christophe JAILLET [this message]
2025-05-16 15:25 ` Christophe JAILLET
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18ff08db-9d0a-40bb-b84d-785d25e2b8fc@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=arm-scmi@vger.kernel.org \
--cc=cristian.marussi@arm.com \
--cc=fang.yumeng@zte.com.cn \
--cc=florian.fainelli@broadcom.com \
--cc=justin.chen@broadcom.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=long.yunjian@zte.com.cn \
--cc=mou.yi@zte.com.cn \
--cc=ouyang.maochun@zte.com.cn \
--cc=peng.fan@nxp.com \
--cc=sudeep.holla@arm.com \
--cc=xu.lifeng1@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox