| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * SMP support for Hexagon |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License version 2 and |
|---|
| 8 | | - * only version 2 as published by the Free Software Foundation. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 | | - * GNU General Public License for more details. |
|---|
| 14 | | - * |
|---|
| 15 | | - * You should have received a copy of the GNU General Public License |
|---|
| 16 | | - * along with this program; if not, write to the Free Software |
|---|
| 17 | | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|---|
| 18 | | - * 02110-1301, USA. |
|---|
| 19 | 6 | */ |
|---|
| 20 | 7 | |
|---|
| 21 | 8 | #include <linux/err.h> |
|---|
| .. | .. |
|---|
| 127 | 114 | local_irq_restore(flags); |
|---|
| 128 | 115 | } |
|---|
| 129 | 116 | |
|---|
| 130 | | -static struct irqaction ipi_intdesc = { |
|---|
| 131 | | - .handler = handle_ipi, |
|---|
| 132 | | - .flags = IRQF_TRIGGER_RISING, |
|---|
| 133 | | - .name = "ipi_handler" |
|---|
| 134 | | -}; |
|---|
| 135 | | - |
|---|
| 136 | 117 | void __init smp_prepare_boot_cpu(void) |
|---|
| 137 | 118 | { |
|---|
| 138 | 119 | } |
|---|
| .. | .. |
|---|
| 145 | 126 | |
|---|
| 146 | 127 | void start_secondary(void) |
|---|
| 147 | 128 | { |
|---|
| 148 | | - unsigned int cpu; |
|---|
| 149 | 129 | unsigned long thread_ptr; |
|---|
| 130 | + unsigned int cpu, irq; |
|---|
| 150 | 131 | |
|---|
| 151 | 132 | /* Calculate thread_info pointer from stack pointer */ |
|---|
| 152 | 133 | __asm__ __volatile__( |
|---|
| .. | .. |
|---|
| 168 | 149 | |
|---|
| 169 | 150 | cpu = smp_processor_id(); |
|---|
| 170 | 151 | |
|---|
| 171 | | - setup_irq(BASE_IPI_IRQ + cpu, &ipi_intdesc); |
|---|
| 152 | + irq = BASE_IPI_IRQ + cpu; |
|---|
| 153 | + if (request_irq(irq, handle_ipi, IRQF_TRIGGER_RISING, "ipi_handler", |
|---|
| 154 | + NULL)) |
|---|
| 155 | + pr_err("Failed to request irq %u (ipi_handler)\n", irq); |
|---|
| 172 | 156 | |
|---|
| 173 | 157 | /* Register the clock_event dummy */ |
|---|
| 174 | 158 | setup_percpu_clockdev(); |
|---|
| .. | .. |
|---|
| 214 | 198 | |
|---|
| 215 | 199 | void __init smp_prepare_cpus(unsigned int max_cpus) |
|---|
| 216 | 200 | { |
|---|
| 217 | | - int i; |
|---|
| 201 | + int i, irq = BASE_IPI_IRQ; |
|---|
| 218 | 202 | |
|---|
| 219 | 203 | /* |
|---|
| 220 | 204 | * should eventually have some sort of machine |
|---|
| .. | .. |
|---|
| 226 | 210 | set_cpu_present(i, true); |
|---|
| 227 | 211 | |
|---|
| 228 | 212 | /* Also need to register the interrupts for IPI */ |
|---|
| 229 | | - if (max_cpus > 1) |
|---|
| 230 | | - setup_irq(BASE_IPI_IRQ, &ipi_intdesc); |
|---|
| 213 | + if (max_cpus > 1) { |
|---|
| 214 | + if (request_irq(irq, handle_ipi, IRQF_TRIGGER_RISING, |
|---|
| 215 | + "ipi_handler", NULL)) |
|---|
| 216 | + pr_err("Failed to request irq %d (ipi_handler)\n", irq); |
|---|
| 217 | + } |
|---|
| 231 | 218 | } |
|---|
| 232 | 219 | |
|---|
| 233 | 220 | void smp_send_reschedule(int cpu) |
|---|