Re: [PATCH v2 08/47] kernel: Move pm_power_off to common code

2014-10-24 Thread Lennox Wu
Acked-by: Lennox Wu lennox...@gmail.com

2014-10-21 12:12 GMT+08:00 Guenter Roeck li...@roeck-us.net:
 pm_power_off is defined for all architectures. Move it to common code.

 Have all architectures call do_kernel_power_off instead of pm_power_off.
 Some architectures point pm_power_off to machine_power_off. For those,
 call do_kernel_power_off from machine_power_off instead.

 Acked-by: David Vrabel david.vra...@citrix.com
 Acked-by: Geert Uytterhoeven ge...@linux-m68k.org
 Acked-by: Hirokazu Takata tak...@linux-m32r.org
 Acked-by: Jesper Nilsson jesper.nils...@axis.com
 Acked-by: Max Filippov jcmvb...@gmail.com
 Acked-by: Rafael J. Wysocki r...@rjwysocki.net
 Acked-by: Richard Weinberger rich...@nod.at
 Acked-by: Xuetao Guan g...@mprc.pku.edu.cn
 Signed-off-by: Guenter Roeck li...@roeck-us.net
 ---
 v2:
 - do_kernel_poweroff - do_kernel_power_off
 - have_kernel_poweroff - have_kernel_power_off

  arch/alpha/kernel/process.c|  9 +++--
  arch/arc/kernel/reset.c|  5 +
  arch/arm/kernel/process.c  |  5 +
  arch/arm64/kernel/process.c|  5 +
  arch/avr32/kernel/process.c|  6 +-
  arch/blackfin/kernel/process.c |  3 ---
  arch/blackfin/kernel/reboot.c  |  2 ++
  arch/c6x/kernel/process.c  |  9 +
  arch/cris/kernel/process.c |  4 +---
  arch/frv/kernel/process.c  |  5 ++---
  arch/hexagon/kernel/reset.c|  5 ++---
  arch/ia64/kernel/process.c |  5 +
  arch/m32r/kernel/process.c |  8 
  arch/m68k/kernel/process.c |  6 +-
  arch/metag/kernel/process.c|  6 +-
  arch/microblaze/kernel/process.c   |  3 ---
  arch/microblaze/kernel/reset.c |  1 +
  arch/mips/kernel/reset.c   |  6 +-
  arch/mn10300/kernel/process.c  |  8 ++--
  arch/openrisc/kernel/process.c |  8 +---
  arch/parisc/kernel/process.c   |  8 
  arch/powerpc/kernel/setup-common.c |  6 +++---
  arch/s390/kernel/setup.c   |  8 ++--
  arch/score/kernel/process.c|  8 
  arch/sh/kernel/reboot.c|  6 +-
  arch/sparc/kernel/process_32.c | 10 ++
  arch/sparc/kernel/reboot.c |  8 ++--
  arch/tile/kernel/reboot.c  |  7 +++
  arch/um/kernel/reboot.c|  2 --
  arch/unicore32/kernel/process.c|  9 +
  arch/x86/kernel/reboot.c   | 11 +++
  arch/x86/xen/enlighten.c   |  3 +--
  arch/xtensa/kernel/process.c   |  4 
  drivers/parisc/power.c |  3 +--
  kernel/power/poweroff_handler.c|  8 
  kernel/reboot.c|  4 ++--
  36 files changed, 68 insertions(+), 146 deletions(-)

 diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
 index 1941a07..81c43f8 100644
 --- a/arch/alpha/kernel/process.c
 +++ b/arch/alpha/kernel/process.c
 @@ -24,6 +24,7 @@
  #include linux/vt.h
  #include linux/mman.h
  #include linux/elfcore.h
 +#include linux/pm.h
  #include linux/reboot.h
  #include linux/tty.h
  #include linux/console.h
 @@ -40,12 +41,6 @@
  #include proto.h
  #include pci_impl.h

 -/*
 - * Power off function, if any
 - */
 -void (*pm_power_off)(void) = machine_power_off;
 -EXPORT_SYMBOL(pm_power_off);
 -
  #ifdef CONFIG_ALPHA_WTINT
  /*
   * Sleep the CPU.
 @@ -184,6 +179,8 @@ machine_halt(void)
  void
  machine_power_off(void)
  {
 +   do_kernel_power_off();
 +
 common_shutdown(LINUX_REBOOT_CMD_POWER_OFF, NULL);
  }

 diff --git a/arch/arc/kernel/reset.c b/arch/arc/kernel/reset.c
 index 2768fa1..0758d9d 100644
 --- a/arch/arc/kernel/reset.c
 +++ b/arch/arc/kernel/reset.c
 @@ -26,9 +26,6 @@ void machine_restart(char *__unused)

  void machine_power_off(void)
  {
 -   /* FIXME ::  power off ??? */
 +   do_kernel_power_off();
 machine_halt();
  }
 -
 -void (*pm_power_off) (void) = NULL;
 -EXPORT_SYMBOL(pm_power_off);
 diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
 index fe972a2..aa3f656 100644
 --- a/arch/arm/kernel/process.c
 +++ b/arch/arm/kernel/process.c
 @@ -117,8 +117,6 @@ void soft_restart(unsigned long addr)
  /*
   * Function pointers to optional machine specific functions
   */
 -void (*pm_power_off)(void);
 -EXPORT_SYMBOL(pm_power_off);

  void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);

 @@ -205,8 +203,7 @@ void machine_power_off(void)
 local_irq_disable();
 smp_send_stop();

 -   if (pm_power_off)
 -   pm_power_off();
 +   do_kernel_power_off();
  }

  /*
 diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
 index c3065db..46a483a 100644
 --- a/arch/arm64/kernel/process.c
 +++ b/arch/arm64/kernel/process.c
 @@ -68,8 +68,6 @@ void soft_restart(unsigned long addr)
  /*
   * Function pointers to optional machine specific functions
   */
 -void (*pm_power_off)(void);
 -EXPORT_SYMBOL_GPL(pm_power_off);

  void (*arm_pm_restart)(enum reboot_mode reboot_mode, 

Re: [PATCH v2 08/47] kernel: Move pm_power_off to common code

2014-10-24 Thread Guenter Roeck
On Fri, Oct 24, 2014 at 10:47:03AM +0100, James Hogan wrote:
 Hi Guenter,
 
 On 21/10/14 05:12, Guenter Roeck wrote:
  pm_power_off is defined for all architectures. Move it to common code.
  
  Have all architectures call do_kernel_power_off instead of pm_power_off.
  Some architectures point pm_power_off to machine_power_off. For those,
  call do_kernel_power_off from machine_power_off instead.
  
  Acked-by: David Vrabel david.vra...@citrix.com
  Acked-by: Geert Uytterhoeven ge...@linux-m68k.org
  Acked-by: Hirokazu Takata tak...@linux-m32r.org
  Acked-by: Jesper Nilsson jesper.nils...@axis.com
  Acked-by: Max Filippov jcmvb...@gmail.com
  Acked-by: Rafael J. Wysocki r...@rjwysocki.net
  Acked-by: Richard Weinberger rich...@nod.at
  Acked-by: Xuetao Guan g...@mprc.pku.edu.cn
 
 For metag:
 Acked-by: James Hogan james.ho...@imgtec.com
 
Thanks!

Guenter
--
To unsubscribe from this list: send the line unsubscribe linux-metag in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 08/47] kernel: Move pm_power_off to common code

2014-10-22 Thread Guenter Roeck
On Wed, Oct 22, 2014 at 05:31:36PM +0200, Ralf Baechle wrote:
 On Mon, Oct 20, 2014 at 09:12:24PM -0700, Guenter Roeck wrote:
 
  pm_power_off is defined for all architectures. Move it to common code.
  
  Have all architectures call do_kernel_power_off instead of pm_power_off.
  Some architectures point pm_power_off to machine_power_off. For those,
  call do_kernel_power_off from machine_power_off instead.
  
  Acked-by: David Vrabel david.vra...@citrix.com
  Acked-by: Geert Uytterhoeven ge...@linux-m68k.org
  Acked-by: Hirokazu Takata tak...@linux-m32r.org
  Acked-by: Jesper Nilsson jesper.nils...@axis.com
  Acked-by: Max Filippov jcmvb...@gmail.com
  Acked-by: Rafael J. Wysocki r...@rjwysocki.net
  Acked-by: Richard Weinberger rich...@nod.at
  Acked-by: Xuetao Guan g...@mprc.pku.edu.cn
  Signed-off-by: Guenter Roeck li...@roeck-us.net
 
 Acked-by: Ralf Baechle r...@linux-mips.org

Thanks!

Guenter
--
To unsubscribe from this list: send the line unsubscribe linux-metag in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html