linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: use common reboot infrastructure
@ 2013-07-11 11:13 Marc Zyngier
  2013-07-17 19:20 ` Catalin Marinas
  2013-07-19  9:56 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 2 replies; 3+ messages in thread
From: Marc Zyngier @ 2013-07-11 11:13 UTC (permalink / raw)
  To: linux-arm-kernel

Commit 7b6d864b48d9 (reboot: arm: change reboot_mode to use enum
reboot_mode) changed the way reboot is handled on arm, which has a
direct impact on arm64 as we share the reset driver on the VE platform.

The obvious fix is to move arm64 to use the same infrastructure.

Cc: Robin Holt <holt@sgi.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm64/include/asm/system_misc.h | 3 ++-
 arch/arm64/kernel/process.c          | 2 +-
 kernel/reboot.c                      | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/include/asm/system_misc.h b/arch/arm64/include/asm/system_misc.h
index a6e1750..7a18fab 100644
--- a/arch/arm64/include/asm/system_misc.h
+++ b/arch/arm64/include/asm/system_misc.h
@@ -23,6 +23,7 @@
 #include <linux/compiler.h>
 #include <linux/linkage.h>
 #include <linux/irqflags.h>
+#include <linux/reboot.h>
 
 struct pt_regs;
 
@@ -41,7 +42,7 @@ extern void show_pte(struct mm_struct *mm, unsigned long addr);
 extern void __show_regs(struct pt_regs *);
 
 void soft_restart(unsigned long);
-extern void (*arm_pm_restart)(char str, const char *cmd);
+extern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
 
 #define UDBG_UNDEFINED	(1 << 0)
 #define UDBG_SYSCALL	(1 << 1)
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index 46f02c3..1788bf6 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -132,7 +132,7 @@ void machine_restart(char *cmd)
 
 	/* Now call the architecture specific reboot code. */
 	if (arm_pm_restart)
-		arm_pm_restart('h', cmd);
+		arm_pm_restart(reboot_mode, cmd);
 
 	/*
 	 * Whoops - the architecture was unable to reboot.
diff --git a/kernel/reboot.c b/kernel/reboot.c
index 269ed93..9aaeb58 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -25,7 +25,7 @@ int C_A_D = 1;
 struct pid *cad_pid;
 EXPORT_SYMBOL(cad_pid);
 
-#if defined(CONFIG_ARM) || defined(CONFIG_UNICORE32)
+#if defined(CONFIG_ARM) || defined(CONFIG_ARM64) || defined(CONFIG_UNICORE32)
 #define DEFAULT_REBOOT_MODE		= REBOOT_HARD
 #else
 #define DEFAULT_REBOOT_MODE
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] arm64: use common reboot infrastructure
  2013-07-11 11:13 [PATCH] arm64: use common reboot infrastructure Marc Zyngier
@ 2013-07-17 19:20 ` Catalin Marinas
  2013-07-19  9:56 ` Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2013-07-17 19:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 11, 2013 at 12:13:00PM +0100, Marc Zyngier wrote:
> Commit 7b6d864b48d9 (reboot: arm: change reboot_mode to use enum
> reboot_mode) changed the way reboot is handled on arm, which has a
> direct impact on arm64 as we share the reset driver on the VE platform.
> 
> The obvious fix is to move arm64 to use the same infrastructure.
> 
> Cc: Robin Holt <holt@sgi.com>
> Cc: Pawel Moll <pawel.moll@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

I just did the same before I saw your patch. Anyway, I'll take yours as
you did it first ;)

> --- a/kernel/reboot.c
> +++ b/kernel/reboot.c
> @@ -25,7 +25,7 @@ int C_A_D = 1;
>  struct pid *cad_pid;
>  EXPORT_SYMBOL(cad_pid);
>  
> -#if defined(CONFIG_ARM) || defined(CONFIG_UNICORE32)
> +#if defined(CONFIG_ARM) || defined(CONFIG_ARM64) || defined(CONFIG_UNICORE32)
>  #define DEFAULT_REBOOT_MODE		= REBOOT_HARD
>  #else
>  #define DEFAULT_REBOOT_MODE

Do we need this or we could use the default (I think REBOOT_COLD is 0)?

-- 
Catalin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] arm64: use common reboot infrastructure
  2013-07-11 11:13 [PATCH] arm64: use common reboot infrastructure Marc Zyngier
  2013-07-17 19:20 ` Catalin Marinas
@ 2013-07-19  9:56 ` Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 0 replies; 3+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-07-19  9:56 UTC (permalink / raw)
  To: linux-arm-kernel

On 12:13 Thu 11 Jul     , Marc Zyngier wrote:
> Commit 7b6d864b48d9 (reboot: arm: change reboot_mode to use enum
> reboot_mode) changed the way reboot is handled on arm, which has a
> direct impact on arm64 as we share the reset driver on the VE platform.
> 
> The obvious fix is to move arm64 to use the same infrastructure.
> 
> Cc: Robin Holt <holt@sgi.com>
> Cc: Pawel Moll <pawel.moll@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  arch/arm64/include/asm/system_misc.h | 3 ++-
>  arch/arm64/kernel/process.c          | 2 +-
>  kernel/reboot.c                      | 2 +-
>  3 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/system_misc.h b/arch/arm64/include/asm/system_misc.h
> index a6e1750..7a18fab 100644
> --- a/arch/arm64/include/asm/system_misc.h
> +++ b/arch/arm64/include/asm/system_misc.h
> @@ -23,6 +23,7 @@
>  #include <linux/compiler.h>
>  #include <linux/linkage.h>
>  #include <linux/irqflags.h>
> +#include <linux/reboot.h>
>  
>  struct pt_regs;
>  
> @@ -41,7 +42,7 @@ extern void show_pte(struct mm_struct *mm, unsigned long addr);
>  extern void __show_regs(struct pt_regs *);
>  
>  void soft_restart(unsigned long);
> -extern void (*arm_pm_restart)(char str, const char *cmd);
> +extern void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
>  
>  #define UDBG_UNDEFINED	(1 << 0)
>  #define UDBG_SYSCALL	(1 << 1)
> diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
> index 46f02c3..1788bf6 100644
> --- a/arch/arm64/kernel/process.c
> +++ b/arch/arm64/kernel/process.c
> @@ -132,7 +132,7 @@ void machine_restart(char *cmd)
>  
>  	/* Now call the architecture specific reboot code. */
>  	if (arm_pm_restart)
> -		arm_pm_restart('h', cmd);
> +		arm_pm_restart(reboot_mode, cmd);
>  
>  	/*
>  	 * Whoops - the architecture was unable to reboot.
> diff --git a/kernel/reboot.c b/kernel/reboot.c
> index 269ed93..9aaeb58 100644
> --- a/kernel/reboot.c
> +++ b/kernel/reboot.c
> @@ -25,7 +25,7 @@ int C_A_D = 1;
>  struct pid *cad_pid;
>  EXPORT_SYMBOL(cad_pid);
>  
> -#if defined(CONFIG_ARM) || defined(CONFIG_UNICORE32)
> +#if defined(CONFIG_ARM) || defined(CONFIG_ARM64) || defined(CONFIG_UNICORE32)
how aboud have a specific Kconfig for this instead of a list of defined(xx)

Best Regards,
J.
>  #define DEFAULT_REBOOT_MODE		= REBOOT_HARD
>  #else
>  #define DEFAULT_REBOOT_MODE
> -- 
> 1.8.1.5
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-19  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-11 11:13 [PATCH] arm64: use common reboot infrastructure Marc Zyngier
2013-07-17 19:20 ` Catalin Marinas
2013-07-19  9:56 ` Jean-Christophe PLAGNIOL-VILLARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).