Subject: Re: [PATCH] powerpc: check_and_cede_processor never cedes

From: Benjamin Herrenschmidt <[email-masked]>
Date: Thu, 28 Jun 2012 08:51:19 +1000

On Thu, 2012-06-28 at 08:45 +1000, Anton Blanchard wrote:
>  	hard_irq_disable();
> -	if (get_paca()->irq_happened == 0)
> +	if (get_paca()->irq_happened == PACA_IRQ_HARD_DIS)
>  		cede_processor();

I'd rather add a helper, something like lazy_irq_pending()
and hide the actual check for the bits in irq_happened, in
case we change the scheme again.

Something like:

static inline bool lazy_irq_pending(void)
{
	return !!(get_paca()->irq_happened & ~PACA_IRQ_HARD_DIS);
}

Cheers,
Ben.