hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/hexagon/kernel/smp.c
....@@ -1,21 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * SMP support for Hexagon
34 *
45 * 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.
196 */
207
218 #include <linux/err.h>
....@@ -127,12 +114,6 @@
127114 local_irq_restore(flags);
128115 }
129116
130
-static struct irqaction ipi_intdesc = {
131
- .handler = handle_ipi,
132
- .flags = IRQF_TRIGGER_RISING,
133
- .name = "ipi_handler"
134
-};
135
-
136117 void __init smp_prepare_boot_cpu(void)
137118 {
138119 }
....@@ -145,8 +126,8 @@
145126
146127 void start_secondary(void)
147128 {
148
- unsigned int cpu;
149129 unsigned long thread_ptr;
130
+ unsigned int cpu, irq;
150131
151132 /* Calculate thread_info pointer from stack pointer */
152133 __asm__ __volatile__(
....@@ -168,7 +149,10 @@
168149
169150 cpu = smp_processor_id();
170151
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);
172156
173157 /* Register the clock_event dummy */
174158 setup_percpu_clockdev();
....@@ -214,7 +198,7 @@
214198
215199 void __init smp_prepare_cpus(unsigned int max_cpus)
216200 {
217
- int i;
201
+ int i, irq = BASE_IPI_IRQ;
218202
219203 /*
220204 * should eventually have some sort of machine
....@@ -226,8 +210,11 @@
226210 set_cpu_present(i, true);
227211
228212 /* 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
+ }
231218 }
232219
233220 void smp_send_reschedule(int cpu)