[PATCH v3] fix multiple bugs in rtas_ibm_suspend_me code

Nathan Lynch ntl at pobox.com
Wed Nov 14 03:25:22 EST 2007


Nathan Lynch wrote:
> 
> 3.) H_JOIN must be called with MSR[EE] off, but lazy interrupt
> disabling may cause the caller of rtas_ibm_suspend_me to call H_JOIN
> with it on; the local_irq_disable() in on_each_cpu() is not
> sufficient.
> 
> Fix this by explicitly saving the MSR and clearing the EE bit before
> calling H_JOIN.

...

> +	atomic_inc(&data->working);
> +
> +	/* really need to ensure MSR.EE is off for H_JOIN */
> +	msr_save = mfmsr();
> +	mtmsr(msr_save & ~(MSR_EE));
> +
> +	rc = plpar_hcall_norets(H_JOIN);
> +
> +	mtmsr(msr_save);

BTW, I'm wondering if this is the right way to do this.  I think
there's the possibility that we could enter this routine hard-enabled
and take take an interrupt between the mfmsr and the first mtmsr, but
I haven't worked out all the implications.  Would hard_irq_disable be
better?



More information about the Linuxppc-dev mailing list