From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] PPC: Enable the Watchdog vector for 405
Date: Thu, 04 Oct 2012 21:05:56 +1000 [thread overview]
Message-ID: <1349348756.4260.15.camel@pasglop> (raw)
In-Reply-To: <20120930232723.GF30637@obsidianresearch.com>
On Sun, 2012-09-30 at 17:27 -0600, Jason Gunthorpe wrote:
> diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S
> index 4989661..7edd7b1 100644
> --- a/arch/powerpc/kernel/head_40x.S
> +++ b/arch/powerpc/kernel/head_40x.S
> @@ -431,29 +431,19 @@ label:
>
> /* 0x1000 - Programmable Interval Timer (PIT) Exception */
> START_EXCEPTION(0x1000, Decrementer)
> - NORMAL_EXCEPTION_PROLOG
> - lis r0,TSR_PIS@h
> - mtspr SPRN_TSR,r0 /* Clear the PIT exception */
> - addi r3,r1,STACK_FRAME_OVERHEAD
> - EXC_XFER_LITE(0x1000, timer_interrupt)
> + b pit_longer
Looks like you indeed have no choice but move it down, though I dislike
the label name :-)
Look at how we do a similar thing in exceptions-64.S, we basically just
don't use START_EXCEPTION at that location. We put a .=xxxx and a
branch, and use the real exception name at the target label.
Or just name it "pit_exception" if you want to keep things simple. I
just don't like "pit_longer" :-)
> -#if 0
> /* NOTE:
> - * FIT and WDT handlers are not implemented yet.
> + * FIT handler is not implemented yet.
> */
Any reason to comment that out ? Better off also branching out of line
to a stub similar to the PIT one that then calls unknown_exception. That
way if it triggers by accident, you'll get a clean trace.
> /* 0x1010 - Fixed Interval Timer (FIT) Exception
> */
> - STND_EXCEPTION(0x1010, FITException, unknown_exception)
> +// STND_EXCEPTION(0x1010, FITException, unknown_exception)
>
> /* 0x1020 - Watchdog Timer (WDT) Exception
> */
> -#ifdef CONFIG_BOOKE_WDT
> CRITICAL_EXCEPTION(0x1020, WDTException, WatchdogException)
> -#else
> - CRITICAL_EXCEPTION(0x1020, WDTException, unknown_exception)
> -#endif
> -#endif
Move it out of line too please. When a given vector "slot" gets crowded,
I prefer moving everything in it out of line to keep things consistent.
> /* 0x1100 - Data TLB Miss Exception
> * As the name implies, translation is not in the MMU, so search the
> @@ -738,6 +728,16 @@ label:
> (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
> NOCOPY, crit_transfer_to_handler, ret_from_crit_exc)
>
> + /* Programmable Interval Timer (PIT) Exception. The PIT runs into
> + the space reserved for other exceptions, so we branch down
> + to here. */
> +pit_longer:
> + NORMAL_EXCEPTION_PROLOG
> + lis r0,TSR_PIS@h
> + mtspr SPRN_TSR,r0 /* Clear the PIT exception */
> + addi r3,r1,STACK_FRAME_OVERHEAD
> + EXC_XFER_LITE(0x1000, timer_interrupt)
> +
> /*
> * The other Data TLB exceptions bail out to this point
> * if they can't resolve the lightweight TLB fault.
> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
> index ae0843f..0701ec1 100644
> --- a/arch/powerpc/kernel/traps.c
> +++ b/arch/powerpc/kernel/traps.c
> @@ -1514,7 +1514,7 @@ void unrecoverable_exception(struct pt_regs *regs)
> die("Unrecoverable exception", regs, SIGABRT);
> }
>
> -#ifdef CONFIG_BOOKE_WDT
> +#if defined(CONFIG_BOOKE_WDT) | defined(CONFIG_40x)
> /*
> * Default handler for a Watchdog exception,
> * spins until a reboot occurs
Cheers,
Ben.
next prev parent reply other threads:[~2012-10-04 11:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-30 23:27 [PATCH] PPC: Enable the Watchdog vector for 405 Jason Gunthorpe
2012-10-01 12:16 ` Josh Boyer
2012-10-01 16:25 ` Jason Gunthorpe
2012-10-01 17:32 ` Josh Boyer
2012-10-01 17:48 ` Jason Gunthorpe
2012-10-04 11:05 ` Benjamin Herrenschmidt [this message]
2012-10-05 18:07 ` [PATCHv2] " Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1349348756.4260.15.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=jgunthorpe@obsidianresearch.com \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.