hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/arm/mach-spear/platsmp.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * arch/arm/mach-spear13xx/platsmp.c
34 *
....@@ -5,10 +6,6 @@
56 *
67 * Copyright (C) 2012 ST Microelectronics Ltd.
78 * Shiraz Hashim <shiraz.linux.kernel@gmail.com>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License version 2 as
11
- * published by the Free Software Foundation.
129 */
1310
1411 #include <linux/delay.h>
....@@ -20,19 +17,24 @@
2017 #include <mach/spear.h>
2118 #include "generic.h"
2219
20
+/* XXX spear_pen_release is cargo culted code - DO NOT COPY XXX */
21
+volatile int spear_pen_release = -1;
22
+
2323 /*
24
- * Write pen_release in a way that is guaranteed to be visible to all
25
- * observers, irrespective of whether they're taking part in coherency
24
+ * XXX CARGO CULTED CODE - DO NOT COPY XXX
25
+ *
26
+ * Write spear_pen_release in a way that is guaranteed to be visible to
27
+ * all observers, irrespective of whether they're taking part in coherency
2628 * or not. This is necessary for the hotplug code to work reliably.
2729 */
28
-static void write_pen_release(int val)
30
+static void spear_write_pen_release(int val)
2931 {
30
- pen_release = val;
32
+ spear_pen_release = val;
3133 smp_wmb();
32
- sync_cache_w(&pen_release);
34
+ sync_cache_w(&spear_pen_release);
3335 }
3436
35
-static DEFINE_RAW_SPINLOCK(boot_lock);
37
+static DEFINE_SPINLOCK(boot_lock);
3638
3739 static void __iomem *scu_base = IOMEM(VA_SCU_BASE);
3840
....@@ -42,13 +44,13 @@
4244 * let the primary processor know we're out of the
4345 * pen, then head off into the C entry point
4446 */
45
- write_pen_release(-1);
47
+ spear_write_pen_release(-1);
4648
4749 /*
4850 * Synchronise with the boot thread.
4951 */
50
- raw_spin_lock(&boot_lock);
51
- raw_spin_unlock(&boot_lock);
52
+ spin_lock(&boot_lock);
53
+ spin_unlock(&boot_lock);
5254 }
5355
5456 static int spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle)
....@@ -59,22 +61,22 @@
5961 * set synchronisation state between this boot processor
6062 * and the secondary one
6163 */
62
- raw_spin_lock(&boot_lock);
64
+ spin_lock(&boot_lock);
6365
6466 /*
6567 * The secondary processor is waiting to be released from
6668 * the holding pen - release it, then wait for it to flag
67
- * that it has been released by resetting pen_release.
69
+ * that it has been released by resetting spear_pen_release.
6870 *
69
- * Note that "pen_release" is the hardware CPU ID, whereas
71
+ * Note that "spear_pen_release" is the hardware CPU ID, whereas
7072 * "cpu" is Linux's internal ID.
7173 */
72
- write_pen_release(cpu);
74
+ spear_write_pen_release(cpu);
7375
7476 timeout = jiffies + (1 * HZ);
7577 while (time_before(jiffies, timeout)) {
7678 smp_rmb();
77
- if (pen_release == -1)
79
+ if (spear_pen_release == -1)
7880 break;
7981
8082 udelay(10);
....@@ -84,9 +86,9 @@
8486 * now the secondary core is starting up let it run its
8587 * calibrations, then wait for it to finish
8688 */
87
- raw_spin_unlock(&boot_lock);
89
+ spin_unlock(&boot_lock);
8890
89
- return pen_release != -1 ? -ENOSYS : 0;
91
+ return spear_pen_release != -1 ? -ENOSYS : 0;
9092 }
9193
9294 /*