| .. | .. |
|---|
| 61 | 61 | |
|---|
| 62 | 62 | static void __iomem *sysctrl, *fabric; |
|---|
| 63 | 63 | 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); |
|---|
| 65 | 65 | static u32 fabric_phys_addr; |
|---|
| 66 | 66 | /* |
|---|
| 67 | 67 | * [0]: bootwrapper physical address |
|---|
| .. | .. |
|---|
| 113 | 113 | if (cluster >= HIP04_MAX_CLUSTERS || cpu >= HIP04_MAX_CPUS_PER_CLUSTER) |
|---|
| 114 | 114 | return -EINVAL; |
|---|
| 115 | 115 | |
|---|
| 116 | | - spin_lock_irq(&boot_lock); |
|---|
| 116 | + raw_spin_lock_irq(&boot_lock); |
|---|
| 117 | 117 | |
|---|
| 118 | 118 | if (hip04_cpu_table[cluster][cpu]) |
|---|
| 119 | 119 | goto out; |
|---|
| .. | .. |
|---|
| 147 | 147 | |
|---|
| 148 | 148 | out: |
|---|
| 149 | 149 | hip04_cpu_table[cluster][cpu]++; |
|---|
| 150 | | - spin_unlock_irq(&boot_lock); |
|---|
| 150 | + raw_spin_unlock_irq(&boot_lock); |
|---|
| 151 | 151 | |
|---|
| 152 | 152 | return 0; |
|---|
| 153 | 153 | } |
|---|
| .. | .. |
|---|
| 162 | 162 | cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); |
|---|
| 163 | 163 | cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); |
|---|
| 164 | 164 | |
|---|
| 165 | | - spin_lock(&boot_lock); |
|---|
| 165 | + raw_spin_lock(&boot_lock); |
|---|
| 166 | 166 | hip04_cpu_table[cluster][cpu]--; |
|---|
| 167 | 167 | if (hip04_cpu_table[cluster][cpu] == 1) { |
|---|
| 168 | 168 | /* A power_up request went ahead of us. */ |
|---|
| 169 | | - spin_unlock(&boot_lock); |
|---|
| 169 | + raw_spin_unlock(&boot_lock); |
|---|
| 170 | 170 | return; |
|---|
| 171 | 171 | } else if (hip04_cpu_table[cluster][cpu] > 1) { |
|---|
| 172 | 172 | pr_err("Cluster %d CPU%d boots multiple times\n", cluster, cpu); |
|---|
| .. | .. |
|---|
| 174 | 174 | } |
|---|
| 175 | 175 | |
|---|
| 176 | 176 | last_man = hip04_cluster_is_down(cluster); |
|---|
| 177 | | - spin_unlock(&boot_lock); |
|---|
| 177 | + raw_spin_unlock(&boot_lock); |
|---|
| 178 | 178 | if (last_man) { |
|---|
| 179 | 179 | /* Since it's Cortex A15, disable L2 prefetching. */ |
|---|
| 180 | 180 | asm volatile( |
|---|
| .. | .. |
|---|
| 203 | 203 | cpu >= HIP04_MAX_CPUS_PER_CLUSTER); |
|---|
| 204 | 204 | |
|---|
| 205 | 205 | count = TIMEOUT_MSEC / POLL_MSEC; |
|---|
| 206 | | - spin_lock_irq(&boot_lock); |
|---|
| 206 | + raw_spin_lock_irq(&boot_lock); |
|---|
| 207 | 207 | for (tries = 0; tries < count; tries++) { |
|---|
| 208 | 208 | if (hip04_cpu_table[cluster][cpu]) |
|---|
| 209 | 209 | goto err; |
|---|
| .. | .. |
|---|
| 211 | 211 | data = readl_relaxed(sysctrl + SC_CPU_RESET_STATUS(cluster)); |
|---|
| 212 | 212 | if (data & CORE_WFI_STATUS(cpu)) |
|---|
| 213 | 213 | break; |
|---|
| 214 | | - spin_unlock_irq(&boot_lock); |
|---|
| 214 | + raw_spin_unlock_irq(&boot_lock); |
|---|
| 215 | 215 | /* Wait for clean L2 when the whole cluster is down. */ |
|---|
| 216 | 216 | msleep(POLL_MSEC); |
|---|
| 217 | | - spin_lock_irq(&boot_lock); |
|---|
| 217 | + raw_spin_lock_irq(&boot_lock); |
|---|
| 218 | 218 | } |
|---|
| 219 | 219 | if (tries >= count) |
|---|
| 220 | 220 | goto err; |
|---|
| .. | .. |
|---|
| 231 | 231 | goto err; |
|---|
| 232 | 232 | if (hip04_cluster_is_down(cluster)) |
|---|
| 233 | 233 | hip04_set_snoop_filter(cluster, 0); |
|---|
| 234 | | - spin_unlock_irq(&boot_lock); |
|---|
| 234 | + raw_spin_unlock_irq(&boot_lock); |
|---|
| 235 | 235 | return 1; |
|---|
| 236 | 236 | err: |
|---|
| 237 | | - spin_unlock_irq(&boot_lock); |
|---|
| 237 | + raw_spin_unlock_irq(&boot_lock); |
|---|
| 238 | 238 | return 0; |
|---|
| 239 | 239 | } |
|---|
| 240 | 240 | #endif |
|---|