Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1487183

Re: [PATCH v2 5/6] remoteproc/MIPS: Add a remoteproc driver for MIPS

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH v2 5/6] remoteproc/MIPS: Add a remoteproc driver for MIPS
Date 2016-09-20 11:50 +0200
Message-ID <sjpQB-1av-1@gated-at.bofh.it> (permalink)
References <sjoUy-Bu-5@gated-at.bofh.it> <sjoUy-Bu-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 20 Sep 2016, Matt Redfearn wrote:
> +/* Intercept CPU hotplug events for syfs purposes */
> +static int mips_rproc_callback(struct notifier_block *nfb, unsigned long action,
> +			       void *hcpu)
> +{

Please convert to cpu hotplug state machine.

> +	unsigned int cpu = (unsigned long)hcpu;
> +
> +	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;
> +	}

There is no reason why you need to setup the rproc device on
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 */
> +	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();

Perhaps we should add support for "reverse" functionality to the state
machine core. I'll have a look later how hard that'd be.

Thanks,

	tglx

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 5/6] remoteproc/MIPS: Add a remoteproc driver for MIPS Matt Redfearn <matt.redfearn@imgtec.com> - 2016-09-20 10:50 +0200
  Re: [PATCH v2 5/6] remoteproc/MIPS: Add a remoteproc driver for  MIPS Thomas Gleixner <tglx@linutronix.de> - 2016-09-20 11:50 +0200
    Re: [PATCH v2 5/6] remoteproc/MIPS: Add a remoteproc driver for MIPS Matt Redfearn <matt.redfearn@imgtec.com> - 2016-09-20 17:40 +0200

csiph-web