Shutdown from reboot_cpuid without stopping other cpus.
Subsystems (34)
cover Shutdown from reboot_cpuid without stopping other cpus.
Andrew, Please do _NOT_ take this patch series yet. I am sending this to you because you had comments on my -v6 submission. If you do take any of the patches, I believe patches 1-5 would be considered ready for moving on as you had comments and I don't recall any others. The first two would really be nice to get into the stable release.
Peter, I don't think I went too far off the rails on this. The three archs which handle reboot= should have been unified, correct? I think that ends up with essentially this. I think the unicore and arm functions passing around the now-global reboot_mode is probably the wrong way to do things, so I would at least want to rework unicore and arm patches to remove that parameter. Otherwise, this patch set was building for all the arm defconfigs as well as my x86_64 configs.
We recently noticed that reboot of a 1024 cpu machine takes approx 16 minutes of just stopping the cpus. The slowdown was tracked to commit f96972f.
The current implementation does all the work of hot removing the cpus before halting the system. We are switching to just migrating to the reboot_cpu and then continuing with shutdown/reboot.
The patch set is broken into eleven parts. The first two are planned for the stable release. The others move the halt/shutdown/reboot related functions to their own kernel/reboot.c file and then move the handling of the kernel reboot= kernel parameter to generic kernel code.
Changes since -v6.
- Cross compiled all arm architectures (using v3.9 kernel. Fails with current).
- Added a #define for non-hotplug case.
- Add #define for PF_THREAD_BOUND as compatibility to make stable easier.
- Fixup s/reboot_cpu_id/reboot_cpu/
- Add include of linux/uaccess.h to allow building on arm.
- Removed last remaining checkpatch.pl line length warning on kernel/reboot.c.
- Fixed the duplicate handling or the reboot= kernel parameter.
Changes since -v5.
- Moved the arch/x86 reboot= up to the generic kernel code.
Changes since -v4.
- Integrated Srivatsa S. Bhat creating cpu_hotplug_disable() function
- Integrated comments by Srivatsa S. Bhat.
- Made one more comment consistent with others in function.
Changes since -v3.
- Added a tested-by for the original reporter.
- Fix compile failure found by Joe Perches.
- Integrated comments by Joe Perches.
To: Andrew Morton <[email protected]>
To: H. Peter Anvin <[email protected]>
Cc: Russ Anderson <[email protected]>
Cc: Robin Holt <[email protected]>
Cc: Russell King <[email protected]>
Cc: Guan Xuetao <[email protected]>
Cc: Linux Kernel Mailing List <[email protected]>
Cc: the arch/x86 maintainers <[email protected]>
Cc: Arm Mailing List <[email protected]>
PATCH 1/11 CPU hotplug: Provide a generic helper to disable/enable CPU hotplug
There are instances in the kernel where we would like to disable CPU hotplug (from sysfs) during some important operation. Today the freezer code depends on this and the code to do it was kinda tailor-made for that.
Restructure the code and make it generic enough to be useful for other usecases too.
To: Andrew Morton <[email protected]>
To: H. Peter Anvin <[email protected]>
Cc: Russ Anderson <[email protected]>
Cc: Robin Holt <[email protected]>
Cc: Russell King <[email protected]>
Cc: Guan Xuetao <[email protected]>
Cc: Linux Kernel Mailing List <[email protected]>
Cc: the arch/x86 maintainers <[email protected]>
Cc: Arm Mailing List <[email protected]>
Cc: <[email protected]>
---
Changes since -v6:
- Added a #define for non-hotplug case.
--- include/linux/cpu.h | 3 +++ kernel/cpu.c | 27 +++++++++------------------ 2 files changed, 12 insertions(+), 18 deletions(-)
include/linux/cpu.h +3 -0
@@ -141,6 +141,8 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb) }#endif +extern void cpu_hotplug_disable (void ); +extern void cpu_hotplug_enable (void );int cpu_up (unsigned int cpu);void notify_cpu_starting (unsigned int cpu);extern void cpu_maps_update_begin (void );
@@ -148,6 +150,7 @@ extern void cpu_maps_update_done(void);#else /* CONFIG_SMP */ +#define cpu_hotplug_disable () do { } while (0)#define cpu_notifier (fn, pri) do { (void)(fn); } while (0)static inline int register_cpu_notifier (struct notifier_block *nb)
kernel/cpu.c +9 -18
@@ -541,29 +541,20 @@ static int __init alloc_frozen_cpus(void)core_initcall (alloc_frozen_cpus);/* -* Prevent regular CPU hotplug from racing with the freezer, by disabling CPU -* hotplug when tasks are about to be frozen. Also, don't allow the freezer -* to continue until any currently running CPU hotplug operation gets -* completed. -* To modify the 'cpu_hotplug_disabled' flag, we need to acquire the -* 'cpu_add_remove_lock'. And this same lock is also taken by the regular -* CPU hotplug path and released only after it is complete. Thus, we -* (and hence the freezer) will block here until any currently running CPU -* hotplug operation gets completed. +* Wait for currently running CPU hotplug operations to complete (if any) and +* disable future CPU hotplug (from sysfs). The 'cpu_add_remove_lock' protects +* the 'cpu_hotplug_disabled' flag. The same lock is also acquired by the +* hotplug path before performing hotplug operations. So acquiring that lock +* guarantees mutual exclusion from any currently running hotplug operations. */ -void cpu_hotplug_disable_before_freeze (void ) +void cpu_hotplug_disable (void ) {cpu_maps_update_begin (); cpu_hotplug_disabled =1 ;cpu_maps_update_done (); } - -/* -* When tasks have been thawed, re-enable regular CPU hotplug (which had been -* disabled while beginning to freeze tasks). -*/ -void cpu_hotplug_enable_after_thaw (void ) +void cpu_hotplug_enable (void ) {cpu_maps_update_begin (); cpu_hotplug_disabled =0 ;
@@ -589,12 +580,12 @@ cpu_hotplug_pm_callback(struct notifier_block *nb,case PM_SUSPEND_PREPARE :case PM_HIBERNATION_PREPARE : -cpu_hotplug_disable_before_freeze (); +cpu_hotplug_disable ();break ;case PM_POST_SUSPEND :case PM_POST_HIBERNATION : -cpu_hotplug_enable_after_thaw (); +cpu_hotplug_enable ();break ;default :
Signature · 1 line
1.8.2.1
PATCH 2/11 Migrate shutdown/reboot to boot cpu.
In reply to Robin HoltWe recently noticed that reboot of a 1024 cpu machine takes approx 16 minutes of just stopping the cpus. The slowdown was tracked to commit f96972f.
The current implementation does all the work of hot removing the cpus before halting the system. We are switching to just migrating to the boot cpu and then continuing with shutdown/reboot.
This also has the effect of not breaking x86's command line parameter for specifying the reboot cpu. Note, this code was shamelessly copied from arch/x86/kernel/reboot.c with bits removed pertaining to the reboot_cpu command line parameter.
To: Andrew Morton <[email protected]>
To: H. Peter Anvin <[email protected]>
Cc: Russ Anderson <[email protected]>
Cc: Robin Holt <[email protected]>
Cc: Russell King <[email protected]>
Cc: Guan Xuetao <[email protected]>
Cc: Linux Kernel Mailing List <[email protected]>
Cc: the arch/x86 maintainers <[email protected]>
Cc: Arm Mailing List <[email protected]>
Cc: <[email protected]>
---
Changes since -v6:
- Add #define for PF_THREAD_BOUND as compatibility to make stable easier.
- Fixup s/reboot_cpu_id/reboot_cpu/
--- kernel/sys.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-)
kernel/sys.c +26 -3
@@ -362,6 +362,29 @@ int unregister_reboot_notifier(struct notifier_block *nb) }EXPORT_SYMBOL (unregister_reboot_notifier); +/* Add backwards compatibility for stable trees. */ +#ifndef PF_NO_SETAFFINITY +#define PF_NO_SETAFFINITY PF_THREAD_BOUND +#endif + +static void migrate_to_reboot_cpu (void ) +{ +/* The boot cpu is always logical cpu 0 */ +int reboot_cpu =0 ; + +cpu_hotplug_disable (); + +/* Make certain the cpu I'm about to reboot on is online */ +if (!cpu_online (reboot_cpu)) + reboot_cpu =cpumask_first (cpu_online_mask); + +/* Prevent races with other tasks migrating this task */ + current->flags |=PF_NO_SETAFFINITY ; + +/* Make certain I only run on the appropriate processor */ +set_cpus_allowed_ptr (current,cpumask_of (reboot_cpu)); +} +/** * kernel_restart - reboot the system * @cmd: pointer to buffer containing command to execute for restart
@@ -373,7 +396,7 @@ EXPORT_SYMBOL(unregister_reboot_notifier);void kernel_restart (char *cmd) {kernel_restart_prepare (cmd); -disable_nonboot_cpus (); +migrate_to_reboot_cpu ();syscore_shutdown ();if (!cmd)printk (KERN_EMERG "Restarting system.\n" );
@@ -400,7 +423,7 @@ static void kernel_shutdown_prepare(enum system_states state)void kernel_halt (void ) {kernel_shutdown_prepare (SYSTEM_HALT ); -disable_nonboot_cpus (); +migrate_to_reboot_cpu ();syscore_shutdown ();printk (KERN_EMERG "System halted.\n" );kmsg_dump (KMSG_DUMP_HALT );
@@ -419,7 +442,7 @@ void kernel_power_off(void)kernel_shutdown_prepare (SYSTEM_POWER_OFF );if (pm_power_off_prepare)pm_power_off_prepare (); -disable_nonboot_cpus (); +migrate_to_reboot_cpu ();syscore_shutdown ();printk (KERN_EMERG "Power down.\n" );kmsg_dump (KMSG_DUMP_POWEROFF );
Signature · 1 line
1.8.2.1
PATCH 3/11 Remove -stable friendly PF_THREAD_BOUND define
In reply to Robin HoltRemove the prior patch's #define for easier backporting to the stable releases.
To: Andrew Morton <[email protected]>
To: H. Peter Anvin <[email protected]>
Cc: Russ Anderson <[email protected]>
Cc: Robin Holt <[email protected]>
Cc: Russell King <[email protected]>
Cc: Guan Xuetao <[email protected]>
Cc: Linux Kernel Mailing List <[email protected]>
Cc: the arch/x86 maintainers <[email protected]>
Cc: Arm Mailing List <[email protected]>
--- kernel/sys.c | 5 ----- 1 file changed, 5 deletions(-)
kernel/sys.c +0 -5
@@ -362,11 +362,6 @@ int unregister_reboot_notifier(struct notifier_block *nb) }EXPORT_SYMBOL (unregister_reboot_notifier); -/* Add backwards compatibility for stable trees. */ -#ifndef PF_NO_SETAFFINITY -#define PF_NO_SETAFFINITY PF_THREAD_BOUND -#endif -static void migrate_to_reboot_cpu (void ) {/* The boot cpu is always logical cpu 0 */
Signature · 1 line
1.8.2.1
PATCH 4/11 Move shutdown/reboot related functions to kernel/reboot.c
In reply to Robin HoltThis patch is preparatory. It moves reboot related syscall, etc functions from kernel/sys.c to kernel/reboot.c.
To: Andrew Morton <[email protected]>
To: H. Peter Anvin <[email protected]>
Cc: Russ Anderson <[email protected]>
Cc: Robin Holt <[email protected]>
Cc: Russell King <[email protected]>
Cc: Guan Xuetao <[email protected]>
Cc: Linux Kernel Mailing List <[email protected]>
Cc: the arch/x86 maintainers <[email protected]>
Cc: Arm Mailing List <[email protected]>
---
Changes since -v6:
- Add include of linux/uaccess.h to allow building on arm.
--- kernel/Makefile | 2 +- kernel/reboot.c | 347 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ kernel/sys.c | 331 ----------------------------------------------------- 3 files changed, 348 insertions(+), 332 deletions(-) create mode 100644 kernel/reboot.c
kernel/Makefile +1 -1
@@ -9,7 +9,7 @@ obj-y = fork.o exec_domain.o panic.o printk.o \ rcupdate.o extable.o params.o posix-timers.o \ kthread.o wait.o sys_ni.o posix-cpu-timers.o mutex.o \ hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \ - notifier.o ksysfs.o cred.o \ + notifier.o ksysfs.o cred.o reboot.o \ async.o range.o groups.o lglock.o smpboot.o ifdef CONFIG_FUNCTION_TRACER
kernel/reboot.c new file +347 -0
347 lines not on this page · raw message
kernel/sys.c +0 -331
349 lines not on this page · raw message
Signature · 1 line
1.8.2.1
PATCH 5/11 checkpatch.pl the new kernel/reboot.c file.
In reply to Robin HoltGet the new file to pass scripts/checkpatch.pl
To: Andrew Morton <[email protected]>
To: H. Peter Anvin <[email protected]>
Cc: Russ Anderson <[email protected]>
Cc: Robin Holt <[email protected]>
Cc: Russell King <[email protected]>
Cc: Guan Xuetao <[email protected]>
Cc: Linux Kernel Mailing List <[email protected]>
Cc: the arch/x86 maintainers <[email protected]>
Cc: Arm Mailing List <[email protected]>
---
Changes since v6:
- Removed last remaining line length warning.
--- kernel/reboot.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-)
kernel/reboot.c +13 -14
@@ -4,6 +4,8 @@* Copyright (C) 2013 Linus Torvalds */ +#define pr_fmt (fmt) "reboot: " fmt +#include <linux/export.h> #include <linux/kexec.h> #include <linux/kmod.h>
@@ -114,9 +116,9 @@ void kernel_restart(char *cmd)migrate_to_reboot_cpu ();syscore_shutdown ();if (!cmd) -printk (KERN_EMERG "Restarting system.\n" ); +pr_emerg ("Restarting system\n" );else -printk (KERN_EMERG "Restarting system with command '%s'.\n" , cmd); +pr_emerg ("Restarting system with command '%s'\n" , cmd);kmsg_dump (KMSG_DUMP_RESTART );machine_restart (cmd); }
@@ -125,7 +127,7 @@ EXPORT_SYMBOL_GPL(kernel_restart);static void kernel_shutdown_prepare (enum system_states state) {blocking_notifier_call_chain (&reboot_notifier_list, - (state ==SYSTEM_HALT )?SYS_HALT :SYS_POWER_OFF ,NULL ); + (state ==SYSTEM_HALT ) ?SYS_HALT :SYS_POWER_OFF ,NULL ); system_state = state;usermodehelper_disable ();device_shutdown ();
@@ -140,11 +142,10 @@ void kernel_halt(void)kernel_shutdown_prepare (SYSTEM_HALT );migrate_to_reboot_cpu ();syscore_shutdown (); -printk (KERN_EMERG "System halted.\n" ); +pr_emerg ("System halted\n" );kmsg_dump (KMSG_DUMP_HALT );machine_halt (); } -EXPORT_SYMBOL_GPL (kernel_halt);/**
@@ -159,7 +160,7 @@ void kernel_power_off(void)pm_power_off_prepare ();migrate_to_reboot_cpu ();syscore_shutdown (); -printk (KERN_EMERG "Power down.\n" ); +pr_emerg ("Power down\n" );kmsg_dump (KMSG_DUMP_POWEROFF );machine_power_off (); }
@@ -188,10 +189,10 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,/* For safety, we require "magic" arguments. */ if (magic1 !=LINUX_REBOOT_MAGIC1 || - (magic2 !=LINUX_REBOOT_MAGIC2 && - magic2 !=LINUX_REBOOT_MAGIC2A && + (magic2 !=LINUX_REBOOT_MAGIC2 && + magic2 !=LINUX_REBOOT_MAGIC2A && magic2 !=LINUX_REBOOT_MAGIC2B && - magic2 !=LINUX_REBOOT_MAGIC2C )) + magic2 !=LINUX_REBOOT_MAGIC2C ))return -EINVAL ;/*
@@ -234,7 +235,8 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,break ;case LINUX_REBOOT_CMD_RESTART2 : -if (strncpy_from_user (&buffer[0 ], arg,sizeof (buffer) -1 ) <0 ) { + ret =strncpy_from_user (&buffer[0 ], arg,sizeof (buffer) -1 ); +if (ret <0 ) { ret = -EFAULT ;break ; }
@@ -301,14 +303,11 @@ static int __orderly_poweroff(bool force) ret =call_usermodehelper (argv[0 ], argv, envp,UMH_WAIT_EXEC );argv_free (argv); }else { -printk (KERN_WARNING "%s failed to allocate memory for \"%s\"\n" , - __func__, poweroff_cmd); ret = -ENOMEM ; }if (ret && force) { -printk (KERN_WARNING "Failed to start orderly shutdown: " -"forcing the issue\n" ); +pr_warn ("Failed to start orderly shutdown: forcing the issue\n" );/* * I guess this should try to kick off some daemon to sync and * poweroff asap. Or not even bother syncing if we're doing an
Signature · 1 line
1.8.2.1
PATCH 6/11 x86, prepare reboot_mode for moving to generic kernel code.
In reply to Robin HoltThis patch prepares for the moving the parsing of reboot= to the generic kernel code by making reboot_mode into a more generic form.
To: Miguel Boton <[email protected]>
To: Andrew Morton <[email protected]>
To: H. Peter Anvin <[email protected]>
Cc: Russ Anderson <[email protected]>
Cc: Robin Holt <[email protected]>
Cc: Russell King <[email protected]>
Cc: Guan Xuetao <[email protected]>
Cc: Linux Kernel Mailing List <[email protected]>
Cc: the arch/x86 maintainers <[email protected]>
Cc: Arm Mailing List <[email protected]>
--- arch/x86/kernel/reboot.c | 12 +++++++----- include/linux/reboot.h | 5 +++++ 2 files changed, 12 insertions(+), 5 deletions(-)
arch/x86/kernel/reboot.c +7 -5
@@ -36,7 +36,7 @@ void (*pm_power_off)(void);EXPORT_SYMBOL (pm_power_off);static const struct desc_ptr no_idt = {}; -static int reboot_mode; +static enum reboot_mode reboot_mode =REBOOT_COLD ;enum reboot_type reboot_type =BOOT_ACPI ;int reboot_force;
@@ -88,11 +88,11 @@ static int __init reboot_setup(char *str)switch (*str) {case 'w' : - reboot_mode =0x1234 ; + reboot_mode =REBOOT_WARM ;break ;case 'c' : - reboot_mode =0 ; + reboot_mode =REBOOT_COLD ;break ;#ifdef CONFIG_SMP
@@ -536,6 +536,7 @@ static void native_machine_emergency_restart(void)int i;int attempt =0 ;int orig_reboot_type = reboot_type; +unsigned short mode;if (reboot_emergency)emergency_vmx_disable_all ();
@@ -543,7 +544,8 @@ static void native_machine_emergency_restart(void)tboot_shutdown (TB_SHUTDOWN_REBOOT );/* Tell the BIOS if we want cold or warm reboot */ - *((unsigned short *)__va (0x472 )) = reboot_mode; + mode = reboot_mode ==REBOOT_WARM ?0x1234 :0 ; + *((unsigned short *)__va (0x472 )) = mode;for (;;) {/* Could also try the reset bit in the Hammer NB */
@@ -585,7 +587,7 @@ static void native_machine_emergency_restart(void)case BOOT_EFI :if (efi_enabled (EFI_RUNTIME_SERVICES )) - efi.reset_system (reboot_mode ? + efi.reset_system (reboot_mode ==REBOOT_WARM ?EFI_RESET_WARM :EFI_RESET_COLD ,EFI_SUCCESS ,0 ,NULL );
include/linux/reboot.h +5 -0
@@ -10,6 +10,11 @@#define SYS_HALT 0x0002/* Notify of system halt */ #define SYS_POWER_OFF 0x0003/* Notify of system power off */ +enum reboot_mode { +REBOOT_COLD =0 , +REBOOT_WARM , +}; +extern int register_reboot_notifier (struct notifier_block *);extern int unregister_reboot_notifier (struct notifier_block *);
Signature · 1 line
1.8.2.1
PATCH 7/11 unicore32, prepare reboot_mode for moving to generic kernel code.
In reply to Robin HoltThis patch prepares for the moving the parsing of reboot= to the generic kernel code by making reboot_mode into a more generic form.
To: Andrew Morton <[email protected]>
To: Guan Xuetao <[email protected]>
Cc: Russ Anderson <[email protected]>
Cc: Robin Holt <[email protected]>
Cc: Russell King <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Linux Kernel Mailing List <[email protected]>
Cc: the arch/x86 maintainers <[email protected]>
Cc: Arm Mailing List <[email protected]>
--- arch/unicore32/kernel/process.c | 10 +++++----- arch/unicore32/kernel/setup.h | 2 +- arch/unicore32/mm/mmu.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-)
arch/unicore32/kernel/process.c +5 -5
@@ -51,14 +51,14 @@ void arch_cpu_idle(void)local_irq_enable (); } -static char reboot_mode ='h' ; +static enum reboot_mode reboot_mode;int __init reboot_setup (char *str) { - reboot_mode = str[0 ]; +if ('s' == str[0 ]) + reboot_mode =REBOOT_WARM ;return 1 ; } -__setup ("reboot=" , reboot_setup);void machine_halt (void )
@@ -88,7 +88,7 @@ void machine_restart(char *cmd)* we may need it to insert some 1:1 mappings so that * soft boot works. */ -setup_mm_for_reboot (reboot_mode); +setup_mm_for_reboot ();/* Clean and invalidate caches */ flush_cache_all ();
@@ -102,7 +102,7 @@ void machine_restart(char *cmd)/* * Now handle reboot code. */ -if (reboot_mode =='s' ) { +if (reboot_mode ==REBOOT_WARM ) {/* Jump into ROM at address 0xffff0000 */ cpu_reset (VECTORS_BASE ); }else {
arch/unicore32/kernel/setup.h +1 -1
@@ -22,7 +22,7 @@ extern void puv3_ps2_init(void);extern void pci_puv3_preinit (void );extern void __init puv3_init_gpio (void ); -extern void setup_mm_for_reboot (char mode); +extern void setup_mm_for_reboot (void );extern char __stubs_start[], __stubs_end[];extern char __vectors_start[], __vectors_end[];
arch/unicore32/mm/mmu.c +1 -1
@@ -445,7 +445,7 @@ void __init paging_init(void)* the user-mode pages. This will then ensure that we have predictable * results when turning the mmu off */ -void setup_mm_for_reboot (char mode) +void setup_mm_for_reboot (void ) {unsigned long base_pmdval;pgd_t *pgd;
Signature · 1 line
1.8.2.1
PATCH 8/11 arm, Remove unused restart_mode fields from some arm subarchs
In reply to Robin HoltThese restart_mode fields are not used at all. Remove them to make moving the reboot= cmdline options to the general kernel easier.
To: Andrew Morton <[email protected]>
To: Russell King <[email protected]>
Cc: Russ Anderson <[email protected]>
Cc: Robin Holt <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Guan Xuetao <[email protected]>
Cc: Linux Kernel Mailing List <[email protected]>
Cc: the arch/x86 maintainers <[email protected]>
Cc: Arm Mailing List <[email protected]>
--- arch/arm/mach-ebsa110/core.c | 1 - arch/arm/mach-pxa/mioa701.c | 1 - arch/arm/mach-pxa/spitz.c | 3 --- arch/arm/mach-pxa/tosa.c | 1 - 4 files changed, 6 deletions(-)
arch/arm/mach-ebsa110/core.c +0 -1
@@ -321,7 +321,6 @@ MACHINE_START(EBSA110, "EBSA110") .atag_offset = 0x400, .reserve_lp0 = 1, .reserve_lp2 = 1, - .restart_mode = 's', .map_io = ebsa110_map_io, .init_early = ebsa110_init_early, .init_irq = ebsa110_init_irq,
arch/arm/mach-pxa/mioa701.c +0 -1
@@ -756,7 +756,6 @@ static void mioa701_machine_exit(void)MACHINE_START (MIOA701 ,"MIO A701" ) .atag_offset = 0x100, - .restart_mode = 's', .map_io = &pxa27x_map_io, .nr_irqs = PXA_NR_IRQS, .init_irq = &pxa27x_init_irq,
arch/arm/mach-pxa/spitz.c +0 -3
@@ -979,7 +979,6 @@ static void __init spitz_fixup(struct tag *tags, char **cmdline,#ifdef CONFIG_MACH_SPITZ MACHINE_START (SPITZ ,"SHARP Spitz" ) - .restart_mode = 'g', .fixup = spitz_fixup, .map_io = pxa27x_map_io, .nr_irqs = PXA_NR_IRQS,
@@ -993,7 +992,6 @@ MACHINE_END#ifdef CONFIG_MACH_BORZOI MACHINE_START (BORZOI ,"SHARP Borzoi" ) - .restart_mode = 'g', .fixup = spitz_fixup, .map_io = pxa27x_map_io, .nr_irqs = PXA_NR_IRQS,
@@ -1007,7 +1005,6 @@ MACHINE_END#ifdef CONFIG_MACH_AKITA MACHINE_START (AKITA ,"SHARP Akita" ) - .restart_mode = 'g', .fixup = spitz_fixup, .map_io = pxa27x_map_io, .nr_irqs = PXA_NR_IRQS,
arch/arm/mach-pxa/tosa.c +0 -1
@@ -969,7 +969,6 @@ static void __init fixup_tosa(struct tag *tags, char **cmdline, }MACHINE_START (TOSA ,"SHARP Tosa" ) - .restart_mode = 'g', .fixup = fixup_tosa, .map_io = pxa25x_map_io, .nr_irqs = TOSA_NR_IRQS,
Signature · 1 line
1.8.2.1
Re: [PATCH -v7 08/11] arm, Remove unused restart_mode fields from some arm subarchs
Quoted 2 lines · Robin Holt
These
restart_modefields are not used at all. Remove them to make moving the reboot= cmdline options to the general kernel easier.
Your grepping is faulty. They are most definitely used.
PATCH 9/11 arm, prepare reboot_mode for moving to generic kernel code.
In reply to Robin HoltThis patch prepares for the moving the parsing of reboot= to the generic kernel code by making reboot_mode into a more generic form.
To: Andrew Morton <[email protected]>
To: Russell King <[email protected]>
Cc: Russ Anderson <[email protected]>
Cc: Robin Holt <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Guan Xuetao <[email protected]>
Cc: Linux Kernel Mailing List <[email protected]>
Cc: the arch/x86 maintainers <[email protected]>
Cc: Arm Mailing List <[email protected]>
--- arch/arm/include/asm/mach/arch.h | 3 ++- arch/arm/kernel/process.c | 8 ++++---- arch/arm/kernel/setup.c | 6 +++--- arch/arm/mach-footbridge/cats-hw.c | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-)
arch/arm/include/asm/mach/arch.h +2 -1
@@ -9,6 +9,7 @@*/ #ifndef __ASSEMBLY__ +#include <linux/reboot.h> struct tag ;struct meminfo ;
@@ -39,7 +40,7 @@ struct machine_desc { unsigned char reserve_lp0 :1; /* never has lp0 */ unsigned char reserve_lp1 :1; /* never has lp1 */ unsigned char reserve_lp2 :1; /* never has lp2 */ -char restart_mode;/* default restart mode */ +enum reboot_mode reboot_mode;/* default restart mode */ struct smp_operations *smp;/* SMP operations */ void (*fixup)(struct tag *,char **,struct meminfo *);
arch/arm/kernel/process.c +4 -4
@@ -174,14 +174,14 @@ void arch_cpu_idle(void)default_idle (); } -static char reboot_mode ='h' ; +enum reboot_mode reboot_mode; -int __init reboot_setup (char *str) +static int __init reboot_setup (char *str) { - reboot_mode = str[0 ]; +if ('s' == str[0 ]) + reboot_mode =REBOOT_WARM ;return 1 ; } -__setup ("reboot=" , reboot_setup);void machine_shutdown (void )
arch/arm/kernel/setup.c +3 -3
@@ -72,7 +72,7 @@ __setup("fpe=", fpe_setup);extern void paging_init (struct machine_desc *desc);extern void sanity_check_meminfo (void ); -extern void reboot_setup (char *str); +extern enum reboot_mode reboot_mode;extern void setup_dma_zone (struct machine_desc *desc);unsigned int processor_id;
@@ -758,8 +758,8 @@ void __init setup_arch(char **cmdline_p)setup_dma_zone (mdesc); -if (mdesc->restart_mode) -reboot_setup (&mdesc->restart_mode); +if (mdesc->reboot_mode !=REBOOT_COLD ) + reboot_mode = mdesc->reboot_mode; init_mm.start_code = (unsigned long ) _text; init_mm.end_code = (unsigned long ) _etext;
arch/arm/mach-footbridge/cats-hw.c +1 -1
@@ -86,7 +86,7 @@ fixup_cats(struct tag *tags, char **cmdline, struct meminfo *mi)MACHINE_START (CATS ,"Chalice-CATS" )/* Maintainer: Philip Blundell */ .atag_offset = 0x100, - .restart_mode = 's', + .reboot_mode = REBOOT_WARM, .fixup = fixup_cats, .map_io = footbridge_map_io, .init_irq = footbridge_init_irq,
Signature · 1 line
1.8.2.1
PATCH 10/11 arm, change reboot_mode to use enum reboot_mode
In reply to Robin HoltPreparing to move the parsing of reboot= to generic kernel code forces the change in reboot_mode handling to use the enum.
To: Andrew Morton <[email protected]>
To: Russell King <[email protected]>
Cc: Russ Anderson <[email protected]>
Cc: Robin Holt <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Guan Xuetao <[email protected]>
Cc: Linux Kernel Mailing List <[email protected]>
Cc: the arch/x86 maintainers <[email protected]>
Cc: Arm Mailing List <[email protected]>
--- arch/arm/include/asm/hardware/iop3xx.h | 3 ++- arch/arm/include/asm/mach/arch.h | 2 +- arch/arm/include/asm/system_misc.h | 3 ++- arch/arm/kernel/process.c | 5 +++-- arch/arm/mach-at91/at91rm9200.c | 3 ++- arch/arm/mach-at91/generic.h | 5 +++-- arch/arm/mach-bcm2835/bcm2835.c | 4 ++-- arch/arm/mach-clps711x/common.c | 2 +- arch/arm/mach-clps711x/common.h | 4 +++- arch/arm/mach-cns3xxx/core.h | 4 +++- arch/arm/mach-cns3xxx/pm.c | 2 +- arch/arm/mach-davinci/devices-da8xx.c | 3 ++- arch/arm/mach-davinci/devices.c | 3 ++- arch/arm/mach-davinci/include/mach/common.h | 3 ++- arch/arm/mach-davinci/include/mach/da8xx.h | 3 ++- arch/arm/mach-davinci/include/mach/tnetv107x.h | 3 ++- arch/arm/mach-davinci/tnetv107x.c | 3 ++- arch/arm/mach-dove/common.c | 2 +- arch/arm/mach-dove/common.h | 4 +++- arch/arm/mach-ebsa110/core.c | 2 +- arch/arm/mach-ep93xx/core.c | 3 ++- arch/arm/mach-ep93xx/include/mach/platform.h | 4 +++- arch/arm/mach-exynos/common.c | 4 ++-- arch/arm/mach-exynos/common.h | 6 ++++-- arch/arm/mach-footbridge/common.c | 4 ++-- arch/arm/mach-footbridge/common.h | 3 ++- arch/arm/mach-footbridge/netwinder-hw.c | 4 ++-- arch/arm/mach-h720x/common.c | 2 +- arch/arm/mach-h720x/common.h | 4 +++- arch/arm/mach-highbank/core.h | 4 +++- arch/arm/mach-highbank/system.c | 5 +++-- arch/arm/mach-imx/common.h | 4 +++- arch/arm/mach-imx/mach-imx6q.c | 3 ++- arch/arm/mach-imx/system.c | 2 +- arch/arm/mach-integrator/common.h | 3 ++- arch/arm/mach-integrator/core.c | 2 +- arch/arm/mach-iop13xx/include/mach/iop13xx.h | 5 ++++- arch/arm/mach-iop13xx/setup.c | 2 +- arch/arm/mach-iop32x/n2100.c | 2 +- arch/arm/mach-ixp4xx/common.c | 4 ++-- arch/arm/mach-ixp4xx/dsmg600-setup.c | 1 + arch/arm/mach-ixp4xx/include/mach/platform.h | 4 +++- arch/arm/mach-ixp4xx/include/mach/timex.h | 2 +- arch/arm/mach-kirkwood/board-lsxl.c | 2 +- arch/arm/mach-kirkwood/common.c | 3 ++- arch/arm/mach-kirkwood/common.h | 4 +++- arch/arm/mach-ks8695/generic.h | 2 +- arch/arm/mach-ks8695/time.c | 4 ++-- arch/arm/mach-lpc32xx/common.c | 6 +++--- arch/arm/mach-lpc32xx/common.h | 3 ++- arch/arm/mach-mmp/common.c | 2 +- arch/arm/mach-mmp/common.h | 3 ++- arch/arm/mach-mmp/include/mach/pxa168.h | 4 +++- arch/arm/mach-mmp/pxa168.c | 2 +- arch/arm/mach-mv78xx0/common.c | 2 +- arch/arm/mach-mv78xx0/common.h | 4 +++- arch/arm/mach-mvebu/common.h | 4 +++- arch/arm/mach-mvebu/system-controller.c | 3 ++- arch/arm/mach-mxs/include/mach/common.h | 4 +++- arch/arm/mach-mxs/system.c | 2 +- arch/arm/mach-netx/generic.c | 3 ++- arch/arm/mach-netx/generic.h | 4 +++- arch/arm/mach-nomadik/cpu-8815.c | 2 +- arch/arm/mach-omap1/board-voiceblue.c | 3 ++- arch/arm/mach-omap1/common.h | 3 ++- arch/arm/mach-omap1/reset.c | 3 ++- arch/arm/mach-omap2/am33xx-restart.c | 3 ++- arch/arm/mach-omap2/common.h | 17 +++++++++-------- arch/arm/mach-omap2/omap2-restart.c | 2 +- arch/arm/mach-omap2/omap3-restart.c | 3 ++- arch/arm/mach-omap2/omap4-common.c | 3 ++- arch/arm/mach-orion5x/common.c | 2 +- arch/arm/mach-orion5x/common.h | 4 +++- arch/arm/mach-orion5x/ls-chl-setup.c | 2 +- arch/arm/mach-orion5x/ls_hgl-setup.c | 2 +- arch/arm/mach-orion5x/lsmini-setup.c | 2 +- arch/arm/mach-picoxcell/common.c | 3 ++- arch/arm/mach-prima2/common.h | 4 +++- arch/arm/mach-prima2/rstc.c | 3 ++- arch/arm/mach-pxa/corgi.c | 6 +++--- arch/arm/mach-pxa/generic.h | 4 +++- arch/arm/mach-pxa/mioa701.c | 7 ++++--- arch/arm/mach-pxa/poodle.c | 2 +- arch/arm/mach-pxa/reset.c | 8 ++++---- arch/arm/mach-pxa/spitz.c | 5 +++-- arch/arm/mach-pxa/tosa.c | 5 +++-- arch/arm/mach-realview/realview_eb.c | 3 ++- arch/arm/mach-realview/realview_pb1176.c | 3 ++- arch/arm/mach-realview/realview_pb11mp.c | 3 ++- arch/arm/mach-realview/realview_pba8.c | 3 ++- arch/arm/mach-realview/realview_pbx.c | 3 ++- arch/arm/mach-rpc/riscpc.c | 3 ++- arch/arm/mach-s3c24xx/common.h | 6 ++++-- arch/arm/mach-s3c24xx/s3c2410.c | 5 +++-- arch/arm/mach-s3c24xx/s3c2412.c | 5 +++-- arch/arm/mach-s3c24xx/s3c2416.c | 5 +++-- arch/arm/mach-s3c24xx/s3c2443.c | 5 +++-- arch/arm/mach-s3c24xx/s3c244x.c | 5 +++-- arch/arm/mach-s3c64xx/common.c | 5 +++-- arch/arm/mach-s3c64xx/common.h | 4 +++- arch/arm/mach-s5p64x0/common.c | 5 +++-- arch/arm/mach-s5p64x0/common.h | 4 +++- arch/arm/mach-s5pc100/common.c | 5 +++-- arch/arm/mach-s5pc100/common.h | 4 +++- arch/arm/mach-s5pv210/common.c | 2 +- arch/arm/mach-s5pv210/common.h | 4 +++- arch/arm/mach-sa1100/generic.c | 5 +++-- arch/arm/mach-sa1100/generic.h | 3 ++- arch/arm/mach-shark/core.c | 3 ++- arch/arm/mach-shmobile/board-armadillo800eva.c | 3 ++- arch/arm/mach-shmobile/board-kzm9g.c | 3 ++- arch/arm/mach-socfpga/socfpga.c | 3 ++- arch/arm/mach-spear13xx/include/mach/generic.h | 4 +++- arch/arm/mach-spear3xx/include/mach/generic.h | 4 +++- arch/arm/mach-spear6xx/include/mach/generic.h | 3 ++- arch/arm/mach-sunxi/sunxi.c | 3 ++- arch/arm/mach-tegra/board.h | 3 ++- arch/arm/mach-tegra/common.c | 3 ++- arch/arm/mach-u300/core.c | 6 +++--- arch/arm/mach-versatile/core.c | 3 ++- arch/arm/mach-versatile/core.h | 3 ++- arch/arm/mach-vt8500/vt8500.c | 3 ++- arch/arm/mach-w90x900/cpu.c | 4 ++-- arch/arm/mach-w90x900/nuc9xx.h | 5 ++++- arch/arm/plat-iop/gpio.c | 1 + arch/arm/plat-iop/restart.c | 2 +- arch/arm/plat-samsung/include/plat/s3c2412.h | 4 +++- arch/arm/plat-samsung/include/plat/s3c2416.h | 4 +++- arch/arm/plat-samsung/include/plat/s3c2443.h | 4 +++- arch/arm/plat-spear/restart.c | 5 +++-- drivers/power/reset/restart-poweroff.c | 3 ++- drivers/power/reset/vexpress-poweroff.c | 2 +- include/linux/reboot.h | 1 + include/linux/vexpress.h | 1 + 134 files changed, 300 insertions(+), 172 deletions(-)
arch/arm/include/asm/hardware/iop3xx.h +2 -1
@@ -223,11 +223,12 @@ extern int iop3xx_get_init_atu(void);#ifndef __ASSEMBLY__#include <linux/types.h> +#include <linux/reboot.h> void iop3xx_map_io (void );void iop_init_cp6_handler (void );void iop_init_time (unsigned long tickrate); -void iop3xx_restart (char ,const char *); +void iop3xx_restart (enum reboot_mode ,const char *);static inline u32 read_tmr0 (void ) {
arch/arm/include/asm/mach/arch.h +1 -1
@@ -54,7 +54,7 @@ struct machine_desc {#ifdef CONFIG_MULTI_IRQ_HANDLER void (*handle_irq)(struct pt_regs *);#endif -void (*restart)(char ,const char *); +void (*restart)(enum reboot_mode ,const char *); };/*
arch/arm/include/asm/system_misc.h +2 -1
@@ -6,11 +6,12 @@#include <linux/compiler.h> #include <linux/linkage.h> #include <linux/irqflags.h> +#include <linux/reboot.h> extern void cpu_init (void );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);extern void (*arm_pm_idle)(void );#define UDBG_UNDEFINED (1 << 0)
arch/arm/kernel/process.c +3 -2
@@ -32,6 +32,7 @@#include <linux/hw_breakpoint.h> #include <linux/cpuidle.h> #include <linux/leds.h> +#include <linux/reboot.h> #include <asm/cacheflush.h> #include <asm/idmap.h>
@@ -112,7 +113,7 @@ void soft_restart(unsigned long addr)BUG (); } -static void null_restart (char mode,const char *cmd) +static void null_restart (enum reboot_mode reboot_mode,const char *cmd) { }
@@ -122,7 +123,7 @@ static void null_restart(char mode, const char *cmd)void (*pm_power_off)(void );EXPORT_SYMBOL (pm_power_off); -void (*arm_pm_restart)(char str,const char *cmd) = null_restart; +void (*arm_pm_restart)(enum reboot_mode reboot_mode,const char *cmd) = null_restart;EXPORT_SYMBOL_GPL (arm_pm_restart);/*
arch/arm/mach-at91/at91rm9200.c +2 -1
@@ -11,6 +11,7 @@*/ #include <linux/module.h> +#include <linux/reboot.h> #include <asm/irq.h> #include <asm/mach/arch.h>
@@ -303,7 +304,7 @@ static void at91rm9200_idle(void)at91_pmc_write (AT91_PMC_SCDR ,AT91_PMC_PCK ); } -static void at91rm9200_restart (char mode,const char *cmd) +static void at91rm9200_restart (enum reboot_mode reboot_mode,const char *cmd) {/* * Perform a hardware reset with the use of the Watchdog timer.
arch/arm/mach-at91/generic.h +3 -2
@@ -10,6 +10,7 @@#include <linux/clkdev.h> #include <linux/of.h> +#include <linux/reboot.h> /* Map io */ extern void __init at91_map_io (void );
@@ -60,8 +61,8 @@ extern void at91sam9_idle(void);/* reset */ extern void at91_ioremap_rstc (u32 base_addr); -extern void at91sam9_alt_restart (char ,const char *); -extern void at91sam9g45_restart (char ,const char *); +extern void at91sam9_alt_restart (enum reboot_mode ,const char *); +extern void at91sam9g45_restart (enum reboot_mode ,const char *);/* shutdown */ extern void at91_ioremap_shdwc (u32 base_addr);
arch/arm/mach-bcm2835/bcm2835.c +2 -2
@@ -51,7 +51,7 @@ static void bcm2835_setup_restart(void)WARN (!wdt_regs,"failed to remap watchdog regs" ); } -static void bcm2835_restart (char mode,const char *cmd) +static void bcm2835_restart (enum reboot_mode mode,const char *cmd) {u32 val;
@@ -89,7 +89,7 @@ static void bcm2835_power_off(void)writel_relaxed (val, wdt_regs +PM_RSTS );/* Continue with normal reset mechanism */ -bcm2835_restart (0 ,"" ); +bcm2835_restart (REBOOT_COLD ,"" ); }static struct map_desc io_map__initdata = {
arch/arm/mach-clps711x/common.c +1 -1
@@ -345,7 +345,7 @@ void __init clps711x_timer_init(void)setup_irq (IRQ_TC2OI , &clps711x_timer_irq); } -void clps711x_restart (char mode,const char *cmd) +void clps711x_restart (enum reboot_mode mode,const char *cmd) {soft_restart (0 ); }
arch/arm/mach-clps711x/common.h +3 -1
@@ -4,6 +4,8 @@* Common bits. */ +#include <linux/reboot.h> +#define CLPS711X_NR_IRQS (33)#define CLPS711X_NR_GPIO (4 * 8 + 3)#define CLPS711X_GPIO (prt, bit) ((prt) * 8 + (bit))
@@ -12,4 +14,4 @@ extern void clps711x_map_io(void);extern void clps711x_init_irq (void );extern void clps711x_timer_init (void );extern void clps711x_handle_irq (struct pt_regs *regs); -extern void clps711x_restart (char mode,const char *cmd); +extern void clps711x_restart (enum reboot_mode mode,const char *cmd);
arch/arm/mach-cns3xxx/core.h +3 -1
@@ -11,6 +11,8 @@#ifndef __CNS3XXX_CORE_H#define __CNS3XXX_CORE_H +#include <linux/reboot.h> +extern void cns3xxx_timer_init (void );#ifdef CONFIG_CACHE_L2X0
@@ -22,6 +24,6 @@ static inline void cns3xxx_l2x0_init(void) {}void __init cns3xxx_map_io (void );void __init cns3xxx_init_irq (void );void cns3xxx_power_off (void ); -void cns3xxx_restart (char ,const char *); +void cns3xxx_restart (enum reboot_mode ,const char *);#endif /* __CNS3XXX_CORE_H */
arch/arm/mach-cns3xxx/pm.c +1 -1
@@ -89,7 +89,7 @@ void cns3xxx_pwr_soft_rst(unsigned int block) }EXPORT_SYMBOL (cns3xxx_pwr_soft_rst); -void cns3xxx_restart (char mode,const char *cmd) +void cns3xxx_restart (enum reboot_mode mode,const char *cmd) {/* * To reset, we hit the on-board reset register
arch/arm/mach-davinci/devices-da8xx.c +2 -1
@@ -16,6 +16,7 @@#include <linux/serial_8250.h> #include <linux/ahci_platform.h> #include <linux/clk.h> +#include <linux/reboot.h> #include <mach/cputype.h> #include <mach/common.h>
@@ -366,7 +367,7 @@ static struct platform_device da8xx_wdt_device = { .resource = da8xx_watchdog_resources, }; -void da8xx_restart (char mode,const char *cmd) +void da8xx_restart (enum reboot_mode mode,const char *cmd) {struct device *dev;
arch/arm/mach-davinci/devices.c +2 -1
@@ -13,6 +13,7 @@#include <linux/platform_device.h> #include <linux/dma-mapping.h> #include <linux/io.h> +#include <linux/reboot.h> #include <mach/hardware.h> #include <linux/platform_data/i2c-davinci.h>
@@ -301,7 +302,7 @@ struct platform_device davinci_wdt_device = { .resource = wdt_resources, }; -void davinci_restart (char mode,const char *cmd) +void davinci_restart (enum reboot_mode mode,const char *cmd) {davinci_watchdog_reset (&davinci_wdt_device); }
arch/arm/mach-davinci/include/mach/common.h +2 -1
@@ -14,6 +14,7 @@#include <linux/compiler.h> #include <linux/types.h> +#include <linux/reboot.h> extern void davinci_timer_init (void );
@@ -81,7 +82,7 @@ extern struct davinci_soc_info davinci_soc_info;extern void davinci_common_init (struct davinci_soc_info *soc_info);extern void davinci_init_ide (void ); -void davinci_restart (char mode,const char *cmd); +void davinci_restart (enum reboot_mode mode,const char *cmd);void davinci_init_late (void );#ifdef CONFIG_DAVINCI_RESET_CLOCKS
arch/arm/mach-davinci/include/mach/da8xx.h +2 -1
@@ -17,6 +17,7 @@#include <linux/davinci_emac.h> #include <linux/spi/spi.h> #include <linux/platform_data/davinci_asp.h> +#include <linux/reboot.h> #include <linux/videodev2.h> #include <mach/serial.h>
@@ -103,7 +104,7 @@ int __init da850_register_vpif_display (struct vpif_display_config *display_config);int __init da850_register_vpif_capture (struct vpif_capture_config *capture_config); -void da8xx_restart (char mode,const char *cmd); +void da8xx_restart (enum reboot_mode mode,const char *cmd);extern struct platform_device da8xx_serial_device;extern struct emac_platform_data da8xx_emac_pdata;
arch/arm/mach-davinci/include/mach/tnetv107x.h +2 -1
@@ -35,6 +35,7 @@#include <linux/serial_8250.h> #include <linux/input/matrix_keypad.h> #include <linux/mfd/ti_ssp.h> +#include <linux/reboot.h> #include <linux/platform_data/mmc-davinci.h> #include <linux/platform_data/mtd-davinci.h>
@@ -54,7 +55,7 @@ extern struct platform_device tnetv107x_serial_device;extern void __init tnetv107x_init (void );extern void __init tnetv107x_devices_init (struct tnetv107x_device_info *);extern void __init tnetv107x_irq_init (void ); -void tnetv107x_restart (char mode,const char *cmd); +void tnetv107x_restart (enum reboot_mode mode,const char *cmd);#endif
arch/arm/mach-davinci/tnetv107x.c +2 -1
@@ -19,6 +19,7 @@#include <linux/io.h> #include <linux/err.h> #include <linux/platform_device.h> +#include <linux/reboot.h> #include <asm/mach/map.h>
@@ -730,7 +731,7 @@ static void tnetv107x_watchdog_reset(struct platform_device *pdev)__raw_writel (1 , ®s->kick); } -void tnetv107x_restart (char mode,const char *cmd) +void tnetv107x_restart (enum reboot_mode mode,const char *cmd) {tnetv107x_watchdog_reset (&tnetv107x_wdt_device); }
arch/arm/mach-dove/common.c +1 -1
@@ -345,7 +345,7 @@ void __init dove_init(void)dove_xor1_init (); } -void dove_restart (char mode,const char *cmd) +void dove_restart (enum reboot_mode mode,const char *cmd) {/* * Enable soft reset to assert RSTOUTn.
arch/arm/mach-dove/common.h +3 -1
@@ -11,6 +11,8 @@#ifndef __ARCH_DOVE_COMMON_H#define __ARCH_DOVE_COMMON_H +#include <linux/reboot.h> +struct mv643xx_eth_platform_data ;struct mv_sata_platform_data ;
@@ -42,6 +44,6 @@ void dove_spi1_init(void);void dove_i2c_init (void );void dove_sdio0_init (void );void dove_sdio1_init (void ); -void dove_restart (char ,const char *); +void dove_restart (enum reboot_mode ,const char *);#endif
arch/arm/mach-ebsa110/core.c +1 -1
@@ -311,7 +311,7 @@ static int __init ebsa110_init(void)arch_initcall (ebsa110_init); -static void ebsa110_restart (char mode,const char *cmd) +static void ebsa110_restart (enum reboot_mode mode,const char *cmd) {soft_restart (0x80000000 ); }
arch/arm/mach-ep93xx/core.c +2 -1
@@ -35,6 +35,7 @@#include <linux/spi/spi.h> #include <linux/export.h> #include <linux/irqchip/arm-vic.h> +#include <linux/reboot.h> #include <mach/hardware.h> #include <linux/platform_data/video-ep93xx.h>
@@ -921,7 +922,7 @@ void __init ep93xx_init_devices(void)gpio_led_register_device (-1 , &ep93xx_led_data); } -void ep93xx_restart (char mode,const char *cmd) +void ep93xx_restart (enum reboot_mode mode,const char *cmd) {/* * Set then clear the SWRST bit to initiate a software reset
arch/arm/mach-ep93xx/include/mach/platform.h +3 -1
@@ -4,6 +4,8 @@#ifndef __ASSEMBLY__ +#include <linux/reboot.h> +struct i2c_gpio_platform_data ;struct i2c_board_info ;struct spi_board_info ;
@@ -55,7 +57,7 @@ void ep93xx_ide_release_gpio(struct platform_device *pdev);void ep93xx_init_devices (void );extern void ep93xx_timer_init (void ); -void ep93xx_restart (char ,const char *); +void ep93xx_restart (enum reboot_mode ,const char *);void ep93xx_init_late (void );#ifdef CONFIG_CRUNCH
arch/arm/mach-exynos/common.c +2 -2
@@ -293,12 +293,12 @@ static struct map_desc exynos5440_iodesc0[] __initdata = { }, }; -void exynos4_restart (char mode,const char *cmd) +void exynos4_restart (enum reboot_mode mode,const char *cmd) {__raw_writel (0x1 ,S5P_SWRESET ); } -void exynos5_restart (char mode,const char *cmd) +void exynos5_restart (enum reboot_mode mode,const char *cmd) {struct device_node *np;u32 val;
arch/arm/mach-exynos/common.h +4 -2
@@ -12,14 +12,16 @@#ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H#define __ARCH_ARM_MACH_EXYNOS_COMMON_H +#include <linux/reboot.h> +extern void exynos4_timer_init (void );struct map_desc ;void exynos_init_io (struct map_desc *mach_desc,int size);void exynos4_init_irq (void );void exynos5_init_irq (void ); -void exynos4_restart (char mode,const char *cmd); -void exynos5_restart (char mode,const char *cmd); +void exynos4_restart (enum reboot_mode mode,const char *cmd); +void exynos5_restart (enum reboot_mode mode,const char *cmd);void exynos_init_late (void );#ifdef CONFIG_PM_GENERIC_DOMAINS
arch/arm/mach-footbridge/common.c +2 -2
@@ -198,9 +198,9 @@ void __init footbridge_map_io(void) } } -void footbridge_restart (char mode,const char *cmd) +void footbridge_restart (enum reboot_mode mode,const char *cmd) { -if (mode =='s' ) { +if (mode ==REBOOT_WARM ) {/* Jump into the ROM */ soft_restart (0x41000000 ); }else {
arch/arm/mach-footbridge/common.h +2 -1
@@ -1,3 +1,4 @@ +#include <linux/reboot.h> extern void footbridge_timer_init (void );extern void isa_timer_init (void );
@@ -8,4 +9,4 @@ extern void footbridge_map_io(void);extern void footbridge_init_irq (void );extern void isa_init_irq (unsigned int irq); -extern void footbridge_restart (char ,const char *); +extern void footbridge_restart (enum reboot_mode ,const char *);
arch/arm/mach-footbridge/netwinder-hw.c +2 -2
@@ -634,9 +634,9 @@ fixup_netwinder(struct tag *tags, char **cmdline, struct meminfo *mi)#endif } -static void netwinder_restart (char mode,const char *cmd) +static void netwinder_restart (enum reboot_mode mode,const char *cmd) { -if (mode =='s' ) { +if (mode ==REBOOT_WARM ) {/* Jump into the ROM */ soft_restart (0x41000000 ); }else {
arch/arm/mach-h720x/common.c +1 -1
@@ -244,7 +244,7 @@ void __init h720x_map_io(void)iotable_init (h720x_io_desc,ARRAY_SIZE (h720x_io_desc)); } -void h720x_restart (char mode,const char *cmd) +void h720x_restart (enum reboot_mode mode,const char *cmd) {CPU_REG (PMU_BASE ,PMU_STAT ) |=PMU_WARMRESET ; }
arch/arm/mach-h720x/common.h +3 -1
@@ -13,10 +13,12 @@* */ +#include <linux/reboot.h> +extern u32 h720x_gettimeoffset (void );extern void __init h720x_init_irq (void );extern void __init h720x_map_io (void ); -extern void h720x_restart (char ,const char *); +extern void h720x_restart (enum reboot_mode ,const char *);#ifdef CONFIG_ARCH_H7202 extern void h7202_timer_init (void );
arch/arm/mach-highbank/core.h +3 -1
@@ -1,8 +1,10 @@#ifndef __HIGHBANK_CORE_H#define __HIGHBANK_CORE_H +#include <linux/reboot.h> +extern void highbank_set_cpu_jump (int cpu,void *jump_addr); -extern void highbank_restart (char ,const char *); +extern void highbank_restart (enum reboot_mode ,const char *);extern void __iomem *scu_base_addr;#ifdef CONFIG_PM_SLEEP
arch/arm/mach-highbank/system.c +3 -2
@@ -15,13 +15,14 @@*/ #include <linux/io.h> #include <asm/proc-fns.h> +#include <linux/reboot.h> #include "core.h" #include "sysregs.h" -void highbank_restart (char mode,const char *cmd) +void highbank_restart (enum reboot_mode mode,const char *cmd) { -if (mode =='h' ) +if (mode ==REBOOT_COLD )highbank_set_pwr_hard_reset ();else highbank_set_pwr_soft_reset ();
arch/arm/mach-imx/common.h +3 -1
@@ -11,6 +11,8 @@#ifndef __ASM_ARCH_MXC_COMMON_H__#define __ASM_ARCH_MXC_COMMON_H__ +#include <linux/reboot.h> +struct platform_device ;struct clk ;enum mxc_cpu_pwr_mode ;
@@ -71,7 +73,7 @@ extern int mx6q_clocks_init(void);extern struct platform_device *mxc_register_gpio (char *name,int id,resource_size_t iobase,resource_size_t iosize,int irq,int irq_high);extern void mxc_set_cpu_type (unsigned int type); -extern void mxc_restart (char ,const char *); +extern void mxc_restart (enum reboot_mode ,const char *);extern void mxc_arch_reset_init (void __iomem *);extern int mx53_revision (void );extern int mx53_display_revision (void );
arch/arm/mach-imx/mach-imx6q.c +2 -1
@@ -25,6 +25,7 @@#include <linux/of_platform.h> #include <linux/opp.h> #include <linux/phy.h> +#include <linux/reboot.h> #include <linux/regmap.h> #include <linux/micrel_phy.h> #include <linux/mfd/syscon.h>
@@ -73,7 +74,7 @@ static int imx6q_revision(void) } } -void imx6q_restart (char mode,const char *cmd) +void imx6q_restart (enum reboot_mode mode,const char *cmd) {struct device_node *np;void __iomem *wdog_base;
arch/arm/mach-imx/system.c +1 -1
@@ -34,7 +34,7 @@ static void __iomem *wdog_base;/* * Reset the system. It is called by machine_restart(). */ -void mxc_restart (char mode,const char *cmd) +void mxc_restart (enum reboot_mode mode,const char *cmd) {unsigned int wcr_enable;
arch/arm/mach-integrator/common.h +2 -1
@@ -1,7 +1,8 @@ +#include <linux/reboot.h> #include <linux/amba/serial.h> extern struct amba_pl010_data ap_uart_data;void integrator_init_early (void );int integrator_init (bool is_cp);void integrator_reserve (void ); -void integrator_restart (char ,const char *); +void integrator_restart (enum reboot_mode ,const char *);void integrator_init_sysfs (struct device *parent,u32 id);
arch/arm/mach-integrator/core.c +1 -1
@@ -124,7 +124,7 @@ void __init integrator_reserve(void)/* * To reset, we hit the on-board reset register in the system FPGA */ -void integrator_restart (char mode,const char *cmd) +void integrator_restart (enum reboot_mode mode,const char *cmd) {cm_control (CM_CTRL_RESET ,CM_CTRL_RESET ); }
arch/arm/mach-iop13xx/include/mach/iop13xx.h +4 -1
@@ -2,6 +2,9 @@#define _IOP13XX_HW_H_#ifndef __ASSEMBLY__ + +#include <linux/reboot.h> +/* The ATU offsets can change based on the strapping */ extern u32 iop13xx_atux_pmmr_offset;extern u32 iop13xx_atue_pmmr_offset;
@@ -11,7 +14,7 @@ void iop13xx_map_io(void);void iop13xx_platform_init (void );void iop13xx_add_tpmi_devices (void );void iop13xx_init_irq (void ); -void iop13xx_restart (char ,const char *); +void iop13xx_restart (enum reboot_mode ,const char *);/* CPUID CP6 R0 Page 0 */ static inline int iop13xx_cpu_id (void )
arch/arm/mach-iop13xx/setup.c +1 -1
@@ -597,7 +597,7 @@ __setup("iop13xx_init_adma", iop13xx_init_adma_setup);__setup ("iop13xx_init_uart" , iop13xx_init_uart_setup);__setup ("iop13xx_init_i2c" , iop13xx_init_i2c_setup); -void iop13xx_restart (char mode,const char *cmd) +void iop13xx_restart (enum reboot_mode mode,const char *cmd) {/* * Reset the internal bus (warning both cores are reset)
arch/arm/mach-iop32x/n2100.c +1 -1
@@ -286,7 +286,7 @@ static void n2100_power_off(void) ; } -static void n2100_restart (char mode,const char *cmd) +static void n2100_restart (enum reboot_mode mode,const char *cmd) {gpio_line_set (N2100_HARDWARE_RESET ,GPIO_LOW );gpio_line_config (N2100_HARDWARE_RESET ,GPIO_OUT );
arch/arm/mach-ixp4xx/common.c +2 -2
@@ -531,9 +531,9 @@ static void __init ixp4xx_clockevent_init(void) 0xf, 0xfffffffe); } -void ixp4xx_restart (char mode,const char *cmd) +void ixp4xx_restart (enum reboot_mode mode,const char *cmd) { -if (1 && mode =='s' ) { +if (1 && mode ==REBOOT_WARM ) {/* Jump into ROM at address 0 */ soft_restart (0 ); }else {
arch/arm/mach-ixp4xx/dsmg600-setup.c +1 -0
@@ -27,6 +27,7 @@#include <linux/i2c.h> #include <linux/i2c-gpio.h> +#include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/flash.h>
arch/arm/mach-ixp4xx/include/mach/platform.h +3 -1
@@ -13,6 +13,8 @@#ifndef __ASSEMBLY__ +#include <linux/reboot.h> +#include <asm/types.h> #ifndef __ARMEB__
@@ -123,7 +125,7 @@ extern void ixp4xx_init_early(void);extern void ixp4xx_init_irq (void );extern void ixp4xx_sys_init (void );extern void ixp4xx_timer_init (void ); -extern void ixp4xx_restart (char ,const char *); +extern void ixp4xx_restart (enum reboot_mode ,const char *);extern void ixp4xx_pci_preinit (void );struct pci_sys_data ;extern int ixp4xx_setup (int nr,struct pci_sys_data *sys);
arch/arm/mach-ixp4xx/include/mach/timex.h +1 -1
@@ -3,7 +3,7 @@* */ -#include <mach/hardware.h> +// #include <mach/hardware.h> /* * We use IXP425 General purpose timer for our timer needs, it runs at
arch/arm/mach-kirkwood/board-lsxl.c +1 -1
@@ -35,7 +35,7 @@ static struct mv643xx_eth_platform_data lsxl_ge01_data = {*/ static void lsxl_power_off (void ) { -kirkwood_restart ('h' ,NULL ); +kirkwood_restart (REBOOT_COLD ,NULL ); }void __init lsxl_init (void )
arch/arm/mach-kirkwood/common.c +2 -1
@@ -20,6 +20,7 @@#include <linux/mv643xx_i2c.h> #include <linux/timex.h> #include <linux/kexec.h> +#include <linux/reboot.h> #include <net/dsa.h> #include <asm/page.h> #include <asm/mach/map.h>
@@ -695,7 +696,7 @@ void __init kirkwood_init(void)#endif } -void kirkwood_restart (char mode,const char *cmd) +void kirkwood_restart (enum reboot_mode mode,const char *cmd) {/* * Enable soft reset to assert RSTOUTn.
arch/arm/mach-kirkwood/common.h +3 -1
@@ -11,6 +11,8 @@#ifndef __ARCH_KIRKWOOD_COMMON_H#define __ARCH_KIRKWOOD_COMMON_H +#include <linux/reboot.h> +struct dsa_platform_data ;struct mv643xx_eth_platform_data ;struct mv_sata_platform_data ;
@@ -51,7 +53,7 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev_ready)(struct mtd_info *));void kirkwood_audio_init (void );void kirkwood_cpuidle_init (void ); -void kirkwood_restart (char ,const char *); +void kirkwood_restart (enum reboot_mode ,const char *);void kirkwood_clk_init (void );/* board init functions for boards not fully converted to fdt */
arch/arm/mach-ks8695/generic.h +1 -1
@@ -12,5 +12,5 @@extern __init void ks8695_map_io (void );extern __init void ks8695_init_irq (void ); -extern void ks8695_restart (char ,const char *); +extern void ks8695_restart (enum reboot_mode ,const char *);extern void ks8695_timer_init (void );
arch/arm/mach-ks8695/time.c +2 -2
@@ -154,11 +154,11 @@ void __init ks8695_timer_init(void)setup_irq (KS8695_IRQ_TIMER1 , &ks8695_timer_irq); } -void ks8695_restart (char mode,const char *cmd) +void ks8695_restart (enum reboot_mode reboot_mode,const char *cmd) {unsigned int reg; -if (mode =='s' ) +if (reboot_mode ==REBOOT_WARM )soft_restart (0 );/* disable timer0 */
arch/arm/mach-lpc32xx/common.c +3 -3
@@ -207,11 +207,11 @@ void __init lpc32xx_map_io(void)iotable_init (lpc32xx_io_desc,ARRAY_SIZE (lpc32xx_io_desc)); } -void lpc23xx_restart (char mode,const char *cmd) +void lpc23xx_restart (enum reboot_mode mode,const char *cmd) {switch (mode) { -case 's' : -case 'h' : +case REBOOT_WARM : +case REBOOT_COLD :lpc32xx_watchdog_reset ();break ;
arch/arm/mach-lpc32xx/common.h +2 -1
@@ -21,6 +21,7 @@#include <mach/board.h> #include <linux/platform_device.h> +#include <linux/reboot.h> /* * Other arch specific structures and functions
@@ -29,7 +30,7 @@ extern void lpc32xx_timer_init(void);extern void __init lpc32xx_init_irq (void );extern void __init lpc32xx_map_io (void );extern void __init lpc32xx_serial_init (void ); -extern void lpc23xx_restart (char ,const char *); +extern void lpc23xx_restart (enum reboot_mode ,const char *);/*
arch/arm/mach-mmp/common.c +1 -1
@@ -47,7 +47,7 @@ void __init mmp_map_io(void) mmp_chip_id =__raw_readl (MMP_CHIPID ); } -void mmp_restart (char mode,const char *cmd) +void mmp_restart (enum reboot_mode mode,const char *cmd) {soft_restart (0 ); }
arch/arm/mach-mmp/common.h +2 -1
@@ -1,10 +1,11 @@ +#include <linux/reboot.h> #define ARRAY_AND_SIZE (x) (x), ARRAY_SIZE(x)extern void timer_init (int irq);extern void __init icu_init_irq (void );extern void __init mmp_map_io (void ); -extern void mmp_restart (char ,const char *); +extern void mmp_restart (enum reboot_mode ,const char *);extern void __init pxa168_clk_init (void );extern void __init pxa910_clk_init (void );extern void __init mmp2_clk_init (void );
arch/arm/mach-mmp/include/mach/pxa168.h +3 -1
@@ -1,9 +1,11 @@#ifndef __ASM_MACH_PXA168_H#define __ASM_MACH_PXA168_H +#include <linux/reboot.h> +extern void pxa168_timer_init (void );extern void __init pxa168_init_irq (void ); -extern void pxa168_restart (char ,const char *); +extern void pxa168_restart (enum reboot_mode ,const char *);extern void pxa168_clear_keypad_wakeup (void );#include <linux/i2c.h>
arch/arm/mach-mmp/pxa168.c +1 -1
@@ -172,7 +172,7 @@ int __init pxa168_add_usb_host(struct mv_usb_platform_data *pdata)return platform_device_register (&pxa168_device_usb_host); } -void pxa168_restart (char mode,const char *cmd) +void pxa168_restart (enum reboot_mode mode,const char *cmd) {soft_restart (0xffff0000 ); }
arch/arm/mach-mv78xx0/common.c +1 -1
@@ -407,7 +407,7 @@ void __init mv78xx0_init(void)clk_init (); } -void mv78xx0_restart (char mode,const char *cmd) +void mv78xx0_restart (enum reboot_mode mode,const char *cmd) {/* * Enable soft reset to assert RSTOUTn.
arch/arm/mach-mv78xx0/common.h +3 -1
@@ -11,6 +11,8 @@#ifndef __ARCH_MV78XX0_COMMON_H#define __ARCH_MV78XX0_COMMON_H +#include <linux/reboot.h> +struct mv643xx_eth_platform_data ;struct mv_sata_platform_data ;
@@ -45,7 +47,7 @@ void mv78xx0_uart1_init(void);void mv78xx0_uart2_init (void );void mv78xx0_uart3_init (void );void mv78xx0_i2c_init (void ); -void mv78xx0_restart (char ,const char *); +void mv78xx0_restart (enum reboot_mode ,const char *);extern void mv78xx0_timer_init (void );
arch/arm/mach-mvebu/common.h +3 -1
@@ -15,7 +15,9 @@#ifndef __ARCH_MVEBU_COMMON_H#define __ARCH_MVEBU_COMMON_H -void mvebu_restart (char mode,const char *cmd); +#include <linux/reboot.h> + +void mvebu_restart (enum reboot_mode mode,const char *cmd);void armada_370_xp_init_irq (void );void armada_370_xp_handle_irq (struct pt_regs *regs);
arch/arm/mach-mvebu/system-controller.c +2 -1
@@ -26,6 +26,7 @@#include <linux/init.h> #include <linux/of_address.h> #include <linux/io.h> +#include <linux/reboot.h> static void __iomem *system_controller_base;
@@ -63,7 +64,7 @@ static struct of_device_id of_system_controller_table[] = { { /* end of list */ }, }; -void mvebu_restart (char mode,const char *cmd) +void mvebu_restart (enum reboot_mode mode,const char *cmd) {if (!system_controller_base) {pr_err ("Cannot restart, system-controller not available: check the device tree\n" );
arch/arm/mach-mxs/include/mach/common.h +3 -1
@@ -11,10 +11,12 @@#ifndef __MACH_MXS_COMMON_H__#define __MACH_MXS_COMMON_H__ +#include <linux/reboot.h> +extern const u32 *mxs_get_ocotp (void );extern int mxs_reset_block (void __iomem *);extern void mxs_timer_init (void ); -extern void mxs_restart (char ,const char *); +extern void mxs_restart (enum reboot_mode ,const char *);extern int mxs_saif_clkmux_select (unsigned int clkmux);extern int mx23_clocks_init (void );
arch/arm/mach-mxs/system.c +1 -1
@@ -42,7 +42,7 @@ static void __iomem *mxs_clkctrl_reset_addr;/* * Reset the system. It is called by machine_restart(). */ -void mxs_restart (char mode,const char *cmd) +void mxs_restart (enum reboot_mode mode,const char *cmd) {/* reset the chip */ __mxs_setl (MXS_CLKCTRL_RESET_CHIP , mxs_clkctrl_reset_addr);
arch/arm/mach-netx/generic.c +2 -1
@@ -24,6 +24,7 @@#include <linux/platform_device.h> #include <linux/io.h> #include <linux/irqchip/arm-vic.h> +#include <linux/reboot.h> #include <mach/hardware.h> #include <asm/mach/map.h> #include <mach/netx-regs.h>
@@ -187,7 +188,7 @@ static int __init netx_init(void)subsys_initcall (netx_init); -void netx_restart (char mode,const char *cmd) +void netx_restart (enum reboot_mode mode,const char *cmd) {writel (NETX_SYSTEM_RES_CR_FIRMW_RES_EN |NETX_SYSTEM_RES_CR_FIRMW_RES ,NETX_SYSTEM_RES_CR );
arch/arm/mach-netx/generic.h +3 -1
@@ -17,8 +17,10 @@* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <linux/reboot.h> +extern void __init netx_map_io (void );extern void __init netx_init_irq (void ); -extern void netx_restart (char ,const char *); +extern void netx_restart (enum reboot_mode ,const char *);extern void netx_timer_init (void );
arch/arm/mach-nomadik/cpu-8815.c +1 -1
@@ -149,7 +149,7 @@ static void __init cpu8815_map_io(void)iotable_init (cpu8815_io_desc,ARRAY_SIZE (cpu8815_io_desc)); } -static void cpu8815_restart (char mode,const char *cmd) +static void cpu8815_restart (enum reboot_mode mode,const char *cmd) {void __iomem *srcbase =ioremap (NOMADIK_SRC_BASE ,SZ_4K );
arch/arm/mach-omap1/board-voiceblue.c +2 -1
@@ -26,6 +26,7 @@#include <linux/serial_reg.h> #include <linux/smc91x.h> #include <linux/export.h> +#include <linux/reboot.h> #include <asm/mach-types.h> #include <asm/mach/arch.h>
@@ -215,7 +216,7 @@ void voiceblue_wdt_ping(void)gpio_set_value (0 , wdt_gpio_state); } -static void voiceblue_restart (char mode,const char *cmd) +static void voiceblue_restart (enum reboot_mode mode,const char *cmd) {/* * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
arch/arm/mach-omap1/common.h +2 -1
@@ -28,6 +28,7 @@#include <linux/mtd/mtd.h> #include <linux/i2c-omap.h> +#include <linux/reboot.h> #include <plat/i2c.h>
@@ -70,7 +71,7 @@ static inline int omap_serial_wakeup_init(void)void omap1_init_early (void );void omap1_init_irq (void );void omap1_init_late (void ); -void omap1_restart (char ,const char *); +void omap1_restart (enum reboot_mode ,const char *);extern void __init omap_check_revision (void );
arch/arm/mach-omap1/reset.c +2 -1
@@ -3,6 +3,7 @@*/ #include <linux/kernel.h> #include <linux/io.h> +#include <linux/reboot.h> #include <mach/hardware.h>
@@ -22,7 +23,7 @@#define OMAP_EXTWARM_RST_SRC_ID_SHIFT 5 -void omap1_restart (char mode,const char *cmd) +void omap1_restart (enum reboot_mode mode,const char *cmd) {/* * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
arch/arm/mach-omap2/am33xx-restart.c +2 -1
@@ -6,6 +6,7 @@* published by the Free Software Foundation. */ #include <linux/kernel.h> +#include <linux/reboot.h> #include "common.h" #include "prm-regbits-33xx.h"
@@ -19,7 +20,7 @@* Resets the SoC. For @cmd, see the 'reboot' syscall in * kernel/sys.c. No return value. */ -void am33xx_restart (char mode,const char *cmd) +void am33xx_restart (enum reboot_mode mode,const char *cmd) {/* TODO: Handle mode and cmd if necessary */
arch/arm/mach-omap2/common.h +9 -8
@@ -31,6 +31,7 @@#include <linux/i2c.h> #include <linux/i2c/twl.h> #include <linux/i2c-omap.h> +#include <linux/reboot.h> #include <asm/proc-fns.h>
@@ -111,33 +112,33 @@ void ti81xx_init_late(void);int omap2_common_pm_late_init (void );#if defined(CONFIG_SOC_OMAP2420 ) || defined(CONFIG_SOC_OMAP2430 ) -void omap2xxx_restart (char mode,const char *cmd); +void omap2xxx_restart (enum reboot_mode mode,const char *cmd);#else -static inline void omap2xxx_restart (char mode,const char *cmd) +static inline void omap2xxx_restart (enum reboot_mode mode,const char *cmd) { }#endif #ifdef CONFIG_SOC_AM33XX -void am33xx_restart (char mode,const char *cmd); +void am33xx_restart (enum reboot_mode mode,const char *cmd);#else -static inline void am33xx_restart (char mode,const char *cmd) +static inline void am33xx_restart (enum reboot_mode mode,const char *cmd) { }#endif #ifdef CONFIG_ARCH_OMAP3 -void omap3xxx_restart (char mode,const char *cmd); +void omap3xxx_restart (enum reboot_mode mode,const char *cmd);#else -static inline void omap3xxx_restart (char mode,const char *cmd) +static inline void omap3xxx_restart (enum reboot_mode mode,const char *cmd) { }#endif #if defined(CONFIG_ARCH_OMAP4 ) || defined(CONFIG_SOC_OMAP5 ) -void omap44xx_restart (char mode,const char *cmd); +void omap44xx_restart (enum reboot_mode mode,const char *cmd);#else -static inline void omap44xx_restart (char mode,const char *cmd) +static inline void omap44xx_restart (enum reboot_mode mode,const char *cmd) { }#endif
arch/arm/mach-omap2/omap2-restart.c +1 -1
@@ -31,7 +31,7 @@ static struct clk *reset_virt_prcm_set_ck, *reset_sys_ck;* Set the DPLL to bypass so that reboot completes successfully. No * return value. */ -void omap2xxx_restart (char mode,const char *cmd) +void omap2xxx_restart (enum reboot_mode mode,const char *cmd) {u32 rate;
arch/arm/mach-omap2/omap3-restart.c +2 -1
@@ -12,6 +12,7 @@*/ #include <linux/kernel.h> #include <linux/init.h> +#include <linux/reboot.h> #include "iomap.h" #include "common.h"
@@ -28,7 +29,7 @@* Resets the SoC. For @cmd, see the 'reboot' syscall in * kernel/sys.c. No return value. */ -void omap3xxx_restart (char mode,const char *cmd) +void omap3xxx_restart (enum reboot_mode mode,const char *cmd) {omap3_ctrl_write_boot_mode ((cmd ? (u8)*cmd :0 ));omap3xxx_prm_dpll3_reset ();/* never returns */
arch/arm/mach-omap2/omap4-common.c +2 -1
@@ -22,6 +22,7 @@#include <linux/of_platform.h> #include <linux/export.h> #include <linux/irqchip/arm-gic.h> +#include <linux/reboot.h> #include <asm/hardware/cache-l2x0.h> #include <asm/mach/map.h>
@@ -326,7 +327,7 @@ int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)* Resets the SoC. For @cmd, see the 'reboot' syscall in * kernel/sys.c. No return value. */ -void omap44xx_restart (char mode,const char *cmd) +void omap44xx_restart (enum reboot_mode mode,const char *cmd) {/* XXX Should save 'cmd' into scratchpad for use after reboot */ omap4_prminst_global_warm_sw_reset ();/* never returns */
arch/arm/mach-orion5x/common.c +1 -1
@@ -310,7 +310,7 @@ void __init orion5x_init(void)orion5x_wdt_init (); } -void orion5x_restart (char mode,const char *cmd) +void orion5x_restart (enum reboot_mode mode,const char *cmd) {/* * Enable and issue soft reset
arch/arm/mach-orion5x/common.h +3 -1
@@ -1,6 +1,8 @@#ifndef __ARCH_ORION5X_COMMON_H#define __ARCH_ORION5X_COMMON_H +#include <linux/reboot.h> +struct dsa_platform_data ;struct mv643xx_eth_platform_data ;struct mv_sata_platform_data ;
@@ -40,7 +42,7 @@ void orion5x_spi_init(void);void orion5x_uart0_init (void );void orion5x_uart1_init (void );void orion5x_xor_init (void ); -void orion5x_restart (char ,const char *); +void orion5x_restart (enum reboot_mode ,const char *);/* * PCIe/PCI functions.
arch/arm/mach-orion5x/ls-chl-setup.c +1 -1
@@ -139,7 +139,7 @@ static struct mv_sata_platform_data lschl_sata_data = {static void lschl_power_off (void ) { -orion5x_restart ('h' ,NULL ); +orion5x_restart (REBOOT_COLD ,NULL ); }/*****************************************************************************
arch/arm/mach-orion5x/ls_hgl-setup.c +1 -1
@@ -185,7 +185,7 @@ static struct mv_sata_platform_data ls_hgl_sata_data = {static void ls_hgl_power_off (void ) { -orion5x_restart ('h' ,NULL ); +orion5x_restart (REBOOT_COLD ,NULL ); }
arch/arm/mach-orion5x/lsmini-setup.c +1 -1
@@ -185,7 +185,7 @@ static struct mv_sata_platform_data lsmini_sata_data = {static void lsmini_power_off (void ) { -orion5x_restart ('h' ,NULL ); +orion5x_restart (REBOOT_COLD ,NULL ); }
arch/arm/mach-picoxcell/common.c +2 -1
@@ -15,6 +15,7 @@#include <linux/of_address.h> #include <linux/of_irq.h> #include <linux/of_platform.h> +#include <linux/reboot.h> #include <linux/dw_apb_timer.h> #include <asm/mach/arch.h>
@@ -70,7 +71,7 @@ static const char *picoxcell_dt_match[] = { NULL }; -static void picoxcell_wdt_restart (char mode,const char *cmd) +static void picoxcell_wdt_restart (enum reboot_mode mode,const char *cmd) {/* * Configure the watchdog to reset with the shortest possible timeout
arch/arm/mach-prima2/common.h +3 -1
@@ -10,6 +10,8 @@#define __MACH_PRIMA2_COMMON_H__#include <linux/init.h> +#include <linux/reboot.h> +#include <asm/mach/time.h> #include <asm/exception.h>
@@ -22,7 +24,7 @@ extern void sirfsoc_cpu_die(unsigned int cpu);extern void __init sirfsoc_of_irq_init (void );extern void __init sirfsoc_of_clk_init (void ); -extern void sirfsoc_restart (char ,const char *); +extern void sirfsoc_restart (enum reboot_mode ,const char *); extern asmlinkage void __exception_irq_entry sirfsoc_handle_irq(struct pt_regs *regs);#ifndef CONFIG_DEBUG_LL
arch/arm/mach-prima2/rstc.c +2 -1
@@ -13,6 +13,7 @@#include <linux/device.h> #include <linux/of.h> #include <linux/of_address.h> +#include <linux/reboot.h> void __iomem *sirfsoc_rstc_base;static DEFINE_MUTEX (rstc_lock);
@@ -82,7 +83,7 @@ int sirfsoc_reset_device(struct device *dev)#define SIRFSOC_SYS_RST_BIT BIT(31) -void sirfsoc_restart (char mode,const char *cmd) +void sirfsoc_restart (enum reboot_mode mode,const char *cmd) {writel (SIRFSOC_SYS_RST_BIT , sirfsoc_rstc_base); }
arch/arm/mach-pxa/corgi.c +3 -3
@@ -663,16 +663,16 @@ static void corgi_poweroff(void)/* Green LED off tells the bootloader to halt */ gpio_set_value (CORGI_GPIO_LED_GREEN ,0 ); -pxa_restart ('h' ,NULL ); +pxa_restart (REBOOT_COLD ,NULL ); } -static void corgi_restart (char mode,const char *cmd) +static void corgi_restart (enum reboot_mode mode,const char *cmd) {if (!machine_is_corgi ())/* Green LED on tells the bootloader to reboot */ gpio_set_value (CORGI_GPIO_LED_GREEN ,1 ); -pxa_restart ('h' , cmd); +pxa_restart (REBOOT_COLD , cmd); }static void __init corgi_init (void )
arch/arm/mach-pxa/generic.h +3 -1
@@ -9,6 +9,8 @@* published by the Free Software Foundation. */ +#include <linux/reboot.h> +struct irq_data ;extern void pxa_timer_init (void );
@@ -56,4 +58,4 @@ void __init pxa_set_btuart_info(void *info);void __init pxa_set_stuart_info (void *info);void __init pxa_set_hwuart_info (void *info); -void pxa_restart (char ,const char *); +void pxa_restart (enum reboot_mode ,const char *);
arch/arm/mach-pxa/mioa701.c +4 -3
@@ -37,6 +37,7 @@#include <linux/wm97xx.h> #include <linux/mtd/physmap.h> #include <linux/usb/gpio_vbus.h> +#include <linux/reboot.h> #include <linux/regulator/max1586.h> #include <linux/slab.h> #include <linux/i2c/pxa-i2c.h>
@@ -691,13 +692,13 @@ static void mioa701_machine_exit(void);static void mioa701_poweroff (void ) {mioa701_machine_exit (); -pxa_restart ('s' ,NULL ); +pxa_restart (REBOOT_WARM ,NULL ); } -static void mioa701_restart (char c,const char *cmd) +static void mioa701_restart (enum reboot_mode c,const char *cmd) {mioa701_machine_exit (); -pxa_restart ('s' , cmd); +pxa_restart (REBOOT_WARM , cmd); }static struct gpio global_gpios[] = {
arch/arm/mach-pxa/poodle.c +1 -1
@@ -422,7 +422,7 @@ static struct i2c_board_info __initdata poodle_i2c_devices[] = {static void poodle_poweroff (void ) { -pxa_restart ('h' ,NULL ); +pxa_restart (REBOOT_COLD ,NULL ); }static void __init poodle_init (void )
arch/arm/mach-pxa/reset.c +4 -4
@@ -83,7 +83,7 @@ static void do_hw_reset(void)writel_relaxed (readl_relaxed (OSCR ) +368640 ,OSMR3 ); } -void pxa_restart (char mode,const char *cmd) +void pxa_restart (enum reboot_mode mode,const char *cmd) {local_irq_disable ();local_fiq_disable ();
@@ -91,14 +91,14 @@ void pxa_restart(char mode, const char *cmd)clear_reset_status (RESET_STATUS_ALL );switch (mode) { -case 's' : +case REBOOT_WARM :/* Jump into ROM at address 0 */ soft_restart (0 );break ; -case 'g' : +case REBOOT_GPIO :do_gpio_reset ();break ; -case 'h' : +case REBOOT_COLD :default :do_hw_reset ();break ;
arch/arm/mach-pxa/spitz.c +3 -2
@@ -31,6 +31,7 @@#include <linux/regulator/machine.h> #include <linux/io.h> #include <linux/module.h> +#include <linux/reboot.h> #include <asm/setup.h> #include <asm/mach-types.h>
@@ -924,10 +925,10 @@ static inline void spitz_i2c_init(void) {}******************************************************************************/ static void spitz_poweroff (void ) { -pxa_restart ('g' ,NULL ); +pxa_restart (REBOOT_GPIO ,NULL ); } -static void spitz_restart (char mode,const char *cmd) +static void spitz_restart (enum reboot_mode mode,const char *cmd) {uint32_t msc0 =__raw_readl (MSC0 );/* Bootloader magic for a reboot */
arch/arm/mach-pxa/tosa.c +3 -2
@@ -36,6 +36,7 @@#include <linux/input/matrix_keypad.h> #include <linux/i2c/pxa-i2c.h> #include <linux/usb/gpio_vbus.h> +#include <linux/reboot.h> #include <asm/setup.h> #include <asm/mach-types.h>
@@ -911,10 +912,10 @@ static struct platform_device *devices[] __initdata = {static void tosa_poweroff (void ) { -pxa_restart ('g' ,NULL ); +pxa_restart (REBOOT_GPIO ,NULL ); } -static void tosa_restart (char mode,const char *cmd) +static void tosa_restart (enum reboot_mode mode,const char *cmd) {uint32_t msc0 =__raw_readl (MSC0 );
arch/arm/mach-realview/realview_eb.c +2 -1
@@ -29,6 +29,7 @@#include <linux/io.h> #include <linux/irqchip/arm-gic.h> #include <linux/platform_data/clk-realview.h> +#include <linux/reboot.h> #include <mach/hardware.h> #include <asm/irq.h>
@@ -418,7 +419,7 @@ static void __init realview_eb_timer_init(void)realview_eb_twd_init (); } -static void realview_eb_restart (char mode,const char *cmd) +static void realview_eb_restart (enum reboot_mode mode,const char *cmd) {void __iomem *reset_ctrl =__io_address (REALVIEW_SYS_RESETCTL );void __iomem *lock_ctrl =__io_address (REALVIEW_SYS_LOCK );
arch/arm/mach-realview/realview_pb1176.c +2 -1
@@ -31,6 +31,7 @@#include <linux/io.h> #include <linux/irqchip/arm-gic.h> #include <linux/platform_data/clk-realview.h> +#include <linux/reboot.h> #include <mach/hardware.h> #include <asm/irq.h>
@@ -329,7 +330,7 @@ static void __init realview_pb1176_timer_init(void)realview_timer_init (IRQ_DC1176_TIMER0 ); } -static void realview_pb1176_restart (char mode,const char *cmd) +static void realview_pb1176_restart (enum reboot_mode mode,const char *cmd) {void __iomem *reset_ctrl =__io_address (REALVIEW_SYS_RESETCTL );void __iomem *lock_ctrl =__io_address (REALVIEW_SYS_LOCK );
arch/arm/mach-realview/realview_pb11mp.c +2 -1
@@ -29,6 +29,7 @@#include <linux/io.h> #include <linux/irqchip/arm-gic.h> #include <linux/platform_data/clk-realview.h> +#include <linux/reboot.h> #include <mach/hardware.h> #include <asm/irq.h>
@@ -316,7 +317,7 @@ static void __init realview_pb11mp_timer_init(void)realview_pb11mp_twd_init (); } -static void realview_pb11mp_restart (char mode,const char *cmd) +static void realview_pb11mp_restart (enum reboot_mode mode,const char *cmd) {void __iomem *reset_ctrl =__io_address (REALVIEW_SYS_RESETCTL );void __iomem *lock_ctrl =__io_address (REALVIEW_SYS_LOCK );
arch/arm/mach-realview/realview_pba8.c +2 -1
@@ -29,6 +29,7 @@#include <linux/io.h> #include <linux/irqchip/arm-gic.h> #include <linux/platform_data/clk-realview.h> +#include <linux/reboot.h> #include <asm/irq.h> #include <asm/mach-types.h>
@@ -264,7 +265,7 @@ static void __init realview_pba8_timer_init(void)realview_timer_init (IRQ_PBA8_TIMER0_1 ); } -static void realview_pba8_restart (char mode,const char *cmd) +static void realview_pba8_restart (enum reboot_mode mode,const char *cmd) {void __iomem *reset_ctrl =__io_address (REALVIEW_SYS_RESETCTL );void __iomem *lock_ctrl =__io_address (REALVIEW_SYS_LOCK );
arch/arm/mach-realview/realview_pbx.c +2 -1
@@ -28,6 +28,7 @@#include <linux/io.h> #include <linux/irqchip/arm-gic.h> #include <linux/platform_data/clk-realview.h> +#include <linux/reboot.h> #include <asm/irq.h> #include <asm/mach-types.h>
@@ -344,7 +345,7 @@ static void realview_pbx_fixup(struct tag *tags, char **from,#endif } -static void realview_pbx_restart (char mode,const char *cmd) +static void realview_pbx_restart (enum reboot_mode mode,const char *cmd) {void __iomem *reset_ctrl =__io_address (REALVIEW_SYS_RESETCTL );void __iomem *lock_ctrl =__io_address (REALVIEW_SYS_LOCK );
arch/arm/mach-rpc/riscpc.c +2 -1
@@ -20,6 +20,7 @@#include <linux/ata_platform.h> #include <linux/io.h> #include <linux/i2c.h> +#include <linux/reboot.h> #include <asm/elf.h> #include <asm/mach-types.h>
@@ -201,7 +202,7 @@ static int __init rpc_init(void)arch_initcall (rpc_init); -static void rpc_restart (char mode,const char *cmd) +static void rpc_restart (enum reboot_mode mode,const char *cmd) {iomd_writeb (0 ,IOMD_ROMCR0 );
arch/arm/mach-s3c24xx/common.h +4 -2
@@ -12,8 +12,10 @@#ifndef __ARCH_ARM_MACH_S3C24XX_COMMON_H#define __ARCH_ARM_MACH_S3C24XX_COMMON_H __FILE__ -void s3c2410_restart (char mode,const char *cmd); -void s3c244x_restart (char mode,const char *cmd); +#include <linux/reboot.h> + +void s3c2410_restart (enum reboot_mode mode,const char *cmd); +void s3c244x_restart (enum reboot_mode mode,const char *cmd);extern struct syscore_ops s3c24xx_irq_syscore_ops;
arch/arm/mach-s3c24xx/s3c2410.c +3 -2
@@ -22,6 +22,7 @@#include <linux/syscore_ops.h> #include <linux/serial_core.h> #include <linux/platform_device.h> +#include <linux/reboot.h> #include <linux/io.h> #include <asm/mach/arch.h>
@@ -196,9 +197,9 @@ int __init s3c2410a_init(void)return s3c2410_init (); } -void s3c2410_restart (char mode,const char *cmd) +void s3c2410_restart (enum reboot_mode mode,const char *cmd) { -if (mode =='s' ) { +if (mode ==REBOOT_WARM ) {soft_restart (0 ); }
arch/arm/mach-s3c24xx/s3c2412.c +3 -2
@@ -22,6 +22,7 @@#include <linux/serial_core.h> #include <linux/platform_device.h> #include <linux/io.h> +#include <linux/reboot.h> #include <asm/mach/arch.h> #include <asm/mach/map.h>
@@ -130,9 +131,9 @@ static void s3c2412_idle(void)cpu_do_idle (); } -void s3c2412_restart (char mode,const char *cmd) +void s3c2412_restart (enum reboot_mode mode,const char *cmd) { -if (mode =='s' ) +if (mode ==REBOOT_WARM )soft_restart (0 );/* errata "Watch-dog/Software Reset Problem" specifies that
arch/arm/mach-s3c24xx/s3c2416.c +3 -2
@@ -35,6 +35,7 @@#include <linux/syscore_ops.h> #include <linux/clk.h> #include <linux/io.h> +#include <linux/reboot.h> #include <asm/mach/arch.h> #include <asm/mach/map.h>
@@ -80,9 +81,9 @@ static struct device s3c2416_dev = { .bus = &s3c2416_subsys, }; -void s3c2416_restart (char mode,const char *cmd) +void s3c2416_restart (enum reboot_mode mode,const char *cmd) { -if (mode =='s' ) +if (mode ==REBOOT_WARM )soft_restart (0 );__raw_writel (S3C2443_SWRST_RESET ,S3C2443_SWRST );
arch/arm/mach-s3c24xx/s3c2443.c +3 -2
@@ -22,6 +22,7 @@#include <linux/device.h> #include <linux/clk.h> #include <linux/io.h> +#include <linux/reboot.h> #include <asm/mach/arch.h> #include <asm/mach/map.h>
@@ -60,9 +61,9 @@ static struct device s3c2443_dev = { .bus = &s3c2443_subsys, }; -void s3c2443_restart (char mode,const char *cmd) +void s3c2443_restart (enum reboot_mode mode,const char *cmd) { -if (mode =='s' ) +if (mode ==REBOOT_WARM )soft_restart (0 );__raw_writel (S3C2443_SWRST_RESET ,S3C2443_SWRST );
arch/arm/mach-s3c24xx/s3c244x.c +3 -2
@@ -18,6 +18,7 @@#include <linux/init.h> #include <linux/serial_core.h> #include <linux/platform_device.h> +#include <linux/reboot.h> #include <linux/device.h> #include <linux/syscore_ops.h> #include <linux/clk.h>
@@ -199,9 +200,9 @@ struct syscore_ops s3c244x_pm_syscore_ops = { .resume = s3c244x_resume, }; -void s3c244x_restart (char mode,const char *cmd) +void s3c244x_restart (enum reboot_mode mode,const char *cmd) { -if (mode =='s' ) +if (mode ==REBOOT_WARM )soft_restart (0 );arch_wdt_reset ();
arch/arm/mach-s3c64xx/common.c +3 -2
@@ -26,6 +26,7 @@#include <linux/irq.h> #include <linux/gpio.h> #include <linux/irqchip/arm-vic.h> +#include <linux/reboot.h> #include <asm/mach/arch.h> #include <asm/mach/map.h>
@@ -375,9 +376,9 @@ static int __init s3c64xx_init_irq_eint(void) }arch_initcall (s3c64xx_init_irq_eint); -void s3c64xx_restart (char mode,const char *cmd) +void s3c64xx_restart (enum reboot_mode mode,const char *cmd) { -if (mode !='s' ) +if (mode !=REBOOT_WARM )arch_wdt_reset ();/* if all else fails, or mode was for soft, jump to 0 */
arch/arm/mach-s3c64xx/common.h +3 -1
@@ -17,13 +17,15 @@#ifndef __ARCH_ARM_MACH_S3C64XX_COMMON_H#define __ARCH_ARM_MACH_S3C64XX_COMMON_H +#include <linux/reboot.h> +void s3c64xx_init_irq (u32 vic0,u32 vic1);void s3c64xx_init_io (struct map_desc *mach_desc,int size);void s3c64xx_register_clocks (unsigned long xtal,unsigned armclk_limit);void s3c64xx_setup_clocks (void ); -void s3c64xx_restart (char mode,const char *cmd); +void s3c64xx_restart (enum reboot_mode mode,const char *cmd);void s3c64xx_init_late (void );#ifdef CONFIG_CPU_S3C6400
arch/arm/mach-s5p64x0/common.c +3 -2
@@ -24,6 +24,7 @@#include <linux/dma-mapping.h> #include <linux/gpio.h> #include <linux/irq.h> +#include <linux/reboot.h> #include <asm/irq.h> #include <asm/proc-fns.h>
@@ -437,9 +438,9 @@ static int __init s5p64x0_init_irq_eint(void) }arch_initcall (s5p64x0_init_irq_eint); -void s5p64x0_restart (char mode,const char *cmd) +void s5p64x0_restart (enum reboot_mode mode,const char *cmd) { -if (mode !='s' ) +if (mode !=REBOOT_WARM )arch_wdt_reset ();soft_restart (0 );
arch/arm/mach-s5p64x0/common.h +3 -1
@@ -12,6 +12,8 @@#ifndef __ARCH_ARM_MACH_S5P64X0_COMMON_H#define __ARCH_ARM_MACH_S5P64X0_COMMON_H +#include <linux/reboot.h> +void s5p6440_init_irq (void );void s5p6450_init_irq (void );void s5p64x0_init_io (struct map_desc *mach_desc,int size);
@@ -22,7 +24,7 @@ void s5p6440_setup_clocks(void);void s5p6450_register_clocks (void );void s5p6450_setup_clocks (void ); -void s5p64x0_restart (char mode,const char *cmd); +void s5p64x0_restart (enum reboot_mode mode,const char *cmd);#ifdef CONFIG_CPU_S5P6440
arch/arm/mach-s5pc100/common.c +3 -2
@@ -24,6 +24,7 @@#include <linux/serial_core.h> #include <linux/platform_device.h> #include <linux/sched.h> +#include <linux/reboot.h> #include <asm/irq.h> #include <asm/proc-fns.h>
@@ -216,9 +217,9 @@ void __init s5pc100_init_uarts(struct s3c2410_uartcfg *cfg, int no)s3c24xx_init_uartdevs ("s3c6400-uart" , s5p_uart_resources, cfg, no); } -void s5pc100_restart (char mode,const char *cmd) +void s5pc100_restart (enum reboot_mode mode,const char *cmd) { -if (mode !='s' ) +if (mode !=REBOOT_WARM )arch_wdt_reset ();soft_restart (0 );
arch/arm/mach-s5pc100/common.h +3 -1
@@ -12,13 +12,15 @@#ifndef __ARCH_ARM_MACH_S5PC100_COMMON_H#define __ARCH_ARM_MACH_S5PC100_COMMON_H +#include <linux/reboot.h> +void s5pc100_init_io (struct map_desc *mach_desc,int size);void s5pc100_init_irq (void );void s5pc100_register_clocks (void );void s5pc100_setup_clocks (void ); -void s5pc100_restart (char mode,const char *cmd); +void s5pc100_restart (enum reboot_mode mode,const char *cmd);#ifdef CONFIG_CPU_S5PC100
arch/arm/mach-s5pv210/common.c +1 -1
@@ -143,7 +143,7 @@ static struct map_desc s5pv210_iodesc[] __initdata = { } }; -void s5pv210_restart (char mode,const char *cmd) +void s5pv210_restart (enum reboot_mode mode,const char *cmd) {__raw_writel (0x1 ,S5P_SWRESET ); }
arch/arm/mach-s5pv210/common.h +3 -1
@@ -12,13 +12,15 @@#ifndef __ARCH_ARM_MACH_S5PV210_COMMON_H#define __ARCH_ARM_MACH_S5PV210_COMMON_H +#include <linux/reboot.h> +void s5pv210_init_io (struct map_desc *mach_desc,int size);void s5pv210_init_irq (void );void s5pv210_register_clocks (void );void s5pv210_setup_clocks (void ); -void s5pv210_restart (char mode,const char *cmd); +void s5pv210_restart (enum reboot_mode mode,const char *cmd);#ifdef CONFIG_CPU_S5PV210
arch/arm/mach-sa1100/generic.c +3 -2
@@ -19,6 +19,7 @@#include <linux/cpufreq.h> #include <linux/ioport.h> #include <linux/platform_device.h> +#include <linux/reboot.h> #include <video/sa1100fb.h>
@@ -131,9 +132,9 @@ static void sa1100_power_off(void)PMCR =PMCR_SF ; } -void sa11x0_restart (char mode,const char *cmd) +void sa11x0_restart (enum reboot_mode mode,const char *cmd) { -if (mode =='s' ) { +if (mode ==REBOOT_WARM ) {/* Jump into ROM at address 0 */ soft_restart (0 ); }else {
arch/arm/mach-sa1100/generic.h +2 -1
@@ -3,12 +3,13 @@* * Author: Nicolas Pitre */ +#include <linux/reboot.h> extern void sa1100_timer_init (void );extern void __init sa1100_map_io (void );extern void __init sa1100_init_irq (void );extern void __init sa1100_init_gpio (void ); -extern void sa11x0_restart (char ,const char *); +extern void sa11x0_restart (enum reboot_mode ,const char *);extern void sa11x0_init_late (void );#define SET_BANK (__nr,__start,__size) \
arch/arm/mach-shark/core.c +2 -1
@@ -11,6 +11,7 @@#include <linux/serial_8250.h> #include <linux/io.h> #include <linux/cpu.h> +#include <linux/reboot.h> #include <asm/setup.h> #include <asm/mach-types.h>
@@ -24,7 +25,7 @@#define ROMCARD_SIZE 0x08000000#define ROMCARD_START 0x10000000 -static void shark_restart (char mode,const char *cmd) +static void shark_restart (enum reboot_mode mode,const char *cmd) {short temp;/* Reset the Machine via pc[3] of the sequoia chipset */
arch/arm/mach-shmobile/board-armadillo800eva.c +2 -1
@@ -38,6 +38,7 @@#include <linux/mmc/sh_mmcif.h> #include <linux/mmc/sh_mobile_sdhi.h> #include <linux/i2c-gpio.h> +#include <linux/reboot.h> #include <mach/common.h> #include <mach/irqs.h> #include <mach/r8a7740.h>
@@ -1196,7 +1197,7 @@ static void __init eva_add_early_devices(void) }#define RESCNT2 IOMEM(0xe6188020) -static void eva_restart (char mode,const char *cmd) +static void eva_restart (enum reboot_mode mode,const char *cmd) {/* Do soft power on reset */ writel ((1 <<31 ),RESCNT2 );
arch/arm/mach-shmobile/board-kzm9g.c +2 -1
@@ -31,6 +31,7 @@#include <linux/mmc/sh_mobile_sdhi.h> #include <linux/mfd/tmio.h> #include <linux/platform_device.h> +#include <linux/reboot.h> #include <linux/regulator/fixed.h> #include <linux/regulator/machine.h> #include <linux/smsc911x.h>
@@ -774,7 +775,7 @@ static void __init kzm_init(void)sh73a0_pm_init (); } -static void kzm9g_restart (char mode,const char *cmd) +static void kzm9g_restart (enum reboot_mode mode,const char *cmd) {#define RESCNT2 IOMEM(0xe6188020)/* Do soft power on reset */
arch/arm/mach-socfpga/socfpga.c +2 -1
@@ -19,6 +19,7 @@#include <linux/of_address.h> #include <linux/of_irq.h> #include <linux/of_platform.h> +#include <linux/reboot.h> #include <asm/hardware/cache-l2x0.h> #include <asm/mach/arch.h>
@@ -85,7 +86,7 @@ static void __init socfpga_init_irq(void)socfpga_sysmgr_init (); } -static void socfpga_cyclone5_restart (char mode,const char *cmd) +static void socfpga_cyclone5_restart (enum reboot_mode mode,const char *cmd) {/* TODO: */ }
arch/arm/mach-spear13xx/include/mach/generic.h +3 -1
@@ -15,6 +15,8 @@#define __MACH_GENERIC_H#include <linux/dmaengine.h> +#include <linux/reboot.h> +#include <asm/mach/time.h> /* Add spear13xx structure declarations here */
@@ -30,7 +32,7 @@ void __init spear_setup_of_timer(void);void __init spear13xx_map_io (void );void __init spear13xx_l2x0_init (void );bool dw_dma_filter (struct dma_chan *chan,void *slave); -void spear_restart (char ,const char *); +void spear_restart (enum reboot_mode ,const char *);void spear13xx_secondary_startup (void );void __cpuinit spear13xx_cpu_die (unsigned int cpu);
arch/arm/mach-spear3xx/include/mach/generic.h +3 -1
@@ -18,6 +18,8 @@#include <linux/init.h> #include <linux/platform_device.h> #include <linux/amba/bus.h> +#include <linux/reboot.h> +#include <asm/mach/time.h> #include <asm/mach/map.h>
@@ -31,6 +33,6 @@ void __init spear_setup_of_timer(void);void __init spear3xx_clk_init (void );void __init spear3xx_map_io (void ); -void spear_restart (char ,const char *); +void spear_restart (enum reboot_mode ,const char *);#endif /* __MACH_GENERIC_H */
arch/arm/mach-spear6xx/include/mach/generic.h +2 -1
@@ -15,9 +15,10 @@#define __MACH_GENERIC_H#include <linux/init.h> +#include <linux/reboot.h> void __init spear_setup_of_timer (void ); -void spear_restart (char ,const char *); +void spear_restart (enum reboot_mode ,const char *);void __init spear6xx_clk_init (void );#endif /* __MACH_GENERIC_H */
arch/arm/mach-sunxi/sunxi.c +2 -1
@@ -18,6 +18,7 @@#include <linux/of_platform.h> #include <linux/io.h> #include <linux/sunxi_timer.h> +#include <linux/reboot.h> #include <linux/irqchip/sunxi.h>
@@ -45,7 +46,7 @@ static void sunxi_setup_restart(void)WARN (!wdt_base,"failed to map watchdog base address" ); } -static void sunxi_restart (char mode,const char *cmd) +static void sunxi_restart (enum reboot_mode mode,const char *cmd) {if (!wdt_base)return ;
arch/arm/mach-tegra/board.h +2 -1
@@ -23,8 +23,9 @@#define __MACH_TEGRA_BOARD_H#include <linux/types.h> +#include <linux/reboot.h> -void tegra_assert_system_reset (char mode,const char *cmd); +void tegra_assert_system_reset (enum reboot_mode mode,const char *cmd);void __init tegra20_init_early (void );void __init tegra30_init_early (void );
arch/arm/mach-tegra/common.c +2 -1
@@ -24,6 +24,7 @@#include <linux/delay.h> #include <linux/irqchip.h> #include <linux/clk/tegra.h> +#include <linux/reboot.h> #include <asm/hardware/cache-l2x0.h>
@@ -66,7 +67,7 @@ void __init tegra_dt_init_irq(void) }#endif -void tegra_assert_system_reset (char mode,const char *cmd) +void tegra_assert_system_reset (enum reboot_mode mode,const char *cmd) {void __iomem *reset =IO_ADDRESS (TEGRA_PMC_BASE +0 );u32 reg;
arch/arm/mach-u300/core.c +3 -3
@@ -671,11 +671,11 @@ static void __init u300_init_machine(void)/* Forward declare this function from the watchdog */ void coh901327_watchdog_reset (void ); -static void u300_restart (char mode,const char *cmd) +static void u300_restart (enum reboot_mode mode,const char *cmd) {switch (mode) { -case 's' : -case 'h' : +case REBOOT_WARM : +case REBOOT_COLD :#ifdef CONFIG_COH901327_WATCHDOG coh901327_watchdog_reset ();#endif
arch/arm/mach-versatile/core.c +2 -1
@@ -38,6 +38,7 @@#include <linux/clkdev.h> #include <linux/mtd/physmap.h> #include <linux/bitops.h> +#include <linux/reboot.h> #include <asm/irq.h> #include <asm/hardware/arm_timer.h>
@@ -733,7 +734,7 @@ static void versatile_leds_event(led_event_t ledevt) }#endif /* CONFIG_LEDS */ -void versatile_restart (char mode,const char *cmd) +void versatile_restart (enum reboot_mode mode,const char *cmd) {void __iomem *sys =__io_address (VERSATILE_SYS_BASE );u32 val;
arch/arm/mach-versatile/core.h +2 -1
@@ -24,13 +24,14 @@#include <linux/amba/bus.h> #include <linux/of_platform.h> +#include <linux/reboot.h> extern void __init versatile_init (void );extern void __init versatile_init_early (void );extern void __init versatile_init_irq (void );extern void __init versatile_map_io (void );extern void versatile_timer_init (void ); -extern void versatile_restart (char ,const char *); +extern void versatile_restart (enum reboot_mode ,const char *);extern unsigned int mmc_status (struct device *dev);#ifdef CONFIG_OF extern struct of_dev_auxdata versatile_auxdata_lookup[];
arch/arm/mach-vt8500/vt8500.c +2 -1
@@ -21,6 +21,7 @@#include <linux/clocksource.h> #include <linux/io.h> #include <linux/pm.h> +#include <linux/reboot.h> #include <asm/mach-types.h> #include <asm/mach/arch.h>
@@ -46,7 +47,7 @@static void __iomem *pmc_base; -void vt8500_restart (char mode,const char *cmd) +void vt8500_restart (enum reboot_mode mode,const char *cmd) {if (pmc_base)writel (1 , pmc_base +VT8500_PMSR_REG );
arch/arm/mach-w90x900/cpu.c +2 -2
@@ -230,9 +230,9 @@ void __init nuc900_init_clocks(void)#define WTE (1 << 7)#define WTRE (1 << 1) -void nuc9xx_restart (char mode,const char *cmd) +void nuc9xx_restart (enum reboot_mode mode,const char *cmd) { -if (mode =='s' ) { +if (mode ==REBOOT_WARM ) {/* Jump into ROM@address 0 */ soft_restart (0 ); }else {
arch/arm/mach-w90x900/nuc9xx.h +4 -1
@@ -14,10 +14,13 @@* published by the Free Software Foundation. * */ + +#include <linux/reboot.h> +struct map_desc ;/* core initialisation functions */ extern void nuc900_init_irq (void );extern void nuc900_timer_init (void ); -extern void nuc9xx_restart (char ,const char *); +extern void nuc9xx_restart (enum reboot_mode ,const char *);
arch/arm/plat-iop/gpio.c +1 -0
@@ -17,6 +17,7 @@#include <linux/gpio.h> #include <linux/export.h> #include <asm/hardware/iop3xx.h> +#include <mach/gpio.h> void gpio_line_config (int line,int direction) {
arch/arm/plat-iop/restart.c +1 -1
@@ -11,7 +11,7 @@#include <asm/system_misc.h> #include <mach/hardware.h> -void iop3xx_restart (char mode,const char *cmd) +void iop3xx_restart (enum reboot_mode mode,const char *cmd) { *IOP3XX_PCSR =0x30 ;
arch/arm/plat-samsung/include/plat/s3c2412.h +3 -1
@@ -12,6 +12,8 @@#ifdef CONFIG_CPU_S3C2412 +#include <linux/reboot.h> +extern int s3c2412_init (void );extern void s3c2412_map_io (void );
@@ -22,7 +24,7 @@ extern void s3c2412_init_clocks(int xtal);extern int s3c2412_baseclk_add (void ); -extern void s3c2412_restart (char mode,const char *cmd); +extern void s3c2412_restart (enum reboot_mode mode,const char *cmd);#else #define s3c2412_init_clocks NULL#define s3c2412_init_uarts NULL
arch/arm/plat-samsung/include/plat/s3c2416.h +3 -1
@@ -11,6 +11,8 @@#ifdef CONFIG_CPU_S3C2416 +#include <linux/reboot.h> +struct s3c2410_uartcfg ;extern int s3c2416_init (void );
@@ -23,7 +25,7 @@ extern void s3c2416_init_clocks(int xtal);extern int s3c2416_baseclk_add (void ); -extern void s3c2416_restart (char mode,const char *cmd); +extern void s3c2416_restart (enum reboot_mode mode,const char *cmd);extern void s3c2416_init_irq (void );extern struct syscore_ops s3c2416_irq_syscore_ops;
arch/arm/plat-samsung/include/plat/s3c2443.h +3 -1
@@ -12,6 +12,8 @@#ifdef CONFIG_CPU_S3C2443 +#include <linux/reboot.h> +struct s3c2410_uartcfg ;extern int s3c2443_init (void );
@@ -24,7 +26,7 @@ extern void s3c2443_init_clocks(int xtal);extern int s3c2443_baseclk_add (void ); -extern void s3c2443_restart (char mode,const char *cmd); +extern void s3c2443_restart (enum reboot_mode mode,const char *cmd);extern void s3c2443_init_irq (void );#else
arch/arm/plat-spear/restart.c +3 -2
@@ -12,14 +12,15 @@*/ #include <linux/io.h> #include <linux/amba/sp810.h> +#include <linux/reboot.h> #include <asm/system_misc.h> #include <mach/spear.h> #include <mach/generic.h> #define SPEAR13XX_SYS_SW_RES (VA_MISC_BASE + 0x204) -void spear_restart (char mode,const char *cmd) +void spear_restart (enum reboot_mode mode,const char *cmd) { -if (mode =='s' ) { +if (mode ==REBOOT_WARM ) {/* software reset, Jump into ROM at address 0 */ soft_restart (0 ); }else {
drivers/power/reset/restart-poweroff.c +2 -1
@@ -15,11 +15,12 @@#include <linux/platform_device.h> #include <linux/of_platform.h> #include <linux/module.h> +#include <linux/reboot.h> #include <asm/system_misc.h> static void restart_poweroff_do_poweroff (void ) { -arm_pm_restart ('h' ,NULL ); +arm_pm_restart (REBOOT_COLD ,NULL ); }static int restart_poweroff_probe (struct platform_device *pdev)
drivers/power/reset/vexpress-poweroff.c +1 -1
@@ -48,7 +48,7 @@ static void vexpress_power_off(void)static struct device *vexpress_restart_device; -static void vexpress_restart (char str,const char *cmd) +static void vexpress_restart (enum reboot_mode reboot_mode,const char *cmd) {vexpress_reset_do (vexpress_restart_device,"restart" ); }
include/linux/reboot.h +1 -0
@@ -13,6 +13,7 @@enum reboot_mode {REBOOT_COLD =0 ,REBOOT_WARM , +REBOOT_GPIO , };extern int register_reboot_notifier (struct notifier_block *);
include/linux/vexpress.h +1 -0
@@ -15,6 +15,7 @@#define _LINUX_VEXPRESS_H#include <linux/device.h> +#include <linux/reboot.h> #define VEXPRESS_SITE_MB 0#define VEXPRESS_SITE_DB1 1
Signature · 1 line
1.8.2.1
Re: [PATCH -v7 10/11] arm, change reboot_mode to use enum reboot_mode
arch/arm/include/asm/hardware/iop3xx.h extern int iop3xx_get_init_atu(void); · line 231
Quoted 10 lines · Robin Holt
#ifndef
__ASSEMBLY__#include <
linux/types.h>arch/arm/include/asm/hardware/iop3xx.h +2
-1+#include <linux/reboot.h> void iop3xx_map_io (void );void iop_init_cp6_handler (void );void iop_init_time (unsigned long tickrate); -void iop3xx_restart (char ,const char *); +void iop3xx_restart (enum reboot_mode ,const char *);
IMO the introduction of the enum is making things cleaner here all around.
As long as it's an equivalent transformation for ARM with no reduction in functionality (i.e. please fix any bugs Russell found), this all looks like a nice series.
Is there no parameter namespace clash between reboot modifier strings on various architectures? I.e. 's' meaning something on x86 and meaning a different thing on ARM or some other architecture.
Thanks,
Ingo
Re: [PATCH -v7 10/11] arm, change reboot_mode to use enum reboot_mode
Quoted 16 lines · Ingo Molnar
arch/arm/include/asm/hardware/iop3xx.h extern int iop3xx_get_init_atu(void); · line 231
Quoted 10 lines · Robin Holt
#ifndef
__ASSEMBLY__#include <
linux/types.h>arch/arm/include/asm/hardware/iop3xx.h +2
-1+#include <linux/reboot.h> void iop3xx_map_io (void );void iop_init_cp6_handler (void );void iop_init_time (unsigned long tickrate); -void iop3xx_restart (char ,const char *); +void iop3xx_restart (enum reboot_mode ,const char *);IMO the introduction of the enum is making things cleaner here all around.
Quoted 7 lines
As long as it's an equivalent transformation for ARM with no reduction in functionality (i.e. please fix any bugs Russell found), this all looks like a nice series.
Is there no parameter namespace clash between reboot modifier strings on various architectures? I.e. 's' meaning something on x86 and meaning a different thing on ARM or some other architecture.
There is. I used an #ifdef in kernel/reboot.c. Also w[arm] | c[old] on x86 becomes s[oft] | h[ard] | g[pio] on arm/unicore32. (Well, I just added gpio that to the patch set after noticing I missed it earlier).
Robin
PATCH 11/11 Move arch/x86 reboot= handling to generic kernel.
In reply to Robin HoltMerge together the unicore32, arm, and x86 reboot= command line parameter handling.
To: Andrew Morton <[email protected]>
To: H. Peter Anvin <[email protected]>
To: Russell King <[email protected]>
To: Guan Xuetao <[email protected]>
Cc: Russ Anderson <[email protected]>
Cc: Robin Holt <[email protected]>
Cc: Linux Kernel Mailing List <[email protected]>
Cc: the arch/x86 maintainers <[email protected]>
Cc: Arm Mailing List <[email protected]>
--- Documentation/kernel-parameters.txt | 18 ++++- arch/arm/kernel/process.c | 10 --- arch/unicore32/kernel/process.c | 10 --- arch/x86/include/asm/emergency-restart.h | 12 ---- arch/x86/kernel/apic/x2apic_uv_x.c | 2 +- arch/x86/kernel/reboot.c | 111 +------------------------------ include/linux/reboot.h | 17 +++++ kernel/reboot.c | 88 +++++++++++++++++++++++- 8 files changed, 123 insertions(+), 145 deletions(-)
Documentation/kernel-parameters.txt +15 -3
@@ -2654,9 +2654,21 @@ bytes respectively. Such letter suffixes can also be entirely omitted. Run specified binary instead of /init from the ramdisk, used for early userspace startup. See initrd. - reboot= [BUGS=X86-32,BUGS=ARM,BUGS=IA-64] Rebooting mode - Format: <reboot_mode>[,<reboot_mode2>[,...]] - See arch/*/kernel/reboot.c or arch/*/kernel/process.c + reboot= [KNL] + Format (x86 or x86_64): + [w[arm] | c[old]] \ + [,] s[mp]#### \ + [,b[ios] | a[cpi] | k[bd] | t[riple] | e[fi] | p[ci]] \ + [,f[orce] + Format (all other archs): + [s[oft] | h[ard]] \ + [,b[ios] | a[cpi] | k[bd] | t[riple] | e[fi] | p[ci]] \ + [,f[orce]] + Where reboot_mode is one of warm (soft) or cold, + reboot_type is one of bios, acpi, kbd, triple, efi, or pci, + reboot_force is either force or not specified, + reboot_cpu is s[mp]#### with #### being the processor + (in decimal) to be used for rebooting. relax_domain_level= [KNL, SMP] Set scheduler's default relax_domain_level.
arch/arm/kernel/process.c +0 -10
@@ -175,16 +175,6 @@ void arch_cpu_idle(void)default_idle (); } -enum reboot_mode reboot_mode; - -static int __init reboot_setup (char *str) -{ -if ('s' == str[0 ]) - reboot_mode =REBOOT_WARM ; -return 1 ; -} -__setup ("reboot=" , reboot_setup); -void machine_shutdown (void ) {#ifdef CONFIG_SMP
arch/unicore32/kernel/process.c +0 -10
@@ -51,16 +51,6 @@ void arch_cpu_idle(void)local_irq_enable (); } -static enum reboot_mode reboot_mode; - -int __init reboot_setup (char *str) -{ -if ('s' == str[0 ]) - reboot_mode =REBOOT_WARM ; -return 1 ; -} -__setup ("reboot=" , reboot_setup); -void machine_halt (void ) {gpio_set_value (GPO_SOFT_OFF ,0 );
arch/x86/include/asm/emergency-restart.h +0 -12
@@ -1,18 +1,6 @@#ifndef _ASM_X86_EMERGENCY_RESTART_H#define _ASM_X86_EMERGENCY_RESTART_H -enum reboot_type { -BOOT_TRIPLE ='t' , -BOOT_KBD ='k' , -BOOT_BIOS ='b' , -BOOT_ACPI ='a' , -BOOT_EFI ='e' , -BOOT_CF9 ='p' , -BOOT_CF9_COND ='q' , -}; - -extern enum reboot_type reboot_type; -extern void machine_emergency_restart (void );#endif /* _ASM_X86_EMERGENCY_RESTART_H */
arch/x86/kernel/apic/x2apic_uv_x.c +1 -1
@@ -25,6 +25,7 @@#include <linux/kdebug.h> #include <linux/delay.h> #include <linux/crash_dump.h> +#include <linux/reboot.h> #include <asm/uv/uv_mmrs.h> #include <asm/uv/uv_hub.h>
@@ -36,7 +37,6 @@#include <asm/ipi.h> #include <asm/smp.h> #include <asm/x86_init.h> -#include <asm/emergency-restart.h> #include <asm/nmi.h> /* BMC sets a bit this MMR non-zero before sending an NMI */
arch/x86/kernel/reboot.c +3 -108
130 lines not on this page · raw message
include/linux/reboot.h +17 -0
@@ -15,6 +15,23 @@ enum reboot_mode {REBOOT_WARM , REBOOT_GPIO, }; +extern enum reboot_mode reboot_mode; + +enum reboot_type { +BOOT_TRIPLE ='t' , +BOOT_KBD ='k' , +BOOT_BIOS ='b' , +BOOT_ACPI ='a' , +BOOT_EFI ='e' , +BOOT_CF9 ='p' , +BOOT_CF9_COND ='q' , +}; +extern enum reboot_type reboot_type; + +extern int reboot_default; +extern int reboot_cpu; +extern int reboot_force; +extern int register_reboot_notifier (struct notifier_block *);extern int unregister_reboot_notifier (struct notifier_block *);
kernel/reboot.c +87 -1
103 lines not on this page · raw message
Signature · 1 line
1.8.2.1
Re: [PATCH -v7 11/11] Move arch/x86 reboot= handling to generic kernel.
Quoted 2 lines · Robin Holt
Merge together the unicore32, arm, and x86 reboot= command line parameter handling.
Nice!
Quoted 21 lines
kernel/reboot.c +21
-0+switch (*str) { +#if defined(CONFIG_X86 ) || defined(CONFIG_X86_64 ) +case 'w' : + reboot_mode =REBOOT_WARM ; +break ; + +case 'c' : + reboot_mode =REBOOT_COLD ; +break ; + +#ifdef CONFIG_SMP +case 's' : +if (isdigit (*(str+1 ))) { + reboot_cpu = (int ) (*(str+1 ) -'0' ); +if (isdigit (*(str+2 ))) + reboot_cpu = reboot_cpu*10 + (int )(*(str+2 ) -'0' ); + } +/* +* We will leave sorting out the final value +* when we are ready to reboot, since we might not +* have detected BSP APIC ID or smp_num_cpu
kernel/reboot.c int orderly_poweroff(bool force) · line 408
Quoted 10 lines
kernel/reboot.c +10
-0+*/ +break ; +#endif /* CONFIG_SMP */ + +#else +case 's' : + reboot_mode =REBOOT_WARM ; +case 'h' : + reboot_mode =REBOOT_COLD ; +#endif
This architecture dependent bit is not so nice.
I doubt the 's' parameter is used widely at all on x86 [it's more like a debug/hack parameter], so might as well just pick up a new character (for example capital 'S'?) and have the same parameters on every architecture.
Thanks,
Ingo
Quoted 2 lines · Robin Holt
Andrew, Please do _NOT_ take this patch series yet. I am sending this to you because you had comments on my -v6 submission.
Another reason for not applying this is that I believe it wilfully breaks a bunch of ARM platforms - such as removing the 'g' reboot mode (for gpio based reboot on PXA), and removing the 's' reboot mode off a bunch of ARM platforms which have no way to do a hard reboot.
What scares me is that this is revision 7 of this patch set and this is the first it's been noticed on ARM... Maybe this patch set didn't touch ARM previously?
Quoted 4 lines · Russell King - ARM Linux
Quoted 2 lines · Robin Holt
Andrew, Please do _NOT_ take this patch series yet. I am sending this to you because you had comments on my -v6 submission.
Quoted 8 lines
Another reason for not applying this is that I believe it wilfully breaks a bunch of ARM platforms - such as removing the 'g' reboot mode (for gpio based reboot on PXA), and removing the 's' reboot mode off a bunch of ARM platforms which have no way to do a hard reboot.
What scares me is that this is revision 7 of this patch set and this is the first it's been noticed on ARM... Maybe this patch set didn't touch ARM previously?
It started with a simple add a CONFIG_ value which eliminated the calls to offline all cpus. That expanded to the migrate to cpu 0. Then the suggestion was to make a kernel parameter for selecting which cpu to migrate to. That led to discovering x86's reboot=s## parameter. That led to move that to generic code, which led to resolving the conflict between arm, unicore32, and x86 and therefore, this patch series.
If I had my preference, I would go back to -v2, polish it a bit, and resubmit. It just put the migrate_to_boot_cpu in kernel/sys.c, put the calls in place, and continued with shutdown.
Second choice would be -v4 which added a reboot_cpu (actually, then it was reboot_cpuid, but I would make it reboot_cpu) core_param, fixed the x86 reboot=s## handling to handle more than the first 100 cpus and also the documented smp## syntax. I would not twiddle with unicore32 or arm.
Bottom line, the first 5 patches in this series are what I really care about. They get me the ability to shut my machine down in under 15 minutes. The rest is just stuff I am doing to gain acceptance for those.
Robin
Quoted 8 lines · Russell King - ARM Linux
Quoted 2 lines · Robin Holt
Andrew, Please do _NOT_ take this patch series yet. I am sending this to you because you had comments on my -v6 submission.
Another reason for not applying this is that I believe it wilfully breaks a bunch of ARM platforms - such as removing the 'g' reboot mode (for gpio based reboot on PXA), and removing the 's' reboot mode off a bunch of ARM platforms which have no way to do a hard reboot.
I am not sure what your basis for this statement is.
First, let me look at the GPIO question.
- The pxa_restart() function was changed to use REBOOT_GPIO instead of 'g'.
- The tosa_poweroff() and spitz_poweroff() functions were changed to pass REBOOT_GPIO instead of 'g' to pxa_restart().
- The "SHARP Tosa" machine description was setting restart_mode to 'g', and setting the restart function to tosa_restart() which ignored the 'g' so I eliminated setting restart_mode to 'g' in the first place.
- The equivalent held true for the "SHARP Spitz", "SHARP Borzoi", and "SHARP Akita" machines.
- I see no other uses of 'g' for a mode being passed to a restart function.
Second, the restart_mode = 's' cases:
- The "EBSA110" machine was setting it, but ebsa110_restart does not use the reboot mode parameter so I eliminated it.
- The "Chalice-CATS" machine was converted from setting restart_mode = 's' to setting reboot_mode = REBOOT_WARM and footbridge_restart was converted to checking for REBOOT_WARM.
- The "MIO A701" machine was setting it, but the mioa701_restart() function does not use the parameter so I eliminated it.
Of the 418 machines with ".restart =" being set, there are 73 uniq functions being utilized. Here is the summary of those functions:
bcm2835_restart mode param not used. clps711x_restart mode param not used. cns3xxx_restart mode param not used. corgi_restart mode param not used. cpu8815_restart mode param not used. da8xx_restart mode param not used. davinci_restart mode param not used. dove_restart mode param not used. ebsa110_restart mode param not used. ep93xx_restart mode param not used. eva_restart mode param not used. exynos4_restart mode param not used. exynos5_restart mode param not used. footbridge_restart Adapted to use REBOOT_WARM instead of 's' h720x_restart mode param not used. highbank_restart Adapted to use REBOOT_COLD instead of 'h' imx6q_restart mode param not used. integrator_restar mode param not used. iop13xx_restart mode param not used. iop3xx_restart mode param not used. ixp4xx_restart Adapted to use REBOOT_WARM instead of 's' kirkwood_restart mode param not used. ks8695_restart Adapted to use REBOOT_WARM instead of 's' kzm9g_restart mode param not used. lpc23xx_restart Adapted to use REBOOT_WARM and REBOOT_COLD mioa701_restart mode param not used. mmp_restart mode param not used. mv78xx0_restart mode param not used. mvebu_restart mode param not used. mxc_restart mode param not used. mxs_restart mode param not used. n2100_restart mode param not used. netwinder_restart Adapted to use REBOOT_WARM instead of 's' netx_restart mode param not used. nuc9xx_restart Adapted to use REBOOT_WARM instead of 's' omap1_restart mode param not used. omap2xxx_restart mode param not used. omap3xxx_restart mode param not used. omap44xx_restart mode param not used. orion5x_restart mode param not used. picoxcell_wdt_restart mode param not used. pxa168_restart mode param not used. pxa_restart Adapted to use REBOOT_WARM, REBOOT_COLD, and REBOOT_GPIO. realview_eb_restart mode param not used. realview_pb1176_restart mode param not used. realview_pb11mp_restart mode param not used. realview_pba8_restart mode param not used. realview_pbx_restart mode param not used. rpc_restart mode param not used. s3c2410_restart Adapted to use REBOOT_WARM instead of 's' s3c2412_restart Adapted to use REBOOT_WARM instead of 's' s3c2416_restart Adapted to use REBOOT_WARM instead of 's' s3c2443_restart Adapted to use REBOOT_WARM instead of 's' s3c244x_restart Adapted to use REBOOT_WARM instead of 's' s3c64xx_restart Adapted to use REBOOT_WARM instead of 's' s5p64x0_restart Adapted to use REBOOT_WARM instead of 's' s5pc100_restart Adapted to use REBOOT_WARM instead of 's' s5pv210_restart mode param not used. sa11x0_restart Adapted to use REBOOT_WARM instead of 's' shark_restart mode param not used. sirfsoc_restart mode param not used. socfpga_cyclone5_restart mode param not used. spear_restart Adapted to use REBOOT_WARM instead of 's' spitz_restart mode param not used. sunxi_restart mode param not used. tegra_assert_system_reset mode param not used. tnetv107x_restart mode param not used. tosa_restart mode param not used. u300_restart Adapted to use REBOOT_WARM and REBOOT_COLD versatile_restart mode param not used. voiceblue_restart mode param not used. vt8500_restart mode param not used.
Callers to pxa_restart were converted as follows:
- corgi_poweroff(), corgi_restart(), and poodle_poweroff() were converted from passing 'h' to passing REBOOT_COLD.
- mioa701_poweroff() and mioa701_restart() were converted from passing 's' to passing REBOOT_WARM.
- As discussed above, tosa_poweroff() and spitz_poweroff() were converted from using 'g' to passing REBOOT_GPIO.
Quoted 1 line
From the above list, no other functions which utilized the mode
parameter were found being called from anything other than their machine desription's .restart callout.
I _THOUGHT_ I had checked each and every one fairly thoroughly to ensure all callers were converted as appropriate to pass in REBOOT_COLD, REBOOT_WARM, or REBOOT_GPIO instead of 'h', 's', or 'g'. It was a lot of code to look over with no strong familiarity so I likely missed something, but I did put an honest effort into doing this right. If you could point to a specific problem, I will address it.
Thanks,
Robin
Quoted 11 lines · Robin Holt
Quoted 8 lines · Russell King - ARM Linux
Quoted 2 lines · Robin Holt
Andrew, Please do _NOT_ take this patch series yet. I am sending this to you because you had comments on my -v6 submission.
Another reason for not applying this is that I believe it wilfully breaks a bunch of ARM platforms - such as removing the 'g' reboot mode (for gpio based reboot on PXA), and removing the 's' reboot mode off a bunch of ARM platforms which have no way to do a hard reboot.
I am not sure what your basis for this statement is.
Probably old understanding of the code, and me getting old and getting forgetful. :(
Quoted 11 lines · Russell King - ARM Linux
Quoted 10 lines · Robin Holt
Quoted 8 lines · Russell King - ARM Linux
Quoted 2 lines · Robin Holt
Andrew, Please do _NOT_ take this patch series yet. I am sending this to you because you had comments on my -v6 submission.
Another reason for not applying this is that I believe it wilfully breaks a bunch of ARM platforms - such as removing the 'g' reboot mode (for gpio based reboot on PXA), and removing the 's' reboot mode off a bunch of ARM platforms which have no way to do a hard reboot.
Quoted 4 lines
Quoted 1 line
I am not sure what your basis for this statement is.
Probably old understanding of the code, and me getting old and getting forgetful. :(
Russell,
Are you alright with these patches?
Thanks,
Robin