summaryrefslogtreecommitdiff
path: root/drivers/firmware
diff options
context:
space:
mode:
authorStephan Gerhold <stephan@gerhold.net>2021-12-01 14:05:04 +0100
committerBjorn Andersson <bjorn.andersson@linaro.org>2022-02-03 21:54:48 -0600
commit52beb1fc237d67cdc64277dc90047767a6fc52d7 (patch)
treec27125a7ef6b0277acba05e6ab94ac127a06e23a /drivers/firmware
parent7734c4b507cefbcf2f7a2a806e79c43e52528c5f (diff)
firmware: qcom: scm: Drop cpumask parameter from set_boot_addr()
qcom_scm_set_cold/warm_boot_addr() currently take a cpumask parameter, but it's not very useful because at the end we always set the same entry address for all CPUs. This also allows speeding up probe of cpuidle-qcom-spm a bit because only one SCM call needs to be made to the TrustZone firmware, instead of one per CPU. The main reason for this change is that it allows implementing the "multi-cluster" variant of the set_boot_addr() call more easily without having to rely on functions that break in certain build configurations or that are not exported to modules. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20211201130505.257379-4-stephan@gerhold.net
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/qcom_scm.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
index 1bcc139c9165..0382f9fa4501 100644
--- a/drivers/firmware/qcom_scm.c
+++ b/drivers/firmware/qcom_scm.c
@@ -243,8 +243,7 @@ static bool __qcom_scm_is_call_available(struct device *dev, u32 svc_id,
return ret ? false : !!res.result[0];
}
-static int qcom_scm_set_boot_addr(void *entry, const cpumask_t *cpus,
- const u8 *cpu_bits)
+static int qcom_scm_set_boot_addr(void *entry, const u8 *cpu_bits)
{
int cpu;
unsigned int flags = 0;
@@ -255,7 +254,7 @@ static int qcom_scm_set_boot_addr(void *entry, const cpumask_t *cpus,
.owner = ARM_SMCCC_OWNER_SIP,
};
- for_each_cpu(cpu, cpus) {
+ for_each_present_cpu(cpu) {
if (cpu >= QCOM_SCM_BOOT_MAX_CPUS)
return -EINVAL;
flags |= cpu_bits[cpu];
@@ -268,27 +267,25 @@ static int qcom_scm_set_boot_addr(void *entry, const cpumask_t *cpus,
}
/**
- * qcom_scm_set_warm_boot_addr() - Set the warm boot address for cpus
+ * qcom_scm_set_warm_boot_addr() - Set the warm boot address for all cpus
* @entry: Entry point function for the cpus
- * @cpus: The cpumask of cpus that will use the entry point
*
* Set the Linux entry point for the SCM to transfer control to when coming
* out of a power down. CPU power down may be executed on cpuidle or hotplug.
*/
-int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus)
+int qcom_scm_set_warm_boot_addr(void *entry)
{
- return qcom_scm_set_boot_addr(entry, cpus, qcom_scm_cpu_warm_bits);
+ return qcom_scm_set_boot_addr(entry, qcom_scm_cpu_warm_bits);
}
EXPORT_SYMBOL(qcom_scm_set_warm_boot_addr);
/**
- * qcom_scm_set_cold_boot_addr() - Set the cold boot address for cpus
+ * qcom_scm_set_cold_boot_addr() - Set the cold boot address for all cpus
* @entry: Entry point function for the cpus
- * @cpus: The cpumask of cpus that will use the entry point
*/
-int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus)
+int qcom_scm_set_cold_boot_addr(void *entry)
{
- return qcom_scm_set_boot_addr(entry, cpus, qcom_scm_cpu_cold_bits);
+ return qcom_scm_set_boot_addr(entry, qcom_scm_cpu_cold_bits);
}
EXPORT_SYMBOL(qcom_scm_set_cold_boot_addr);