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>
This commit is contained in:

committed by
Geert Uytterhoeven

parent
c7ff87409d
commit
3cd53b14e7
@@ -127,12 +127,9 @@
|
|||||||
|
|
||||||
#define SHUTUP_SONIC
|
#define SHUTUP_SONIC
|
||||||
|
|
||||||
/*
|
extern void show_registers(struct pt_regs *);
|
||||||
* console_loglevel determines NMI handler function
|
|
||||||
*/
|
|
||||||
|
|
||||||
irqreturn_t mac_nmi_handler(int, void *);
|
irqreturn_t mac_nmi_handler(int, void *);
|
||||||
irqreturn_t mac_debug_handler(int, void *);
|
|
||||||
|
|
||||||
/* #define DEBUG_MACINTS */
|
/* #define DEBUG_MACINTS */
|
||||||
|
|
||||||
@@ -276,65 +273,17 @@ static void mac_irq_shutdown(struct irq_data *data)
|
|||||||
mac_irq_disable(data);
|
mac_irq_disable(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int num_debug[8];
|
static volatile int in_nmi;
|
||||||
|
|
||||||
irqreturn_t mac_debug_handler(int irq, void *dev_id)
|
|
||||||
{
|
|
||||||
if (num_debug[irq] < 10) {
|
|
||||||
printk("DEBUG: Unexpected IRQ %d\n", irq);
|
|
||||||
num_debug[irq]++;
|
|
||||||
}
|
|
||||||
return IRQ_HANDLED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int in_nmi;
|
|
||||||
static volatile int nmi_hold;
|
|
||||||
|
|
||||||
irqreturn_t mac_nmi_handler(int irq, void *dev_id)
|
irqreturn_t mac_nmi_handler(int irq, void *dev_id)
|
||||||
{
|
{
|
||||||
int i;
|
if (in_nmi)
|
||||||
/*
|
return IRQ_HANDLED;
|
||||||
* generate debug output on NMI switch if 'debug' kernel option given
|
in_nmi = 1;
|
||||||
* (only works with Penguin!)
|
|
||||||
*/
|
|
||||||
|
|
||||||
in_nmi++;
|
pr_info("Non-Maskable Interrupt\n");
|
||||||
for (i=0; i<100; i++)
|
show_registers(get_irq_regs());
|
||||||
udelay(1000);
|
|
||||||
|
|
||||||
if (in_nmi == 1) {
|
in_nmi = 0;
|
||||||
nmi_hold = 1;
|
|
||||||
printk("... pausing, press NMI to resume ...");
|
|
||||||
} else {
|
|
||||||
printk(" ok!\n");
|
|
||||||
nmi_hold = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
barrier();
|
|
||||||
|
|
||||||
while (nmi_hold == 1)
|
|
||||||
udelay(1000);
|
|
||||||
|
|
||||||
if (console_loglevel >= 8) {
|
|
||||||
#if 0
|
|
||||||
struct pt_regs *fp = get_irq_regs();
|
|
||||||
show_state();
|
|
||||||
printk("PC: %08lx\nSR: %04x SP: %p\n", fp->pc, fp->sr, fp);
|
|
||||||
printk("d0: %08lx d1: %08lx d2: %08lx d3: %08lx\n",
|
|
||||||
fp->d0, fp->d1, fp->d2, fp->d3);
|
|
||||||
printk("d4: %08lx d5: %08lx a0: %08lx a1: %08lx\n",
|
|
||||||
fp->d4, fp->d5, fp->a0, fp->a1);
|
|
||||||
|
|
||||||
if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page)
|
|
||||||
printk("Corrupted stack page\n");
|
|
||||||
printk("Process %s (pid: %d, stackpage=%08lx)\n",
|
|
||||||
current->comm, current->pid, current->kernel_stack_page);
|
|
||||||
if (intr_count == 1)
|
|
||||||
dump_stack((struct frame *)fp);
|
|
||||||
#else
|
|
||||||
/* printk("NMI "); */
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
in_nmi--;
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user