Skip to content

RFC ARM: SMP: common "pen" secondary release method

Alex Elder linux-arm-kernel linux-devicetree lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7ARM: allow <asm/cputype.h> inclusion from assemblyarch/arm/include/asm/cputype.h+4 -00 replies
2/7ARM: SMP: generic SMP spin-table method routinesarch/arm/include/asm/smp.h arch/arm/kernel/head.S arch/arm/kernel/smp.c+115 -02 replies
3/7ARM: realview: use central SMP spin-table routinesarch/arm/mach-realview/platsmp.c+3 -50 replies
4/7ARM: vexpress: use central SMP spin-table routinesarch/arm/mach-vexpress/platsmp.c+3 -50 replies
5/7ARM: versatile: kill off SMP support codearch/arm/mach-vexpress/v2m.c arch/arm/plat-versatile/Makefile arch/arm/plat-versatile/headsmp.S +2 more+0 -1480 replies
6/7ARM: ux500: use generic SMP spin-table routinesarch/arm/mach-ux500/Makefile arch/arm/mach-ux500/headsmp.S arch/arm/mach-ux500/platsmp.c+4 -1070 replies
7/7ARM: spear: use central SMP spin-table routinesarch/arm/mach-spear/Makefile arch/arm/mach-spear/generic.h arch/arm/mach-spear/headsmp.S +1 more+4 -1210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/7] ARM: SMP: common "pen" secondary release method

This series proposes creating a single implementation of the "pen release" (or spin-table) mechanism for starting secondary CPUs on ARM SMP systems. This mechanism is currently implemented at least 5 times in the kernel, each essentially identical to the other. There are other machines that use this method, but slight differences make it necessary to incorporate further work in order to accomodate them with a single set of functions.

This work began with integrating SMP support for a Broadcom SoC. The code I started was another copy of the "pen release" code. Looking at how existing systems handled this, the duplication of code was obvious, but the fact that implementations were identical was less so. In addition, the arm64 (though not 32-bit arm) code supports the ability to define an "enable-method" property for CPUs in a machine's device tree (one of which is "spin-table"), allowing the secondary startup mechanism to be specified abstractly.

My broader goal then was to set up the SMP support for the Broadcom SoC such that it could be defined in its device tree using a central "spin-table" enable method for secondary CPUs. The first step was to create a central spin-table implementation. I've tried to do this generally so it's usable by as many other platforms as possible. (An alternative would be to define a custom enable method for this platform, but I'd prefer to avoid that if I can.)

I already have some code for the second step--which supports specifying the "spin-table" CPU enable method in device tree files. But before presenting that I wanted to post this series to get feedback on the approach.

I've provided a little more information for each patch below.

This code is available in the "review/common-spin-code" branch of the git repository here:
http://git.linaro.org/landing-teams/working/broadcom/kernel.git

-Alex

Alex Elder (7):
ARM: allow <asm/cputype.h> inclusion from assembly
This patch is done specifically so the next one can use the value of MPIDR_HWID_BITMASK in secondary_holding_pen(), which is defined in asssembly.
ARM: SMP: generic SMP spin-table method routines
Define the common code (based on any of the others, but reportedly they all derive from ARM Realview.) Names are changed to be more like arch/arm64/kernel/smp_spin_table.c.

ARM: realview: use central SMP spin-table routines
ARM: vexpress: use central SMP spin-table routines
ARM: versatile: kill off SMP support code
The SMP code for realview and vexpress both use SMP code defined under mach-versatile, so these three go together.

ARM: ux500: use generic SMP spin-table routines
This one is a pretty straightforward switch to using the common code.

ARM: spear: use central SMP spin-table routines
This is straightforward as well, but it depends on the two prerequisite patches mentioned above (which together make this code roughly identical to the rest).

 arch/arm/include/asm/cputype.h                 |    4 ++
 arch/arm/include/asm/smp.h                     |    5 ++
 arch/arm/kernel/head.S                         |   33 +++++++++
 arch/arm/kernel/smp.c                          |   77 ++++++++++++++++++++
 arch/arm/mach-realview/platsmp.c               |    8 +--
 arch/arm/mach-spear/Makefile                   |    2 +-
 arch/arm/mach-spear/generic.h                  |    1 -
 arch/arm/mach-spear/headsmp.S                  |   47 ------------
 arch/arm/mach-spear/platsmp.c                  |   75 +------------------
 arch/arm/mach-ux500/Makefile                   |    2 +-
 arch/arm/mach-ux500/headsmp.S                  |   37 ----------
 arch/arm/mach-ux500/platsmp.c                  |   72 +------------------
 arch/arm/mach-vexpress/platsmp.c               |    8 +--
 arch/arm/mach-vexpress/v2m.c                   |    1 -
 arch/arm/plat-versatile/Makefile               |    1 -
 arch/arm/plat-versatile/headsmp.S              |   41 -----------
 arch/arm/plat-versatile/include/plat/platsmp.h |   14 ----
 arch/arm/plat-versatile/platsmp.c              |   91 ------------------------
 18 files changed, 133 insertions(+), 386 deletions(-)
 delete mode 100644 arch/arm/mach-spear/headsmp.S
 delete mode 100644 arch/arm/mach-ux500/headsmp.S
 delete mode 100644 arch/arm/plat-versatile/headsmp.S
 delete mode 100644 arch/arm/plat-versatile/include/plat/platsmp.h
 delete mode 100644 arch/arm/plat-versatile/platsmp.c
Signature · 1 line
1.7.9.5