From: Cristian Marussi <cristian.marussi@arm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>,
Sudeep Holla <sudeep.holla@arm.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
Arnd Bergmann <arnd@arndb.de>,
Jassi Brar <jassisinghbrar@gmail.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] firmware: arm_scmi: Make scmi core independent of transport type
Date: Mon, 9 Dec 2019 18:13:18 +0000 [thread overview]
Message-ID: <71417ba8-b844-ac96-bcad-4bf48fa8b869@arm.com> (raw)
In-Reply-To: <5c545c2866ba075ddb44907940a1dae1d823b8a1.1575019719.git.viresh.kumar@linaro.org>
Hi
a one minor nit, and one question about scmi_desc usage in this new transport
independent driver.
On 29/11/2019 09:31, Viresh Kumar wrote:
> The SCMI specification is fairly independent of the transport protocol,
> which can be a simple mailbox (already implemented) or anything else.
> The current Linux implementation however is very much dependent of the
> mailbox transport layer.
>
> This patch makes the SCMI core code (driver.c) independent of the
> mailbox transport layer and moves all mailbox related code to a new
> file: mailbox.c.
>
> We can now implement more transport protocols to transport SCMI
> messages.
>
> The transport protocols just need to provide struct scmi_transport_ops,
> with its version of the callbacks to enable exchange of SCMI messages.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> drivers/firmware/arm_scmi/Makefile | 3 +-
> drivers/firmware/arm_scmi/common.h | 39 ++++++++
> drivers/firmware/arm_scmi/driver.c | 143 ++++++++++-----------------
> drivers/firmware/arm_scmi/mailbox.c | 146 ++++++++++++++++++++++++++++
> 4 files changed, 236 insertions(+), 95 deletions(-)
> create mode 100644 drivers/firmware/arm_scmi/mailbox.c
>
[snip]
> /**
> * struct scmi_info - Structure representing a SCMI instance
> *
> @@ -128,6 +109,7 @@ struct scmi_chan_info {
> struct scmi_info {
> struct device *dev;
> const struct scmi_desc *desc;
> + struct scmi_transport_ops *transport_ops;
> struct scmi_revision_info version;
> struct scmi_handle handle;
> struct scmi_xfers_info tx_minfo;
> @@ -138,7 +120,6 @@ struct scmi_info {
> int users;
> };
>
Could we add also the related @transport_ops in the above comment block ?
> -#define client_to_scmi_chan_info(c) container_of(c, struct scmi_chan_info, cl)
> #define handle_to_scmi_info(h) container_of(h, struct scmi_info, handle)
>
> /*
[snip]
> +
> static int scmi_probe(struct platform_device *pdev)
> {
> int ret;
> @@ -833,12 +800,6 @@ static int scmi_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> struct device_node *child, *np = dev->of_node;
>
> - /* Only mailbox method supported, check for the presence of one */
> - if (scmi_mailbox_check(np, 0)) {
> - dev_err(dev, "no mailbox found in %pOF\n", np);
> - return -EINVAL;
> - }
> -
> desc = of_device_get_match_data(dev);
> if (!desc)
> return -EINVAL;
This scmi_desc struct descriptor is retrieved from of_match_table .data and points to
the driver-provided scmi_generic_desc
static const struct scmi_desc scmi_generic_desc = {
.max_rx_timeout_ms = 30, /* We may increase this if required */
.max_msg = 20, /* Limited by MBOX_TX_QUEUE_LEN */
.max_msg_size = 128,
};
Is not this kind of information possibly (maybe partially) related to the selected
transport, and as such it should be also provided dynamically by the chosen transport
layer at probe time, like the transport_ops, instead of being hard-coded in
this driver ?
Thanks
Cristian
next prev parent reply other threads:[~2019-12-09 18:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-29 9:31 Viresh Kumar
2019-12-03 12:00 ` Sudeep Holla
2019-12-10 10:18 ` Viresh Kumar
2019-12-09 18:13 ` Cristian Marussi [this message]
2019-12-10 5:34 ` Viresh Kumar
2019-12-10 18:46 ` Sudeep Holla
2019-12-11 2:43 ` Viresh Kumar
2019-12-31 2:50 ` Peng Fan
2019-12-31 12:22 ` Sudeep Holla
2019-12-31 20:09 ` Jassi Brar
2020-01-06 11:00 ` Sudeep Holla
2020-01-09 8:18 ` Arnd Bergmann
2020-01-09 9:16 ` Viresh Kumar
2020-01-10 12:22 ` Sudeep Holla
2020-01-09 9:34 ` Viresh Kumar
2020-01-09 10:15 ` Arnd Bergmann
2020-01-10 12:27 ` Sudeep Holla
2020-01-13 6:45 ` Peng Fan
2020-01-10 12:31 ` Sudeep Holla
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=71417ba8-b844-ac96-bcad-4bf48fa8b869@arm.com \
--to=cristian.marussi@arm.com \
--cc=arnd@arndb.de \
--cc=jassisinghbrar@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sudeep.holla@arm.com \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
/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
all inboxes | Powered by JetHome®