diff mbox

[3/4] arm: dont give up on EAGAIN if PSCI is defined

Message ID 1385380964-22230-4-git-send-email-andre.przywara@linaro.org
State New
Headers show

Commit Message

Andre Przywara Nov. 25, 2013, 12:02 p.m. UTC
Currently the platforms define an empty, zero-returning cpu_up
function to state that they don't need any special treatment beside
the GIC SEV kick to come up.
Allow platforms which only provide PSCI to not define a platform
specific cpu_up() function at all. For this we need to handle the
EAGAIN error code that the platform returns in this case and ignore
that if a PSCI node was found in the DTB.

Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
---
 xen/arch/arm/smpboot.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Ian Campbell Nov. 26, 2013, 11:20 a.m. UTC | #1
On Mon, 2013-11-25 at 13:02 +0100, Andre Przywara wrote:
> Currently the platforms define an empty, zero-returning cpu_up
> function to state that they don't need any special treatment beside
> the GIC SEV kick to come up.
> Allow platforms which only provide PSCI to not define a platform
> specific cpu_up() function at all. For this we need to handle the
> EAGAIN error code that the platform returns in this case and ignore
> that if a PSCI node was found in the DTB.

I think we should only call the arch hook if PSCI is not enabled.

Either that or we should only try PSCI if there is no arch hook.

I think probably the former.

I think the call to arch_cpu_up can be moved inside the PSCI conditional
which follows in the patch context e.g. just before the SGI kick.

> 
> Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
> ---
>  xen/arch/arm/smpboot.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
> index 44326d8..14774c5 100644
> --- a/xen/arch/arm/smpboot.c
> +++ b/xen/arch/arm/smpboot.c
> @@ -412,8 +412,11 @@ int __cpu_up(unsigned int cpu)
>  
>      if ( rc < 0 )
>      {
> -        printk("Failed to bring up CPU%d\n", cpu);
> -        return rc;
> +        if ( rc != -EAGAIN || psci_host_cpu_on_nr == 0 )
> +        {
> +            printk("Failed to bring up CPU%d\n", cpu);
> +            return rc;
> +        }
>      }
>  
>      if ( psci_host_cpu_on_nr != 0 )
diff mbox

Patch

diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 44326d8..14774c5 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -412,8 +412,11 @@  int __cpu_up(unsigned int cpu)
 
     if ( rc < 0 )
     {
-        printk("Failed to bring up CPU%d\n", cpu);
-        return rc;
+        if ( rc != -EAGAIN || psci_host_cpu_on_nr == 0 )
+        {
+            printk("Failed to bring up CPU%d\n", cpu);
+            return rc;
+        }
     }
 
     if ( psci_host_cpu_on_nr != 0 )