1. 25 9月, 2012 1 次提交
  2. 20 9月, 2012 1 次提交
  3. 19 9月, 2012 1 次提交
  4. 14 9月, 2012 2 次提交
  5. 13 9月, 2012 1 次提交
    • M
      ARM: SoC: add per-platform SMP operations · abcee5fb
      Marc Zyngier 提交于
      This adds a 'struct smp_operations' to abstract the CPU initialization
      and hot plugging functions on SMP systems, which otherwise conflict
      in a multiplatform kernel. This also helps shmobile and potentially
      others that have more than one method to do these.
      
      To allow the kernel to continue building, the platform hooks are
      defined as weak symbols which are overrided by the platform code.
      Once all platforms are converted, the "weak" attribute will be
      removed and the function made static.
      
      Unlike the original version from Marc, this new version from Arnd
      does not use a generalized abstraction for per-soc data structures
      but only tries to solve the problem for the SMP operations. This
      way, we can collapse the previous four data structures into a
      single struct, which is less systematic but also easier to follow
      as a causal reader.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Acked-by: NNicolas Pitre <nico@fluxnic.net>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      abcee5fb
  6. 10 9月, 2012 1 次提交
  7. 31 7月, 2012 1 次提交
    • J
      ARM: 7480/1: only call smp_send_stop() on SMP · c5dff4ff
      Javier Martinez Canillas 提交于
      On reboot or poweroff (machine_shutdown()) a call to smp_send_stop() is
      made (to stop the others CPU's) when CONFIG_SMP=y.
      
      arch/arm/kernel/process.c:
      
      void machine_shutdown(void)
      {
       #ifdef CONFIG_SMP
             smp_send_stop();
       #endif
      }
      
      smp_send_stop() calls the function pointer smp_cross_call(), which is set
      on the smp_init_cpus() function for OMAP processors.
      
      arch/arm/mach-omap2/omap-smp.c:
      
      void __init smp_init_cpus(void)
      {
      ...
      	set_smp_cross_call(gic_raise_softirq);
      ...
      }
      
      But the ARM setup_arch() function only calls smp_init_cpus()
      if CONFIG_SMP=y && is_smp().
      
      arm/kernel/setup.c:
      
      void __init setup_arch(char **cmdline_p)
      {
      ...
       #ifdef CONFIG_SMP
      	if (is_smp())
      		smp_init_cpus();
       #endif
      ...
      }
      
      Newer OMAP CPU's are SMP machines so omap2plus_defconfig sets
      CONFIG_SMP=y. Unfortunately on an OMAP UP machine is_smp()
      returns false and smp_init_cpus() is never called and the
      smp_cross_call() function remains NULL.
      
      If the machine is rebooted or powered off, smp_send_stop() will
      be called (since CONFIG_SMP=y) leading to the following error:
      
      [   42.815551] Restarting system.
      [   42.819030] Unable to handle kernel NULL pointer dereference at virtual address 00000000
      [   42.827667] pgd = d7a74000
      [   42.830566] [00000000] *pgd=96ce7831, *pte=00000000, *ppte=00000000
      [   42.837249] Internal error: Oops: 80000007 [#1] SMP ARM
      [   42.842773] Modules linked in:
      [   42.846008] CPU: 0    Not tainted  (3.5.0-rc3-next-20120622-00002-g62e87ba-dirty #44)
      [   42.854278] PC is at 0x0
      [   42.856994] LR is at smp_send_stop+0x4c/0xe4
      [   42.861511] pc : [<00000000>]    lr : [<c00183a4>]    psr: 60000013
      [   42.861511] sp : d6c85e70  ip : 00000000  fp : 00000000
      [   42.873626] r10: 00000000  r9 : d6c84000  r8 : 00000002
      [   42.879150] r7 : c07235a0  r6 : c06dd2d0  r5 : 000f4241  r4 : d6c85e74
      [   42.886047] r3 : 00000000  r2 : 00000000  r1 : 00000006  r0 : d6c85e74
      [   42.892944] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      [   42.900482] Control: 10c5387d  Table: 97a74019  DAC: 00000015
      [   42.906555] Process reboot (pid: 1166, stack limit = 0xd6c842f8)
      [   42.912902] Stack: (0xd6c85e70 to 0xd6c86000)
      [   42.917510] 5e60:                                     c07235a0 00000000 00000000 d6c84000
      [   42.926177] 5e80: 01234567 c00143d0 4321fedc c00511bc d6c85ebc 00000168 00000460 00000000
      [   42.934814] 5ea0: c1017950 a0000013 c1017900 d8014390 d7ec3858 c0498e48 c1017950 00000000
      [   42.943481] 5ec0: d6ddde10 d6c85f78 00000003 00000000 d6ddde10 d6c84000 00000000 00000000
      [   42.952117] 5ee0: 00000002 00000000 00000000 c0088c88 00000002 00000000 00000000 c00f4b90
      [   42.960784] 5f00: 00000000 d6c85ebc d8014390 d7e311c8 60000013 00000103 00000002 d6c84000
      [   42.969421] 5f20: c00f3274 d6e00a00 00000001 60000013 d6c84000 00000000 00000000 c00895d4
      [   42.978057] 5f40: 00000002 d8007c80 d781f000 c00f6150 d8010cc0 c00f3274 d781f000 d6c84000
      [   42.986694] 5f60: c0013020 d6e00a00 00000001 20000010 0001257c ef000000 00000000 c00895d4
      [   42.995361] 5f80: 00000002 00000001 00000003 00000000 00000001 00000003 00000000 00000058
      [   43.003997] 5fa0: c00130c8 c0012f00 00000001 00000003 fee1dead 28121969 01234567 00000002
      [   43.012634] 5fc0: 00000001 00000003 00000000 00000058 00012584 0001257c 00000001 00000000
      [   43.021270] 5fe0: 000124bc bec5cc6c 00008f9c 4a2f7c40 20000010 fee1dead 00000000 00000000
      [   43.029968] [<c00183a4>] (smp_send_stop+0x4c/0xe4) from [<c00143d0>] (machine_restart+0xc/0x4c)
      [   43.039154] [<c00143d0>] (machine_restart+0xc/0x4c) from [<c00511bc>] (sys_reboot+0x144/0x1f0)
      [   43.048278] [<c00511bc>] (sys_reboot+0x144/0x1f0) from [<c0012f00>] (ret_fast_syscall+0x0/0x3c)
      [   43.057464] Code: bad PC value
      [   43.060760] ---[ end trace c3988d1dd0b8f0fb ]---
      
      Add a check so smp_cross_call() is only called when there is more than one CPU on-line.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: Javier Martinez Canillas <javier at dowhile0.org>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      c5dff4ff
  8. 10 7月, 2012 1 次提交
    • S
      ARM: 7457/1: smp: Fix suspicious RCU originating from cpu_die() · ff081e05
      Stephen Boyd 提交于
      While running hotplug tests I ran into this RCU splat
      
      ===============================
      [ INFO: suspicious RCU usage. ]
      3.4.0 #3275 Tainted: G        W
      -------------------------------
      include/linux/rcupdate.h:729 rcu_read_lock() used illegally while idle!
      
      other info that might help us debug this:
      
      RCU used illegally from idle CPU!
      rcu_scheduler_active = 1, debug_locks = 0
      RCU used illegally from extended quiescent state!
      4 locks held by swapper/2/0:
       #0:  ((cpu_died).wait.lock){......}, at: [<c00ab128>] complete+0x1c/0x5c
       #1:  (&p->pi_lock){-.-.-.}, at: [<c00b275c>] try_to_wake_up+0x2c/0x388
       #2:  (&rq->lock){-.-.-.}, at: [<c00b2860>] try_to_wake_up+0x130/0x388
       #3:  (rcu_read_lock){.+.+..}, at: [<c00abe5c>] cpuacct_charge+0x28/0x1f4
      
      stack backtrace:
      [<c001521c>] (unwind_backtrace+0x0/0x12c) from [<c00abec8>] (cpuacct_charge+0x94/0x1f4)
      [<c00abec8>] (cpuacct_charge+0x94/0x1f4) from [<c00b395c>] (update_curr+0x24c/0x2c8)
      [<c00b395c>] (update_curr+0x24c/0x2c8) from [<c00b59c4>] (enqueue_task_fair+0x50/0x194)
      [<c00b59c4>] (enqueue_task_fair+0x50/0x194) from [<c00afea4>] (enqueue_task+0x30/0x34)
      [<c00afea4>] (enqueue_task+0x30/0x34) from [<c00b0908>] (ttwu_activate+0x14/0x38)
      [<c00b0908>] (ttwu_activate+0x14/0x38) from [<c00b28a8>] (try_to_wake_up+0x178/0x388)
      [<c00b28a8>] (try_to_wake_up+0x178/0x388) from [<c00a82a0>] (__wake_up_common+0x34/0x78)
      [<c00a82a0>] (__wake_up_common+0x34/0x78) from [<c00ab154>] (complete+0x48/0x5c)
      [<c00ab154>] (complete+0x48/0x5c) from [<c07db7cc>] (cpu_die+0x2c/0x58)
      [<c07db7cc>] (cpu_die+0x2c/0x58) from [<c000f954>] (cpu_idle+0x64/0xfc)
      [<c000f954>] (cpu_idle+0x64/0xfc) from [<80208160>] (0x80208160)
      
      When a cpu is marked offline during its idle thread it calls
      cpu_die() during an RCU idle period. cpu_die() calls complete()
      to notify the killing process that the cpu has died. complete()
      calls into the scheduler code and eventually grabs an RCU read
      lock in cpuacct_charge().
      
      Mark complete() as RCU_NONIDLE so that RCU pays attention to this
      CPU for the duration of the complete() function even though it's
      in idle.
      Suggested-by: N"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      ff081e05
  9. 01 6月, 2012 1 次提交
  10. 06 5月, 2012 1 次提交
    • C
      ARM: 7414/1: SMP: prevent use of the console when using idmap_pgd · fde165b2
      Colin Cross 提交于
      Commit 4e8ee7de (ARM: SMP: use
      idmap_pgd for mapping MMU enable during secondary booting)
      switched secondary boot to use idmap_pgd, which is initialized
      during early_initcall, instead of a page table initialized during
      __cpu_up.  This causes idmap_pgd to contain the static mappings
      but be missing all dynamic mappings.
      
      If a console is registered that creates a dynamic mapping, the
      printk in secondary_start_kernel will trigger a data abort on
      the missing mapping before the exception handlers have been
      initialized, leading to a hang.  Initial boot is not affected
      because no consoles have been registered, and resume is usually
      not affected because the offending console is suspended.
      Onlining a cpu with hotplug triggers the problem.
      
      A workaround is to the printk in secondary_start_kernel until
      after the page tables have been switched back to init_mm.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NColin Cross <ccross@android.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      fde165b2
  11. 28 4月, 2012 1 次提交
    • W
      ARM: 7405/1: kexec: call platform_cpu_kill on the killer rather than the victim · 6fa99b7f
      Will Deacon 提交于
      When performing a kexec on an SMP system, the secondary cores are stopped
      by calling machine_shutdown(), which in turn issues IPIs to offline the
      other CPUs. Unfortunately, this isn't enough to reboot the cores into
      a new kernel (since they are just executing a cpu_relax loop somewhere
      in memory) so we make use of platform_cpu_kill, part of the CPU hotplug
      implementation, to place the cores somewhere safe. This function expects
      to be called on the killing CPU for each core that it takes out.
      
      This patch moves the platform_cpu_kill callback out of the IPI handler
      and into smp_send_stop, therefore ensuring that it executes on the
      killing CPU rather than on the victim, matching what the hotplug code
      requires.
      
      Cc: stable@vger.kernel.org
      Reported-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      6fa99b7f
  12. 27 4月, 2012 1 次提交
  13. 26 4月, 2012 2 次提交
  14. 29 3月, 2012 1 次提交
    • R
      remove references to cpu_*_map in arch/ · 0b5f9c00
      Rusty Russell 提交于
      This has been obsolescent for a while; time for the final push.
      
      In adjacent context, replaced old cpus_* with cpumask_*.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Acked-by: David S. Miller <davem@davemloft.net> (arch/sparc)
      Acked-by: Chris Metcalf <cmetcalf@tilera.com> (arch/tile)
      Cc: user-mode-linux-devel@lists.sourceforge.net
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: linux-hexagon@vger.kernel.org
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Helge Deller <deller@gmx.de>
      Cc: sparclinux@vger.kernel.org
      0b5f9c00
  15. 24 3月, 2012 1 次提交
  16. 13 3月, 2012 3 次提交
  17. 23 1月, 2012 1 次提交
  18. 20 1月, 2012 1 次提交
    • R
      ARM: fix rcu stalls on SMP platforms · 7deabca0
      Russell King 提交于
      We can stall RCU processing on SMP platforms if a CPU sits in its idle
      loop for a long time.  This happens because we don't call irq_enter()
      and irq_exit() around generic_smp_call_function_interrupt() and
      friends.  Add the necessary calls, and remove the one from within
      ipi_timer(), so that they're all in a common place.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      7deabca0
  19. 13 12月, 2011 1 次提交
    • W
      ARM: stop: execute platform callback from cpu_stop code · 02b73e2e
      Will Deacon 提交于
      Sending IPI_CPU_STOP to a CPU causes it to execute a busy cpu_relax
      loop forever. This makes it impossible to kexec successfully on an SMP
      system since the secondary CPUs do not reset.
      
      This patch adds a callback to platform_cpu_kill, defined when
      CONFIG_HOTPLUG_CPU=y, from the ipi_cpu_stop handling code. This function
      currently just returns 1 on all platforms that define it but allows them
      to do something more sophisticated in the future.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      02b73e2e
  20. 06 12月, 2011 2 次提交
    • W
      ARM: SMP: use idmap_pgd for mapping MMU enable during secondary booting · 4e8ee7de
      Will Deacon 提交于
      The ARM SMP booting code allocates a temporary set of page tables
      containing an identity mapping of the kernel image and provides this
      to secondary CPUs for initial booting.
      
      In reality, we only need to include the __turn_mmu_on function in the
      identity mapping since the rest of the kernel is executing from virtual
      addresses after this point.
      
      This patch adds __turn_mmu_on to the .idmap.text section, allowing the
      SMP booting code to use the idmap_pgd directly and not have to populate
      its own set of page table.
      
      As a result of this patch, we can make the identity_mapping_add function
      static (since it is only used within mm/idmap.c) and also remove the
      identity_mapping_del function. The identity map population is moved to
      an early initcall so that it is setup in time for secondary CPU bringup.
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      4e8ee7de
    • W
      ARM: idmap: populate identity map pgd at init time using .init.text · 8903826d
      Will Deacon 提交于
      When disabling and re-enabling the MMU, it is necessary to take out an
      identity mapping for the code that manipulates the SCTLR in order to
      avoid it disappearing from under our feet. This is useful when soft
      rebooting and returning from CPU suspend.
      
      This patch allocates a set of page tables during boot and populates them
      with an identity mapping for the .idmap.text section. This means that
      users of the identity map do not need to manage their own pgd and can
      instead annotate their functions with __idmap or, in the case of assembly
      code, place them in the correct section.
      Acked-by: NDave Martin <dave.martin@linaro.org>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Tested-by: NLorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      8903826d
  21. 24 10月, 2011 1 次提交
  22. 23 10月, 2011 2 次提交
  23. 17 10月, 2011 5 次提交
  24. 13 9月, 2011 1 次提交
  25. 27 7月, 2011 1 次提交
  26. 07 7月, 2011 1 次提交
    • S
      ARM: 6993/1: platsmp: Allow secondary cpu hotplug with maxcpus=1 · 7fa22bd5
      Stephen Boyd 提交于
      If an ARM system has multiple cpus in the same socket and the
      kernel is booted with maxcpus=1, secondary cpus are possible but
      not present due to how platform_smp_prepare_cpus() is called.
      Since most typical ARM processors don't actually support physical
      hotplug, initialize the present map to be equal to the possible
      map in generic ARM SMP code. Also, always call
      platform_smp_prepare_cpus() as long as max_cpus is non-zero (0
      means no SMP) to allow platform code to do any SMP setup.
      
      After applying this patch it's possible to boot an ARM system
      with maxcpus=1 on the command line and then hotplug in secondary
      cpus via sysfs. This is more in line with how x86 does things.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Kukjin Kim <kgene.kim@samsung.com>
      Cc: David Brown <davidb@codeaurora.org>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
      Cc: Linus Walleij <linus.walleij@stericsson.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      7fa22bd5
  27. 21 6月, 2011 1 次提交
  28. 26 5月, 2011 1 次提交
  29. 23 5月, 2011 1 次提交
  30. 28 4月, 2011 1 次提交