From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, etienne.carriere@st.com,
michal.simek@amd.com, linus.walleij@linaro.org,
Oleksii_Moisieiev@epam.com
Subject: Re: [RFC 1/6] firmware: scmi: fix protocol enumeration logic
Date: Mon, 11 Sep 2023 13:58:13 +0900 [thread overview]
Message-ID: <ZP6eZS29gQhQ9x3z@octopus> (raw)
In-Reply-To: <CAPnjgZ0kxE3NXD_pLTm5Oc3Sb9HRUz5pbWETCqrvr4XwSUzKcA@mail.gmail.com>
Hi Simon,
On Sun, Sep 10, 2023 at 01:13:26PM -0600, Simon Glass wrote:
> Hi AKASHI,
>
> On Tue, 5 Sept 2023 at 20:41, AKASHI Takahiro
> <takahiro.akashi@linaro.org> wrote:
> >
> > The original logic in enumerating all the protocols accidentally
> > modifies a *loop* variable, node, at Voltage domain protocol.
> > So subsequent protocol nodes in a device tree won't be detected.
> >
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > ---
> > drivers/firmware/scmi/scmi_agent-uclass.c | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/firmware/scmi/scmi_agent-uclass.c b/drivers/firmware/scmi/scmi_agent-uclass.c
> > index 46a2933d51a4..79584c00a066 100644
> > --- a/drivers/firmware/scmi/scmi_agent-uclass.c
> > +++ b/drivers/firmware/scmi/scmi_agent-uclass.c
> > @@ -422,8 +422,11 @@ static int scmi_bind_protocols(struct udevice *dev)
> > case SCMI_PROTOCOL_ID_VOLTAGE_DOMAIN:
> > if (IS_ENABLED(CONFIG_DM_REGULATOR_SCMI) &&
> > scmi_protocol_is_supported(dev, protocol_id)) {
> > - node = ofnode_find_subnode(node, "regulators");
> > - if (!ofnode_valid(node)) {
> > + ofnode sub_node;
> > +
> > + sub_node = ofnode_find_subnode(node,
> > + "regulators");
> > + if (!ofnode_valid(sub_node)) {
> > dev_err(dev, "no regulators node\n");
> > return -ENXIO;
> > }
> > --
> > 2.34.1
> >
>
> This function is very ugly...could we instead rely on driver model to
I think you are talking about scmi_bind_protocols() itself,
not the hunk above in my patch, which is merely a bug fix
in the existing code.
If so,
> bind the devices? It seems unfortunate to have to write code for
> something which could be done with no extra code.
We will discuss in the threads on your comment [1].
[1] https://lists.denx.de/pipermail/u-boot/2023-September/530200.html
-Takahiro Akashi
> Regards,
> Simon
next prev parent reply other threads:[~2023-09-11 4:58 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-06 2:40 [RFC 0/6] firmware: scmi: add SCMI pinctrl protocol support AKASHI Takahiro
2023-09-06 2:40 ` [RFC 1/6] firmware: scmi: fix protocol enumeration logic AKASHI Takahiro
2023-09-10 19:13 ` Simon Glass
2023-09-11 4:58 ` AKASHI Takahiro [this message]
2023-09-06 2:40 ` [RFC 2/6] firmware: scmi: add pinctrl protocol support AKASHI Takahiro
2023-09-06 2:40 ` [RFC 3/6] pinctrl: add scmi driver AKASHI Takahiro
2023-09-10 19:13 ` Simon Glass
2023-09-11 5:14 ` AKASHI Takahiro
2023-09-06 2:40 ` [RFC 4/6] gpio: add scmi driver based on pinctrl AKASHI Takahiro
2023-09-06 14:56 ` Michal Simek
2023-09-06 23:37 ` AKASHI Takahiro
2023-09-07 12:23 ` Simon Glass
2023-09-08 4:32 ` AKASHI Takahiro
2023-09-10 19:13 ` Simon Glass
2023-09-11 5:38 ` AKASHI Takahiro
2023-09-06 2:40 ` [RFC 5/6] firmware: scmi: add pseudo pinctrl protocol support on sandbox AKASHI Takahiro
2023-09-10 19:13 ` Simon Glass
2023-09-11 5:23 ` AKASHI Takahiro
2023-09-06 2:40 ` [RFC 6/6] test: dm: add SCMI pinctrl test AKASHI Takahiro
2023-09-10 19:13 ` Simon Glass
2023-09-11 5:47 ` AKASHI Takahiro
2023-09-22 18:27 ` Simon Glass
2023-09-06 3:09 ` [RFC 0/6] firmware: scmi: add SCMI pinctrl protocol support Fabio Estevam
2023-09-07 9:58 ` AKASHI Takahiro
2023-09-08 12:14 ` Peng Fan
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=ZP6eZS29gQhQ9x3z@octopus \
--to=takahiro.akashi@linaro.org \
--cc=Oleksii_Moisieiev@epam.com \
--cc=etienne.carriere@st.com \
--cc=linus.walleij@linaro.org \
--cc=michal.simek@amd.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/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