Subject: Re: [PATCH 1/6] powerpc/time: Handle wrapping of decrementer

From: Scott Wood <[email-masked]>
Date: Mon, 28 Nov 2011 11:44:21 -0600

On 11/24/2011 12:07 AM, Anton Blanchard wrote:
> Index: linux-build/arch/powerpc/kernel/irq.c
> ===================================================================
> --- linux-build.orig/arch/powerpc/kernel/irq.c	2011-11-17 10:04:16.551137554 +1100
> +++ linux-build/arch/powerpc/kernel/irq.c	2011-11-17 14:23:10.834514143 +1100
> @@ -164,16 +164,13 @@ notrace void arch_local_irq_restore(unsi
>  	 */
>  	local_paca->hard_enabled = en;
>  
> -#ifndef CONFIG_BOOKE
> -	/* On server, re-trigger the decrementer if it went negative since
> -	 * some processors only trigger on edge transitions of the sign bit.
> -	 *
> -	 * BookE has a level sensitive decrementer (latches in TSR) so we
> -	 * don't need that
> +	/*
> +	 * Trigger the decrementer if we have a pending event. Some processors
> +	 * only trigger on edge transitions of the sign bit. We might also
> +	 * have disabled interrupts long enough that the decrementer wrapped
> +	 * to positive.
>  	 */
> -	if ((int)mfspr(SPRN_DEC) < 0)
> -		mtspr(SPRN_DEC, 1);
> -#endif /* CONFIG_BOOKE */
> +	decrementer_check_overflow();

Where did the #ifndef CONFIG_BOOKE go?  BookE doesn't need this; the
interrupt will continue asserting until software clears TSR[DIS].

-Scott