Subject: [PATCH] drivers: psci: make PSCI 1.0 functions initialization version dependent

From: [email-masked] (Lorenzo Pieralisi)
Date: Fri, 23 Oct 2015 17:00:54 +0100

On Fri, Oct 23, 2015 at 03:58:43PM +0100, Sudeep Holla wrote:

[...]

> >@@ -347,9 +347,10 @@ static int __init psci_probe(void)
> >
> >  	psci_init_migrate();
> >
> >-	psci_init_cpu_suspend();
> >-
> >-	psci_init_system_suspend();
> >+	if (PSCI_VERSION_MAJOR(ver) >= 1) {
> 
> Alternatively we can just add this check in psci_features function and
> return PSCI_RET_NOT_SUPPORTED if PSCI_VERSION_MAJOR(ver) < 1. New
> callers of psci_features are also protected and need not add checks
> at call sites. Thoughts ?

The resulting behaviour given the current code would be equivalent,
but I think you have a point, we can always refactor this code later
as a clean-up, I just prevented calling initialization functions
that have 0 chances to succeed on pre 1.0 firmware anyway (but do have
have a chance to fail as the breakage showed).

Thanks,
Lorenzo