hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/arch/arm/mach-hisi/platmcpm.c
....@@ -61,7 +61,7 @@
6161
6262 static void __iomem *sysctrl, *fabric;
6363 static int hip04_cpu_table[HIP04_MAX_CLUSTERS][HIP04_MAX_CPUS_PER_CLUSTER];
64
-static DEFINE_SPINLOCK(boot_lock);
64
+static DEFINE_RAW_SPINLOCK(boot_lock);
6565 static u32 fabric_phys_addr;
6666 /*
6767 * [0]: bootwrapper physical address
....@@ -113,7 +113,7 @@
113113 if (cluster >= HIP04_MAX_CLUSTERS || cpu >= HIP04_MAX_CPUS_PER_CLUSTER)
114114 return -EINVAL;
115115
116
- spin_lock_irq(&boot_lock);
116
+ raw_spin_lock_irq(&boot_lock);
117117
118118 if (hip04_cpu_table[cluster][cpu])
119119 goto out;
....@@ -147,7 +147,7 @@
147147
148148 out:
149149 hip04_cpu_table[cluster][cpu]++;
150
- spin_unlock_irq(&boot_lock);
150
+ raw_spin_unlock_irq(&boot_lock);
151151
152152 return 0;
153153 }
....@@ -162,11 +162,11 @@
162162 cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
163163 cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
164164
165
- spin_lock(&boot_lock);
165
+ raw_spin_lock(&boot_lock);
166166 hip04_cpu_table[cluster][cpu]--;
167167 if (hip04_cpu_table[cluster][cpu] == 1) {
168168 /* A power_up request went ahead of us. */
169
- spin_unlock(&boot_lock);
169
+ raw_spin_unlock(&boot_lock);
170170 return;
171171 } else if (hip04_cpu_table[cluster][cpu] > 1) {
172172 pr_err("Cluster %d CPU%d boots multiple times\n", cluster, cpu);
....@@ -174,7 +174,7 @@
174174 }
175175
176176 last_man = hip04_cluster_is_down(cluster);
177
- spin_unlock(&boot_lock);
177
+ raw_spin_unlock(&boot_lock);
178178 if (last_man) {
179179 /* Since it's Cortex A15, disable L2 prefetching. */
180180 asm volatile(
....@@ -203,7 +203,7 @@
203203 cpu >= HIP04_MAX_CPUS_PER_CLUSTER);
204204
205205 count = TIMEOUT_MSEC / POLL_MSEC;
206
- spin_lock_irq(&boot_lock);
206
+ raw_spin_lock_irq(&boot_lock);
207207 for (tries = 0; tries < count; tries++) {
208208 if (hip04_cpu_table[cluster][cpu])
209209 goto err;
....@@ -211,10 +211,10 @@
211211 data = readl_relaxed(sysctrl + SC_CPU_RESET_STATUS(cluster));
212212 if (data & CORE_WFI_STATUS(cpu))
213213 break;
214
- spin_unlock_irq(&boot_lock);
214
+ raw_spin_unlock_irq(&boot_lock);
215215 /* Wait for clean L2 when the whole cluster is down. */
216216 msleep(POLL_MSEC);
217
- spin_lock_irq(&boot_lock);
217
+ raw_spin_lock_irq(&boot_lock);
218218 }
219219 if (tries >= count)
220220 goto err;
....@@ -231,10 +231,10 @@
231231 goto err;
232232 if (hip04_cluster_is_down(cluster))
233233 hip04_set_snoop_filter(cluster, 0);
234
- spin_unlock_irq(&boot_lock);
234
+ raw_spin_unlock_irq(&boot_lock);
235235 return 1;
236236 err:
237
- spin_unlock_irq(&boot_lock);
237
+ raw_spin_unlock_irq(&boot_lock);
238238 return 0;
239239 }
240240 #endif