Skip to content

Commit ad5a57d

Browse files
sudeep-hollawilldeacon
authored andcommitted
firmware: smccc: Drop smccc_version enum and use ARM_SMCCC_VERSION_1_x instead
Instead of maintaining 2 sets of enums/macros for tracking SMCCC version, let us drop smccc_version enum and use ARM_SMCCC_VERSION_1_x directly instead. This is in preparation to drop smccc_version here and move it separately under drivers/firmware/smccc. Signed-off-by: Sudeep Holla <[email protected]> Tested-by: Etienne Carriere <[email protected]> Reviewed-by: Steven Price <[email protected]> Reviewed-by: Etienne Carriere <[email protected]> Acked-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 0441bfe commit ad5a57d

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

arch/arm64/kernel/paravirt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static bool has_pv_steal_clock(void)
120120
struct arm_smccc_res res;
121121

122122
/* To detect the presence of PV time support we require SMCCC 1.1+ */
123-
if (psci_ops.smccc_version < SMCCC_VERSION_1_1)
123+
if (arm_smccc_1_1_get_conduit() == SMCCC_CONDUIT_NONE)
124124
return false;
125125

126126
arm_smccc_1_1_invoke(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,

drivers/firmware/psci/psci.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ bool psci_tos_resident_on(int cpu)
5454

5555
struct psci_operations psci_ops = {
5656
.conduit = SMCCC_CONDUIT_NONE,
57-
.smccc_version = SMCCC_VERSION_1_0,
57+
.smccc_version = ARM_SMCCC_VERSION_1_0,
5858
};
5959

6060
enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void)
6161
{
62-
if (psci_ops.smccc_version < SMCCC_VERSION_1_1)
62+
if (psci_ops.smccc_version < ARM_SMCCC_VERSION_1_1)
6363
return SMCCC_CONDUIT_NONE;
6464

6565
return psci_ops.conduit;
@@ -411,8 +411,8 @@ static void __init psci_init_smccc(void)
411411
if (feature != PSCI_RET_NOT_SUPPORTED) {
412412
u32 ret;
413413
ret = invoke_psci_fn(ARM_SMCCC_VERSION_FUNC_ID, 0, 0, 0);
414-
if (ret == ARM_SMCCC_VERSION_1_1) {
415-
psci_ops.smccc_version = SMCCC_VERSION_1_1;
414+
if (ret >= ARM_SMCCC_VERSION_1_1) {
415+
psci_ops.smccc_version = ret;
416416
ver = ret;
417417
}
418418
}

include/linux/psci.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ bool psci_power_state_is_valid(u32 state);
2121
int psci_set_osi_mode(void);
2222
bool psci_has_osi_support(void);
2323

24-
enum smccc_version {
25-
SMCCC_VERSION_1_0,
26-
SMCCC_VERSION_1_1,
27-
};
28-
2924
struct psci_operations {
3025
u32 (*get_version)(void);
3126
int (*cpu_suspend)(u32 state, unsigned long entry_point);
@@ -36,7 +31,7 @@ struct psci_operations {
3631
unsigned long lowest_affinity_level);
3732
int (*migrate_info_type)(void);
3833
enum arm_smccc_conduit conduit;
39-
enum smccc_version smccc_version;
34+
u32 smccc_version;
4035
};
4136

4237
extern struct psci_operations psci_ops;

0 commit comments

Comments
 (0)