All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicola Mazzucato <nicola.mazzucato@arm.com>
To: linux-kernel@vger.kernel.org, sudeep.holla@arm.com,
	rjw@rjwysocki.net, viresh.kumar@linaro.org,
	linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org
Cc: lukasz.luba@arm.com
Subject: [PATCH 1/2] firmware: arm_scmi: Add fast_switch_possible() api
Date: Wed, 17 Jun 2020 10:43:31 +0100	[thread overview]
Message-ID: <20200617094332.8391-1-nicola.mazzucato@arm.com> (raw)

Add a new fast_switch_possible interface to the existing
perf_ops api to export the information of whether or not
fast_switch is possible in this driver.

This can be used by the CPUFreq driver and framework to
choose proper mechanism for frequency change.

Suggested-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Nicola Mazzucato <nicola.mazzucato@arm.com>
---
 drivers/firmware/arm_scmi/perf.c | 12 ++++++++++++
 include/linux/scmi_protocol.h    |  2 ++
 2 files changed, 14 insertions(+)

diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
index eadc171e254b..ef747a9bb948 100644
--- a/drivers/firmware/arm_scmi/perf.c
+++ b/drivers/firmware/arm_scmi/perf.c
@@ -697,6 +697,17 @@ static int scmi_dvfs_est_power_get(const struct scmi_handle *handle, u32 domain,
 	return ret;
 }
 
+static bool scmi_fast_switch_possible(const struct scmi_handle *handle,
+				   struct device *dev)
+{
+	struct perf_dom_info *dom;
+	struct scmi_perf_info *pi = handle->perf_priv;
+
+	dom = pi->dom_info + scmi_dev_domain_id(dev);
+
+	return (dom->fc_info && dom->fc_info->level_set_addr);
+}
+
 static struct scmi_perf_ops perf_ops = {
 	.limits_set = scmi_perf_limits_set,
 	.limits_get = scmi_perf_limits_get,
@@ -708,6 +719,7 @@ static struct scmi_perf_ops perf_ops = {
 	.freq_set = scmi_dvfs_freq_set,
 	.freq_get = scmi_dvfs_freq_get,
 	.est_power_get = scmi_dvfs_est_power_get,
+	.fast_switch_possible = scmi_fast_switch_possible,
 };
 
 static int scmi_perf_protocol_init(struct scmi_handle *handle)
diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
index ce2f5c28b2df..19e50b89117e 100644
--- a/include/linux/scmi_protocol.h
+++ b/include/linux/scmi_protocol.h
@@ -118,6 +118,8 @@ struct scmi_perf_ops {
 			unsigned long *rate, bool poll);
 	int (*est_power_get)(const struct scmi_handle *handle, u32 domain,
 			     unsigned long *rate, unsigned long *power);
+	bool (*fast_switch_possible)(const struct scmi_handle *handle,
+			struct device *dev);
 };
 
 /**
-- 
2.27.0


WARNING: multiple messages have this Message-ID (diff)
From: Nicola Mazzucato <nicola.mazzucato@arm.com>
To: linux-kernel@vger.kernel.org, sudeep.holla@arm.com,
	rjw@rjwysocki.net, viresh.kumar@linaro.org,
	linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org
Cc: lukasz.luba@arm.com
Subject: [PATCH 1/2] firmware: arm_scmi: Add fast_switch_possible() api
Date: Wed, 17 Jun 2020 10:43:31 +0100	[thread overview]
Message-ID: <20200617094332.8391-1-nicola.mazzucato@arm.com> (raw)

Add a new fast_switch_possible interface to the existing
perf_ops api to export the information of whether or not
fast_switch is possible in this driver.

This can be used by the CPUFreq driver and framework to
choose proper mechanism for frequency change.

Suggested-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Nicola Mazzucato <nicola.mazzucato@arm.com>
---
 drivers/firmware/arm_scmi/perf.c | 12 ++++++++++++
 include/linux/scmi_protocol.h    |  2 ++
 2 files changed, 14 insertions(+)

diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
index eadc171e254b..ef747a9bb948 100644
--- a/drivers/firmware/arm_scmi/perf.c
+++ b/drivers/firmware/arm_scmi/perf.c
@@ -697,6 +697,17 @@ static int scmi_dvfs_est_power_get(const struct scmi_handle *handle, u32 domain,
 	return ret;
 }
 
+static bool scmi_fast_switch_possible(const struct scmi_handle *handle,
+				   struct device *dev)
+{
+	struct perf_dom_info *dom;
+	struct scmi_perf_info *pi = handle->perf_priv;
+
+	dom = pi->dom_info + scmi_dev_domain_id(dev);
+
+	return (dom->fc_info && dom->fc_info->level_set_addr);
+}
+
 static struct scmi_perf_ops perf_ops = {
 	.limits_set = scmi_perf_limits_set,
 	.limits_get = scmi_perf_limits_get,
@@ -708,6 +719,7 @@ static struct scmi_perf_ops perf_ops = {
 	.freq_set = scmi_dvfs_freq_set,
 	.freq_get = scmi_dvfs_freq_get,
 	.est_power_get = scmi_dvfs_est_power_get,
+	.fast_switch_possible = scmi_fast_switch_possible,
 };
 
 static int scmi_perf_protocol_init(struct scmi_handle *handle)
diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
index ce2f5c28b2df..19e50b89117e 100644
--- a/include/linux/scmi_protocol.h
+++ b/include/linux/scmi_protocol.h
@@ -118,6 +118,8 @@ struct scmi_perf_ops {
 			unsigned long *rate, bool poll);
 	int (*est_power_get)(const struct scmi_handle *handle, u32 domain,
 			     unsigned long *rate, unsigned long *power);
+	bool (*fast_switch_possible)(const struct scmi_handle *handle,
+			struct device *dev);
 };
 
 /**
-- 
2.27.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

         reply	other threads:[~2020-06-17  9:44 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-19 22:03 [PATCH] firmware: arm_scmi: Fix SCMI Generic Power Domain probing Cristian Marussi
2020-06-19 22:03 ` Cristian Marussi
2020-07-03 14:49 ` Sudeep Holla
2020-07-03 14:49   ` Sudeep Holla
2020-07-01 15:53   ` [PATCH v11 0/9] SCMI Notifications Core Support Cristian Marussi
2020-07-01 15:53     ` Cristian Marussi
2020-07-01 15:53     ` [PATCH v11 1/9] firmware: arm_scmi: Add notification protocol-registration Cristian Marussi
2020-07-01 15:53       ` Cristian Marussi
2020-07-01 15:53     ` [PATCH v11 2/9] firmware: arm_scmi: Add notification callbacks-registration Cristian Marussi
2020-07-01 15:53       ` Cristian Marussi
2020-07-01 15:53     ` [PATCH v11 3/9] firmware: arm_scmi: Add notification dispatch and delivery Cristian Marussi
2020-07-01 15:53       ` Cristian Marussi
2020-07-01 15:53     ` [PATCH v11 4/9] firmware: arm_scmi: Enable notification core Cristian Marussi
2020-07-01 15:53       ` Cristian Marussi
2020-07-01 15:53     ` [PATCH v11 5/9] firmware: arm_scmi: Add power notifications support Cristian Marussi
2020-07-01 15:53       ` Cristian Marussi
2020-07-01 15:53     ` [PATCH v11 6/9] firmware: arm_scmi: Add perf " Cristian Marussi
2020-07-01 15:53       ` Cristian Marussi
2020-07-01 15:53     ` [PATCH v11 7/9] firmware: arm_scmi: Add sensor " Cristian Marussi
2020-07-01 15:53       ` Cristian Marussi
2020-07-01 15:53     ` [PATCH v11 8/9] firmware: arm_scmi: Add reset " Cristian Marussi
2020-07-01 15:53       ` Cristian Marussi
2020-07-01 15:53     ` [PATCH v11 9/9] firmware: arm_scmi: Add base " Cristian Marussi
2020-07-01 15:53       ` Cristian Marussi
2020-07-03 14:49     ` [PATCH v11 0/9] SCMI Notifications Core Support Sudeep Holla
2020-07-03 14:49       ` Sudeep Holla
2020-06-17  9:43       ` Nicola Mazzucato [this message]
2020-06-17  9:43         ` [PATCH 1/2] firmware: arm_scmi: Add fast_switch_possible() api Nicola Mazzucato
2020-06-17  9:43         ` [PATCH 2/2] cpufreq: arm_scmi: Set fast_switch_possible conditionally Nicola Mazzucato
2020-06-17  9:43           ` Nicola Mazzucato
2020-06-17 12:47           ` Sudeep Holla
2020-06-17 12:47             ` Sudeep Holla
2020-06-18  6:14             ` Viresh Kumar
2020-06-18  6:14               ` Viresh Kumar
2020-06-18  8:08               ` Sudeep Holla
2020-06-18  8:08                 ` Sudeep Holla
2020-06-18  9:54           ` Viresh Kumar
2020-06-18  9:54             ` Viresh Kumar
2020-07-03 14:49         ` [PATCH 1/2] firmware: arm_scmi: Add fast_switch_possible() api Sudeep Holla
2020-07-03 14:49           ` Sudeep Holla
2020-06-25 10:19           ` [PATCH] firmware: arm_scmi: Use HAVE_ARM_SMCCC_DISCOVERY instead of ARM_PSCI_FW Sudeep Holla
2020-06-25 10:19             ` Sudeep Holla
2020-07-03 14:49             ` Sudeep Holla
2020-07-03 14:49               ` Sudeep Holla
2020-06-09 13:45               ` [PATCH] firmware: arm_scmi: Use signed integer to report transfer status Sudeep Holla
2020-06-09 13:45                 ` Sudeep Holla
2020-06-09 14:00                 ` Lukasz Luba
2020-06-09 14:00                   ` Lukasz Luba
2020-07-03 14:49                 ` Sudeep Holla
2020-07-03 14:49                   ` 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=20200617094332.8391-1-nicola.mazzucato@arm.com \
    --to=nicola.mazzucato@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=sudeep.holla@arm.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.