Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Jan 2012 02:15:25 +0000 (18:15 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Jan 2012 02:15:25 +0000 (18:15 -0800)
* 'for-linus' of git://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm: (207 commits)
  ARM: 7267/1: Remove BUILD_BUG_ON from asm/bug.h
  ARM: 7269/1: mach-sa1100: fix sched_clock breakage
  ARM: 7198/1: arm/imx6: add restart support for imx6q
  ARM: restart: remove the now empty arch_reset()
  ARM: restart: remove comments about adding code to arch_reset()
  ARM: restart: lpc32xx & u300: remove unnecessary printk
  ARM: restart: plat-samsung: remove plat/reset.h and s5p_reset_hook
  ARM: restart: w90x900: use new restart hook
  ARM: restart: Versatile Express: use new restart hook
  ARM: restart: versatile: use new restart hook
  ARM: restart: u300: use new restart hook
  ARM: restart: tegra: use new restart hook
  ARM: restart: spear: use new restart hook
  ARM: restart: shark: use new restart hook
  ARM: restart: sa1100: use new restart hook
  ARM: 7252/1: restart: S5PV210: use new restart hook
  ARM: 7251/1: restart: S5PC100: use new restart hook
  ARM: 7250/1: restart: S5P64X0: use new restart hook
  ARM: 7266/1: restart: S3C64XX: use new restart hook
  ARM: 7265/1: restart: S3C24XX: use new restart hook
  ...

Fix up trivial conflict in arch/arm/mm/init.c due to removal of
memblock_init() clashing with the movement of the sorting of the meminfo
array.

1  2 
MAINTAINERS
arch/arm/kernel/process.c
arch/arm/kernel/setup.c
arch/arm/mm/init.c

diff --combined MAINTAINERS
@@@ -1124,13 -1124,6 +1124,6 @@@ S:     Supporte
  F:    arch/arm/mach-shmobile/
  F:    drivers/sh/
  
- ARM/TELECHIPS ARM ARCHITECTURE
- M:    "Hans J. Koch" <hjk@hansjkoch.de>
- L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
- S:    Maintained
- F:    arch/arm/plat-tcc/
- F:    arch/arm/mach-tcc8k/
  ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
  M:    Lennert Buytenhek <kernel@wantstofly.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -1698,9 -1691,11 +1691,9 @@@ F:     arch/x86/include/asm/tce.
  
  CAN NETWORK LAYER
  M:    Oliver Hartkopp <socketcan@hartkopp.net>
 -M:    Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
 -M:    Urs Thuermann <urs.thuermann@volkswagen.de>
  L:    linux-can@vger.kernel.org
 -L:    netdev@vger.kernel.org
 -W:    http://developer.berlios.de/projects/socketcan/
 +W:    http://gitorious.org/linux-can
 +T:    git git://gitorious.org/linux-can/linux-can-next.git
  S:    Maintained
  F:    net/can/
  F:    include/linux/can.h
@@@ -1711,10 -1706,9 +1704,10 @@@ F:    include/linux/can/gw.
  
  CAN NETWORK DRIVERS
  M:    Wolfgang Grandegger <wg@grandegger.com>
 +M:    Marc Kleine-Budde <mkl@pengutronix.de>
  L:    linux-can@vger.kernel.org
 -L:    netdev@vger.kernel.org
 -W:    http://developer.berlios.de/projects/socketcan/
 +W:    http://gitorious.org/linux-can
 +T:    git git://gitorious.org/linux-can/linux-can-next.git
  S:    Maintained
  F:    drivers/net/can/
  F:    include/linux/can/dev.h
@@@ -4011,7 -4005,7 +4004,7 @@@ M:      Josh Boyer <jwboyer@gmail.com
  M:    Matt Porter <mporter@kernel.crashing.org>
  W:    http://www.penguinppc.org/
  L:    linuxppc-dev@lists.ozlabs.org
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx.git
 +T:    git git://git.infradead.org/users/jwboyer/powerpc-4xx.git
  S:    Maintained
  F:    arch/powerpc/platforms/40x/
  F:    arch/powerpc/platforms/44x/
@@@ -4854,14 -4848,6 +4847,14 @@@ S:    Maintaine
  T:    git git://openrisc.net/~jonas/linux
  F:    arch/openrisc
  
 +OPENVSWITCH
 +M:    Jesse Gross <jesse@nicira.com>
 +L:    dev@openvswitch.org
 +W:    http://openvswitch.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch.git
 +S:    Maintained
 +F:    net/openvswitch/
 +
  OPL4 DRIVER
  M:    Clemens Ladisch <clemens@ladisch.de>
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
@@@ -5381,7 -5367,6 +5374,7 @@@ S:      Supporte
  F:    drivers/scsi/qla4xxx/
  
  QLOGIC QLA3XXX NETWORK DRIVER
 +M:    Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
  M:    Ron Mercer <ron.mercer@qlogic.com>
  M:    linux-driver@qlogic.com
  L:    netdev@vger.kernel.org
@@@ -5901,6 -5886,7 +5894,6 @@@ F:      drivers/net/ethernet/emulex/benet
  
  SFC NETWORK DRIVER
  M:    Solarflare linux maintainers <linux-net-drivers@solarflare.com>
 -M:    Steve Hodgson <shodgson@solarflare.com>
  M:    Ben Hutchings <bhutchings@solarflare.com>
  L:    netdev@vger.kernel.org
  S:    Supported
@@@ -6508,13 -6494,6 +6501,13 @@@ W:    http://tcp-lp-mod.sourceforge.net
  S:    Maintained
  F:    net/ipv4/tcp_lp.c
  
 +TEAM DRIVER
 +M:    Jiri Pirko <jpirko@redhat.com>
 +L:    netdev@vger.kernel.org
 +S:    Supported
 +F:    drivers/net/team/
 +F:    include/linux/if_team.h
 +
  TEGRA SUPPORT
  M:    Colin Cross <ccross@android.com>
  M:    Olof Johansson <olof@lixom.net>
@@@ -57,7 -57,7 +57,7 @@@ static const char *isa_modes[] = 
    "ARM" , "Thumb" , "Jazelle", "ThumbEE"
  };
  
- extern void setup_mm_for_reboot(char mode);
+ extern void setup_mm_for_reboot(void);
  
  static volatile int hlt_counter;
  
@@@ -92,18 -92,24 +92,24 @@@ static int __init hlt_setup(char *__unu
  __setup("nohlt", nohlt_setup);
  __setup("hlt", hlt_setup);
  
- void arm_machine_restart(char mode, const char *cmd)
+ extern void call_with_stack(void (*fn)(void *), void *arg, void *sp);
+ typedef void (*phys_reset_t)(unsigned long);
+ /*
+  * A temporary stack to use for CPU reset. This is static so that we
+  * don't clobber it with the identity mapping. When running with this
+  * stack, any references to the current task *will not work* so you
+  * should really do as little as possible before jumping to your reset
+  * code.
+  */
+ static u64 soft_restart_stack[16];
+ static void __soft_restart(void *addr)
  {
-       /* Disable interrupts first */
-       local_irq_disable();
-       local_fiq_disable();
+       phys_reset_t phys_reset;
  
-       /*
-        * Tell the mm system that we are going to reboot -
-        * we may need it to insert some 1:1 mappings so that
-        * soft boot works.
-        */
-       setup_mm_for_reboot(mode);
+       /* Take out a flat memory mapping. */
+       setup_mm_for_reboot();
  
        /* Clean and invalidate caches */
        flush_cache_all();
        /* Push out any further dirty data, and ensure cache is empty */
        flush_cache_all();
  
-       /*
-        * Now call the architecture specific reboot code.
-        */
-       arch_reset(mode, cmd);
+       /* Switch to the identity mapping. */
+       phys_reset = (phys_reset_t)(unsigned long)virt_to_phys(cpu_reset);
+       phys_reset((unsigned long)addr);
  
-       /*
-        * Whoops - the architecture was unable to reboot.
-        * Tell the user!
-        */
-       mdelay(1000);
-       printk("Reboot failed -- System halted\n");
-       while (1);
+       /* Should never get here. */
+       BUG();
+ }
+ void soft_restart(unsigned long addr)
+ {
+       u64 *stack = soft_restart_stack + ARRAY_SIZE(soft_restart_stack);
+       /* Disable interrupts first */
+       local_irq_disable();
+       local_fiq_disable();
+       /* Disable the L2 if we're the last man standing. */
+       if (num_online_cpus() == 1)
+               outer_disable();
+       /* Change to the new stack and continue with the reset. */
+       call_with_stack(__soft_restart, (void *)addr, (void *)stack);
+       /* Should never get here. */
+       BUG();
+ }
+ 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) = arm_machine_restart;
+ void (*arm_pm_restart)(char str, const char *cmd) = null_restart;
  EXPORT_SYMBOL_GPL(arm_pm_restart);
  
  static void do_nothing(void *unused)
@@@ -183,8 -206,7 +206,8 @@@ void cpu_idle(void
  
        /* endless idle loop with no priority at all */
        while (1) {
 -              tick_nohz_stop_sched_tick(1);
 +              tick_nohz_idle_enter();
 +              rcu_idle_enter();
                leds_event(led_idle_start);
                while (!need_resched()) {
  #ifdef CONFIG_HOTPLUG_CPU
                        }
                }
                leds_event(led_idle_end);
 -              tick_nohz_restart_sched_tick();
 +              rcu_idle_exit();
 +              tick_nohz_idle_exit();
                preempt_enable_no_resched();
                schedule();
                preempt_disable();
@@@ -255,7 -276,15 +278,15 @@@ void machine_power_off(void
  void machine_restart(char *cmd)
  {
        machine_shutdown();
        arm_pm_restart(reboot_mode, cmd);
+       /* Give a grace period for failure to restart of 1s */
+       mdelay(1000);
+       /* Whoops - the platform was unable to reboot. Tell the user! */
+       printk("Reboot failed -- System halted\n");
+       while (1);
  }
  
  void __show_regs(struct pt_regs *regs)
diff --combined arch/arm/kernel/setup.c
@@@ -31,6 -31,7 +31,7 @@@
  #include <linux/memblock.h>
  #include <linux/bug.h>
  #include <linux/compiler.h>
+ #include <linux/sort.h>
  
  #include <asm/unified.h>
  #include <asm/cpu.h>
@@@ -52,7 -53,6 +53,7 @@@
  #include <asm/mach/time.h>
  #include <asm/traps.h>
  #include <asm/unwind.h>
 +#include <asm/memblock.h>
  
  #if defined(CONFIG_DEPRECATED_PARAM_STRUCT)
  #include "compat.h"
@@@ -891,6 -891,12 +892,12 @@@ static struct machine_desc * __init set
        return mdesc;
  }
  
+ static int __init meminfo_cmp(const void *_a, const void *_b)
+ {
+       const struct membank *a = _a, *b = _b;
+       long cmp = bank_pfn_start(a) - bank_pfn_start(b);
+       return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
+ }
  
  void __init setup_arch(char **cmdline_p)
  {
                arm_dma_zone_size = mdesc->dma_zone_size;
        }
  #endif
-       if (mdesc->soft_reboot)
-               reboot_setup("s");
+       if (mdesc->restart_mode)
+               reboot_setup(&mdesc->restart_mode);
  
        init_mm.start_code = (unsigned long) _text;
        init_mm.end_code   = (unsigned long) _etext;
  
        parse_early_param();
  
+       sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);
        sanity_check_meminfo();
        arm_memblock_init(&meminfo, mdesc);
  
        paging_init(mdesc);
        request_standard_resources(mdesc);
  
+       if (mdesc->restart)
+               arm_pm_restart = mdesc->restart;
        unflatten_device_tree();
  
  #ifdef CONFIG_SMP
diff --combined arch/arm/mm/init.c
@@@ -20,7 -20,6 +20,6 @@@
  #include <linux/highmem.h>
  #include <linux/gfp.h>
  #include <linux/memblock.h>
- #include <linux/sort.h>
  
  #include <asm/mach-types.h>
  #include <asm/prom.h>
@@@ -32,7 -31,6 +31,7 @@@
  
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
 +#include <asm/memblock.h>
  
  #include "mm.h"
  
@@@ -135,30 -133,18 +134,18 @@@ void show_mem(unsigned int filter
  }
  
  static void __init find_limits(unsigned long *min, unsigned long *max_low,
-       unsigned long *max_high)
+                              unsigned long *max_high)
  {
        struct meminfo *mi = &meminfo;
        int i;
  
-       *min = -1UL;
-       *max_low = *max_high = 0;
-       for_each_bank (i, mi) {
-               struct membank *bank = &mi->bank[i];
-               unsigned long start, end;
-               start = bank_pfn_start(bank);
-               end = bank_pfn_end(bank);
-               if (*min > start)
-                       *min = start;
-               if (*max_high < end)
-                       *max_high = end;
-               if (bank->highmem)
-                       continue;
-               if (*max_low < end)
-                       *max_low = end;
-       }
+       /* This assumes the meminfo array is properly sorted */
+       *min = bank_pfn_start(&mi->bank[0]);
+       for_each_bank (i, mi)
+               if (mi->bank[i].highmem)
+                               break;
+       *max_low = bank_pfn_end(&mi->bank[i - 1]);
+       *max_high = bank_pfn_end(&mi->bank[mi->nr_banks - 1]);
  }
  
  static void __init arm_bootmem_init(unsigned long start_pfn,
@@@ -320,19 -306,11 +307,10 @@@ static void arm_memory_present(void
  }
  #endif
  
- static int __init meminfo_cmp(const void *_a, const void *_b)
- {
-       const struct membank *a = _a, *b = _b;
-       long cmp = bank_pfn_start(a) - bank_pfn_start(b);
-       return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
- }
  void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
  {
        int i;
  
-       sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);
 -      memblock_init();
        for (i = 0; i < mi->nr_banks; i++)
                memblock_add(mi->bank[i].start, mi->bank[i].size);
  
        if (mdesc->reserve)
                mdesc->reserve();
  
 -      memblock_analyze();
 +      memblock_allow_resize();
        memblock_dump_all();
  }
  
@@@ -403,8 -381,6 +381,6 @@@ void __init bootmem_init(void
         */
        arm_bootmem_free(min, max_low, max_high);
  
-       high_memory = __va(((phys_addr_t)max_low << PAGE_SHIFT) - 1) + 1;
        /*
         * This doesn't seem to be used by the Linux memory manager any
         * more, but is used by ll_rw_block.  If we can get rid of it, we