Re: [PATCH v2] powerpc: fix suspend states again

Paul Mackerras
2007-04-30T00:14:11Z

Johannes Berg writes:

> +void save_processor_state(void)
> +{
> + /* Giveup the lazy FPU & vec so we don't have to back them
> + * up from the low level code
> + */
> + enable_kernel_fp();
> +
> +#ifdef CONFIG_ALTIVEC
> + if (cur_cpu_spec->cpu_features & CPU_FTR_ALTIVEC)
> + enable_kernel_altivec();
> +#endif /* CONFIG_ALTIVEC */
> +
> +#ifdef CONFIG_SPE
> + enable_kernel_spe();
> +#endif
> +}

This achieves essentially the same effect as prepare_to_copy() in
arch/powerpc/kernel/process.c, except that we don't end up with fp,
altivec and/or spe enabled - but that's OK since the following code
doesn't actually need fp/altivec/spe.

It would be good to avoid this duplication, or at least to use the
flush_* calls instead of the enable_kernel_* calls.

Paul.