在 2010-01-20三的 07:46 -0500,Mike Frysinger写道:
> On Wed, Jan 20, 2010 at 05:56, <[email protected]> wrote:
> > Modified: trunk/arch/blackfin/Kconfig (8203 => 8204)
> >
> > @@ -661,7 +661,7 @@
> >
> > choice
> > prompt "Blackfin Exception Scratch Register"
> > - default BFIN_SCRATCH_REG_RETN
> > + default BFIN_SCRATCH_REG_RETE
>
> uhh, no. you just broke compatibility with JTAG ICEs in default configs.
>
> > Modified: trunk/arch/blackfin/Kconfig.debug (8203 => 8204)
> >
> > @@ -238,6 +238,17 @@
> > all of this lives in the init section and is thrown away after the
> > kernel boots completely.
> >
> > +config NMI_WATCHDOG
> > + bool "Enable NMI watchdog to help debuging lockup on SMP"
> > + default n
> > + depends on SMP
> > + help
> > + if any CPU in the system does not execute the period local timer
> > + interrupt for more than 5 seconds, then the NMI handler dumps debug
> > + information. This information can be used to debug the lockup.
> > +
> > + Note: this feature means can not select BFIN_SCRATCH_REG_RETN
>
> so use Kconfig dependency: depends !BFIN_SCRATCH_REG_RETN
OK.
>
> > Added: trunk/arch/blackfin/kernel/nmi.c (0 => 8204)
> >
> > +/* Bit in WDOG_CTL that indicates watchdog has expired (WDR0) */
> > +#define WDOG_EXPIRED 0x8000
> > +
> > +/* Masks for WDEV field in WDOG_CTL register */
> > +#define ICTL_RESET 0x0
> > +#define ICTL_NMI 0x2
> > +#define ICTL_GPI 0x4
> > +#define ICTL_NONE 0x6
> > +#define ICTL_MASK 0x6
> > +
> > +/* Masks for WDEN field in WDOG_CTL register */
> > +#define WDEN_MASK 0x0FF0
> > +#define WDEN_ENABLE 0x0000
> > +#define WDEN_DISABLE 0x0AD0
>
> these really need to be merged with the bfin-wdt into say asm/bfin_watchdog.h
Agree, I will merge it later.
>
> > +static int nmi_wdt_set_timeout(unsigned long t)
> > +{
> > + u32 cnt;
> > + int run;
> > +
> > + cnt = t * get_sclk();
> > + if (cnt < get_sclk()) {
>
> cache the sclk value locally so we dont call get_sclk() twice
OK.
>
> > + printk(KERN_WARNING "NMI: timeout value is too large\n");
>
> pr_warning()
>
> > +static int __init init_nmi_wdt(void)
> > +{
> > + nmi_wdt_set_timeout(timeout);
> > + nmi_wdt_start();
> > + nmi_active = true;
> > + printk(KERN_INFO "nmi_wdt: initialized: timeout=%d sec\n", timeout);
>
> pr_info
>
> > +asmlinkage notrace void do_nmi(struct pt_regs *fp)
>
> if this guy is labeled notrace, are all the functions it calls notrace
> too ? seems like printk() and such wont be ...
I have inlined most of the called functions, except the printk.
I don't know how to deal with it...
Anyway, if the NMI occured, the system can not be recovered.
-Graff
>
> > + printk(KERN_EMERG "NMI Watchdog detected LOCKUP, dump for CPU %d\n",
> > + smp_processor_id());
>
> pr_emerg() and you've already got smp_processor_id() in the local cpu var
>
> > + show_stack(current, (unsigned long *)fp);
> > + printk(KERN_EMERG "\n\n");
>
> pr_emerg()
>
> > Modified: trunk/arch/blackfin/mach-common/interrupt.S (8203 => 8204)
> >
> > + /* Turn caches off, to ensure we don't get double exceptions */
> > + P4.L = LO(IMEM_CONTROL);
> > + P4.H = HI(IMEM_CONTROL);
> > + R5 = [P4];
> > + [--SP] = R5;
> > + BITCLR(R5,ENICPLB_P);
> > + CSYNC;
> > + [P4] = R5;
> > + SSYNC;
> > +
> > + P4.L = LO(DMEM_CONTROL);
> > + P4.H = HI(DMEM_CONTROL);
> > + R5 = [P4];
>
> load COREMMR_BASE into P4.H, then you can do:
> R5 = [P4 + (DMEM_CONTROL - COREMMR_BASE)];
>
> > + [--SP] = R5;
> > + BITCLR(R5,ENDCPLB_P);
> > + CSYNC;
> > + [P4] = R5;
> > + SSYNC;
> > +
> > + SP += -12;
> > + call _do_nmi;
> > + SP += 12;
> > +
> > + R5 = [SP++];
> > + P4.L = LO(DMEM_CONTROL);
> > + P4.H = HI(DMEM_CONTROL);
>
> if you use preserved registers, you dont need to reload the pointers
> (P4/R5/etc...) across the function call as the C ABI will take care of
> it
> -mike
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits