Re: [PATCH v2 1/6] irqchip: mips-gic: Add context saving for MIPS_REMOTEPROC

From: Thomas Gleixner
Date: Tue Sep 20 2016 - 05:42:57 EST


On Tue, 20 Sep 2016, Matt Redfearn wrote:
> +/*
> + * The MIPS remote processor driver allows non-Linux firmware to take control
> + * of and execute on one of the systems VPEs. If that VPE is brought back under
> + * Linux, it is necessary to ensure that all GIC interrupts are routed and
> + * masked as Linux expects them, as the firmware can have done anything it
> + * likes with the GIC configuration (hopefully just for that VPEs local
> + * interrupt sources, but allow for shared external interrupts as well).
> + */
> +static int gic_cpu_notify(struct notifier_block *nfb, unsigned long action,
> + void *hcpu)
> +{
> + unsigned int cpu = mips_cm_vp_id((unsigned long)hcpu);
> +
> + switch (action) {
> + case CPU_UP_PREPARE:
> + case CPU_DOWN_FAILED:
> + gic_restore_shared();
> + gic_restore_local(cpu);
> + default:
> + break;
> + }
> +
> + return NOTIFY_OK;
> +}

Please use the new state machine based infrastructure.

Thanks,

tglx