diff mbox

xen/arm: Panic if platform initialization failed

Message ID 1384529257-7590-2-git-send-email-julien.grall@linaro.org
State Accepted, archived
Headers show

Commit Message

Julien Grall Nov. 15, 2013, 3:27 p.m. UTC
Actually, if an error occurs, Xen will silently ignore it and continue.
Convert platform_init to a void function and panic if we fail to
correctly initialize the platform.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/platform.c        | 5 +++--
 xen/include/asm-arm/platform.h | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

Stefano Stabellini Nov. 15, 2013, 3:59 p.m. UTC | #1
On Fri, 15 Nov 2013, Julien Grall wrote:
> Actually, if an error occurs, Xen will silently ignore it and continue.
> Convert platform_init to a void function and panic if we fail to
> correctly initialize the platform.
> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>


>  xen/arch/arm/platform.c        | 5 +++--
>  xen/include/asm-arm/platform.h | 2 +-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
> index db135f8..0fbbdc7 100644
> --- a/xen/arch/arm/platform.c
> +++ b/xen/arch/arm/platform.c
> @@ -54,7 +54,7 @@ static void dump_platform_table(void)
>          printk("    - %s\n", p->name);
>  }
>  
> -int __init platform_init(void)
> +void __init platform_init(void)
>  {
>      int res = 0;
>  
> @@ -82,7 +82,8 @@ int __init platform_init(void)
>      if ( platform && platform->init )
>          res = platform->init();
>  
> -    return res;
> +    if ( res )
> +        panic("Unable to initialize the platform\n");
>  }
>  
>  int __init platform_init_time(void)
> diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
> index 43afebb..c282b30 100644
> --- a/xen/include/asm-arm/platform.h
> +++ b/xen/include/asm-arm/platform.h
> @@ -45,7 +45,7 @@ struct platform_desc {
>   */
>  #define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0)
>  
> -int __init platform_init(void);
> +void __init platform_init(void);
>  int __init platform_init_time(void);
>  int __init platform_specific_mapping(struct domain *d);
>  #ifdef CONFIG_ARM_32
> -- 
> 1.8.3.1
>
Ian Campbell Nov. 19, 2013, 2:50 p.m. UTC | #2
On Fri, 2013-11-15 at 15:59 +0000, Stefano Stabellini wrote:
> On Fri, 15 Nov 2013, Julien Grall wrote:
> > Actually, if an error occurs, Xen will silently ignore it and continue.
> > Convert platform_init to a void function and panic if we fail to
> > correctly initialize the platform.
> > 
> > Signed-off-by: Julien Grall <julien.grall@linaro.org>
> 
> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

/insert similar wanderings about pushing the panic down the stack.
diff mbox

Patch

diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index db135f8..0fbbdc7 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -54,7 +54,7 @@  static void dump_platform_table(void)
         printk("    - %s\n", p->name);
 }
 
-int __init platform_init(void)
+void __init platform_init(void)
 {
     int res = 0;
 
@@ -82,7 +82,8 @@  int __init platform_init(void)
     if ( platform && platform->init )
         res = platform->init();
 
-    return res;
+    if ( res )
+        panic("Unable to initialize the platform\n");
 }
 
 int __init platform_init_time(void)
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index 43afebb..c282b30 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -45,7 +45,7 @@  struct platform_desc {
  */
 #define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0)
 
-int __init platform_init(void);
+void __init platform_init(void);
 int __init platform_init_time(void);
 int __init platform_specific_mapping(struct domain *d);
 #ifdef CONFIG_ARM_32