On Tue, 20 Sep 2016, Matt Redfearn wrote:
+/* Intercept CPU hotplug events for syfs purposes */Please convert to cpu hotplug state machine.
+static int mips_rproc_callback(struct notifier_block *nfb, unsigned long action,
+ void *hcpu)
+{
+ unsigned int cpu = (unsigned long)hcpu;There is no reason why you need to setup the rproc device on
+
+ switch (action) {
+ case CPU_UP_PREPARE:
+ case CPU_DOWN_FAILED:
+ mips_rproc_device_unregister(cpu);
+ break;
+ case CPU_DOWN_PREPARE:
+ mips_rproc_device_register(cpu);
+ break;
+ }
DOWN_PREPARE. It's sufficient to do that when the CPU is dead, so you can
use a symetric callback prep/dead.
+ /* Dynamically create mips-rproc class devices based on hotplug data */Perhaps we should add support for "reverse" functionality to the state
+ get_online_cpus();
+ for_each_possible_cpu(cpu)
+ if (!cpu_online(cpu))
+ mips_rproc_device_register(cpu);
+ register_hotcpu_notifier(&mips_rproc_notifier);
+ put_online_cpus();
machine core. I'll have a look later how hard that'd be.
Thanks,
tglx