From: Dan Carpenter <dan.carpenter@linaro.org>
To: gchen chen <gchen.guomin@gmail.com>
Cc: Cristian Marussi <cristian.marussi@arm.com>,
guomin_chen@sina.com, Sudeep Holla <sudeep.holla@arm.com>,
Xinqi Zhang <quic_xinqzhan@quicinc.com>,
arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] firmware: arm_scmi: Delete the meaningless scmi_bus_id.
Date: Mon, 16 Dec 2024 18:03:36 +0300 [thread overview]
Message-ID: <c3803026-8286-431a-9042-62cf46ede408@stanley.mountain> (raw)
In-Reply-To: <CAEEwsfRhe4-YAwe027huSXwFfkV-O-8w1GDNf=URa9efRsXiKA@mail.gmail.com>
On Mon, Dec 16, 2024 at 06:37:01PM +0800, gchen chen wrote:
> > > > diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> > > > index 1b5fb2c4ce86..bbf1f05f2be3 100644
> > > > --- a/drivers/firmware/arm_scmi/driver.c
> > > > +++ b/drivers/firmware/arm_scmi/driver.c
> > > > @@ -2641,8 +2641,8 @@ static int scmi_chan_setup(struct scmi_info *info, struct device_node *of_node,
> > > > cinfo->max_msg_size = info->desc->max_msg_size;
> > > >
> > > > /* Create a unique name for this transport device */
> > > > - snprintf(name, 32, "__scmi_transport_device_%s_%02X",
> > > > - idx ? "rx" : "tx", prot_id);
> > > > + snprintf(name, 32, "__scmi_transport_device_%s",
> > > > + idx ? "rx" : "tx");
> >
> > I agree on what Dan said AND also this results in having the same name for different
> > devices across 2 instances if you have a per-protocol channel because you havent anymore
> > the protocol_id bit.
> hi Cristian,and dan
> Because I used a 3-tuple [parent name, name, protocol] when
> creating the SCMI device name, I removed the prot_id from the
> parameter ‘name’ when creating transport devices. This way, it avoids
> the repetition of protocol ID in the SCMI device name.
>
I haven't actually tested this code, I'm just going by reviewing.
scmi_channels_setup() calls scmi_txrx_setup() in a loop with a different
port_id each time. The info->dev is the same on each iteration. Since
the name is the same except for the rx/tx then __scmi_device_create() will
find the existing device on the first line and return success instead of
allocating a new device:
scmi_dev = scmi_child_dev_find(parent, protocol, name);
if (scmi_dev)
return scmi_dev;
regards,
dan carpenter
prev parent reply other threads:[~2024-12-16 15:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-16 7:37 [PATCH v2] firmware: arm_scmi: Delete the meaningless scmi_bus_id guomin_chen
2024-12-16 8:31 ` Dan Carpenter
2024-12-16 8:50 ` Cristian Marussi
2024-12-16 9:45 ` Cristian Marussi
2024-12-16 10:37 ` gchen chen
2024-12-16 10:45 ` Sudeep Holla
2024-12-16 14:10 ` gchen chen
2024-12-16 16:08 ` Sudeep Holla
2024-12-17 2:06 ` gchen chen
2024-12-16 15:03 ` Dan Carpenter [this message]
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=c3803026-8286-431a-9042-62cf46ede408@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=arm-scmi@vger.kernel.org \
--cc=cristian.marussi@arm.com \
--cc=gchen.guomin@gmail.com \
--cc=guomin_chen@sina.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=quic_xinqzhan@quicinc.com \
--cc=sudeep.holla@arm.com \
/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