From: Cristian Marussi <cristian.marussi@arm.com>
To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com,
Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com,
etienne.carriere@linaro.org, vincent.guittot@linaro.org,
souvik.chakravarty@arm.com, peter.hilber@opensynergy.com,
igor.skalkin@opensynergy.com, cristian.marussi@arm.com
Subject: [PATCH 5/6] [RFC] firmware: arm_scmi: Add support for clock_enable_latency
Date: Mon, 24 Jan 2022 10:03:40 +0000 [thread overview]
Message-ID: <20220124100341.41191-6-cristian.marussi@arm.com> (raw)
In-Reply-To: <20220124100341.41191-1-cristian.marussi@arm.com>
An SCMI platform can optionally advertise an enable latency typically
associated with a specific clock resource: add support for parsing such
optional message field and export sich information in the usual publicly
accessible clock descriptor.
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
---
RFC tag is due to the fact that this SCMI spec Clock protocol field
addition is still to be published.
---
drivers/firmware/arm_scmi/clock.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/arm_scmi/clock.c b/drivers/firmware/arm_scmi/clock.c
index 72f930c0e3e2..552610bfb91e 100644
--- a/drivers/firmware/arm_scmi/clock.c
+++ b/drivers/firmware/arm_scmi/clock.c
@@ -27,7 +27,8 @@ struct scmi_msg_resp_clock_protocol_attributes {
struct scmi_msg_resp_clock_attributes {
__le32 attributes;
#define CLOCK_ENABLE BIT(0)
- u8 name[SCMI_MAX_STR_SIZE];
+ u8 name[SCMI_MAX_STR_SIZE];
+ __le32 clock_enable_latency;
};
struct scmi_clock_set_config {
@@ -116,10 +117,15 @@ static int scmi_clock_attributes_get(const struct scmi_protocol_handle *ph,
attr = t->rx.buf;
ret = ph->xops->do_xfer(ph, t);
- if (!ret)
+ if (!ret) {
strlcpy(clk->name, attr->name, SCMI_MAX_STR_SIZE);
- else
+ /* TODO Use CLOCK Proto Versioning once SCMI spec is updated */
+ if (t->rx.len > sizeof(attr->attributes) + SCMI_MAX_STR_SIZE)
+ clk->enable_latency =
+ le32_to_cpu(attr->clock_enable_latency);
+ } else {
clk->name[0] = '\0';
+ }
ph->xops->xfer_put(ph, t);
return ret;
--
2.17.1
next prev parent reply other threads:[~2022-01-24 10:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-24 10:03 [PATCH 0/6] Add SCMI Virtio & Clock atomic support Cristian Marussi
2022-01-24 10:03 ` [PATCH 1/6] firmware: arm_scmi: Add atomic mode support to virtio transport Cristian Marussi
2022-01-26 14:28 ` Peter Hilber
2022-01-27 9:07 ` Cristian Marussi
2022-02-01 17:11 ` Cristian Marussi
2022-01-24 10:03 ` [PATCH 2/6] dt-bindings: firmware: arm,scmi: Add atomic_threshold optional property Cristian Marussi
2022-01-24 10:03 ` [PATCH 3/6] firmware: arm_scmi: Support optional system wide atomic_threshold Cristian Marussi
2022-01-24 10:03 ` [PATCH 4/6] firmware: arm_scmi: Add atomic support to clock protocol Cristian Marussi
2022-01-24 10:03 ` Cristian Marussi [this message]
2022-01-24 10:03 ` [PATCH 6/6] [RFC] clk: scmi: Support atomic clock enable/disable API Cristian Marussi
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=20220124100341.41191-6-cristian.marussi@arm.com \
--to=cristian.marussi@arm.com \
--cc=Jonathan.Cameron@Huawei.com \
--cc=etienne.carriere@linaro.org \
--cc=f.fainelli@gmail.com \
--cc=igor.skalkin@opensynergy.com \
--cc=james.quinlan@broadcom.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.hilber@opensynergy.com \
--cc=souvik.chakravarty@arm.com \
--cc=sudeep.holla@arm.com \
--cc=vincent.guittot@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®