diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2017-01-02 04:53:54 -0500 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2017-02-09 08:18:18 -0500 |
commit | 3cd53b14e7c471f6c33f3645a5200a30ffb3f861 (patch) | |
tree | f5038c70766b95fb4b018a1ee01ab8b04d2c3adb | |
parent | c7ff87409d1a1b87d5a0ea7149416071dc8332cb (diff) |
m68k/mac: Improve NMI handler
mac_nmi_handler() is useless in its present form and locks up my PowerBook
180. Let's throw out the dead code and make it do something useful: print
a register dump and a stack trace.
mac_debug_handler() is also dead code. Remove it along with its static
data.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
-rw-r--r-- | arch/m68k/mac/macints.c | 67 |
1 files changed, 8 insertions, 59 deletions
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index 9f98c0871901..f9672bbd566f 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c | |||
@@ -127,12 +127,9 @@ | |||
127 | 127 | ||
128 | #define SHUTUP_SONIC | 128 | #define SHUTUP_SONIC |
129 | 129 | ||
130 | /* | 130 | extern void show_registers(struct pt_regs *); |
131 | * console_loglevel determines NMI handler function | ||
132 | */ | ||
133 | 131 | ||
134 | irqreturn_t mac_nmi_handler(int, void *); | 132 | irqreturn_t mac_nmi_handler(int, void *); |
135 | irqreturn_t mac_debug_handler(int, void *); | ||
136 | 133 | ||
137 | /* #define DEBUG_MACINTS */ | 134 | /* #define DEBUG_MACINTS */ |
138 | 135 | ||
@@ -276,65 +273,17 @@ static void mac_irq_shutdown(struct irq_data *data) | |||
276 | mac_irq_disable(data); | 273 | mac_irq_disable(data); |
277 | } | 274 | } |
278 | 275 | ||
279 | static int num_debug[8]; | 276 | static volatile int in_nmi; |
280 | |||
281 | irqreturn_t mac_debug_handler(int irq, void *dev_id) | ||
282 | { | ||
283 | if (num_debug[irq] < 10) { | ||
284 | printk("DEBUG: Unexpected IRQ %d\n", irq); | ||
285 | num_debug[irq]++; | ||
286 | } | ||
287 | return IRQ_HANDLED; | ||
288 | } | ||
289 | |||
290 | static int in_nmi; | ||
291 | static volatile int nmi_hold; | ||
292 | 277 | ||
293 | irqreturn_t mac_nmi_handler(int irq, void *dev_id) | 278 | irqreturn_t mac_nmi_handler(int irq, void *dev_id) |
294 | { | 279 | { |
295 | int i; | 280 | if (in_nmi) |
296 | /* | 281 | return IRQ_HANDLED; |
297 | * generate debug output on NMI switch if 'debug' kernel option given | 282 | in_nmi = 1; |
298 | * (only works with Penguin!) | ||
299 | */ | ||
300 | |||
301 | in_nmi++; | ||
302 | for (i=0; i<100; i++) | ||
303 | udelay(1000); | ||
304 | |||
305 | if (in_nmi == 1) { | ||
306 | nmi_hold = 1; | ||
307 | printk("... pausing, press NMI to resume ..."); | ||
308 | } else { | ||
309 | printk(" ok!\n"); | ||
310 | nmi_hold = 0; | ||
311 | } | ||
312 | 283 | ||
313 | barrier(); | 284 | pr_info("Non-Maskable Interrupt\n"); |
285 | show_registers(get_irq_regs()); | ||
314 | 286 | ||
315 | while (nmi_hold == 1) | 287 | in_nmi = 0; |
316 | udelay(1000); | ||
317 | |||
318 | if (console_loglevel >= 8) { | ||
319 | #if 0 | ||
320 | struct pt_regs *fp = get_irq_regs(); | ||
321 | show_state(); | ||
322 | printk("PC: %08lx\nSR: %04x SP: %p\n", fp->pc, fp->sr, fp); | ||
323 | printk("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n", | ||
324 | fp->d0, fp->d1, fp->d2, fp->d3); | ||
325 | printk("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n", | ||
326 | fp->d4, fp->d5, fp->a0, fp->a1); | ||
327 | |||
328 | if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page) | ||
329 | printk("Corrupted stack page\n"); | ||
330 | printk("Process %s (pid: %d, stackpage=%08lx)\n", | ||
331 | current->comm, current->pid, current->kernel_stack_page); | ||
332 | if (intr_count == 1) | ||
333 | dump_stack((struct frame *)fp); | ||
334 | #else | ||
335 | /* printk("NMI "); */ | ||
336 | #endif | ||
337 | } | ||
338 | in_nmi--; | ||
339 | return IRQ_HANDLED; | 288 | return IRQ_HANDLED; |
340 | } | 289 | } |