[2/3] ARM: exynos: Simplify code in Exynos3250 CPU core restart path

Message ID 20190322114833.12686-3-m.szyprowski@samsung.com
State New
Headers show
Series
  • Little cleanup of mach-exynos code
Related show

Commit Message

Marek Szyprowski March 22, 2019, 11:48 a.m.
exynos_core_restart() is called by secondary CPU boot procedure, used by
CPU hotplug. Replace of_machine_is_compatible() call with a simple SoC
revision check.

of_machine_is_compatible() function performs a dozen of string comparisons
during the full device tree walk, while soc_is_exynos3250() is a simple
integer check on SoC revision variable.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

---
 arch/arm/mach-exynos/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.17.1

Comments

Krzysztof Kozlowski March 22, 2019, 1:10 p.m. | #1
On Fri, 22 Mar 2019 at 12:48, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>

> exynos_core_restart() is called by secondary CPU boot procedure, used by

> CPU hotplug. Replace of_machine_is_compatible() call with a simple SoC

> revision check.

>

> of_machine_is_compatible() function performs a dozen of string comparisons

> during the full device tree walk, while soc_is_exynos3250() is a simple

> integer check on SoC revision variable.


Yes but it is against the effort of getting rid of all soc_is_() (see
https://patchwork.kernel.org/project/linux-samsung-soc/list/?series=43565&state=*
). It also makes this code sticky to mach - we cannot move it to
drivers. See also Arnd's opinion:
https://marc.info/?l=devicetree&m=139291569126848&w=2

Did you measure the practical performance impact of this change?

Best regards,
Krzysztof

> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

> ---

>  arch/arm/mach-exynos/platsmp.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c

> index 65da13923b8f..d5d48fbdab17 100644

> --- a/arch/arm/mach-exynos/platsmp.c

> +++ b/arch/arm/mach-exynos/platsmp.c

> @@ -216,7 +216,7 @@ void exynos_core_restart(u32 core_id)

>  {

>         u32 val;

>

> -       if (!of_machine_is_compatible("samsung,exynos3250"))

> +       if (!soc_is_exynos3250())

>                 return;

>

>         while (!pmu_raw_readl(S5P_PMU_SPARE2))

> --

> 2.17.1

>

Patch

diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index 65da13923b8f..d5d48fbdab17 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -216,7 +216,7 @@  void exynos_core_restart(u32 core_id)
 {
 	u32 val;
 
-	if (!of_machine_is_compatible("samsung,exynos3250"))
+	if (!soc_is_exynos3250())
 		return;
 
 	while (!pmu_raw_readl(S5P_PMU_SPARE2))