linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: amit.kucheria@linaro.org (Amit Kucheria)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH][ ARM cpu hotplug 1/2 ] extract common code for arm cpu hotplug
Date: Tue, 30 Nov 2010 16:17:32 +0530	[thread overview]
Message-ID: <AANLkTimZfnmVMDZ2faUPpDHHv3oAhM9ZcVEpM0_MyHbq@mail.gmail.com> (raw)
In-Reply-To: <20101129192407.GA20761@n2100.arm.linux.org.uk>

On Tue, Nov 30, 2010 at 12:54 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
>
> On Mon, Nov 29, 2010 at 06:27:02PM +0100, Vincent Guittot wrote:
> > The goal of this patch is to remove as much duplicated code as
> > possible in each platform hotplug file. I have also tried to keep in
> > mind that current platform upstreamed code make nearly no power
> > management in their current implementation. I have added a new
> > interface and a new file in order to
> > ?-Keep the current interface as it is. So each platform could move to
> > common code when they want
> > ?-Have a dedicated file for arm hotplug function in which we can add
> > all code that must be executed on an arm core whatever the platform
> > (flushing cache, SCU disabling and handling spurious wake up as a
> > staring ?point). I agree that the current code is quite small for now
> > and we can wonder if a dedicated file is useful, code might be put in
> > kernel/smp.c file.
> > The next step is also to add some hotplug tracepoints and I would
> > prefer to add the tracepoints only in a platform independent code.
> >
> > With the common code, a new arm platform can have the hotplug feature
> > with less than 20 lines (power management not included) and can be
> > sure that minimal actions will be handled by the common Arm code.
> >
> > We can also keep the platform_cpu_die has the platform entry point and
> > move the common part into kernel/smp.c file. We still have few
> > duplicated code (spurious wake-up) but this seems to be acceptable.
> >
> > I have taken your example into account and have updated the patch accordingly
>
> No you haven't because you don't understand the point of keeping the
> existing interfaces. ?I'm not going to cripple the flexibility of the
> current interface just in the name of merging them all together.
>

To bring into context your reply to an earlier submission of a similar
patch [1], you stated

"So what if a platform wants to completely power down a CPU?

You'd want to implement it such that platform_cpu_die() does all
the shutdown of the CPU except for power-off, and platform_cpu_kill()
waits for that to complete before turning power off.

With platform_cpu_kill() and platform_cpu_die() moved into generic
code, you can no longer do this."

Since the main aim here is to consolidate as much code here as
possible while still allowing platforms to override the defaults,
would you have an objection to the introduction of a struct smp_ops
that'll allow a platform to override the defaults? This seems to be
done on other platforms I've briefly looked at.

$ git grep "\.cpu_die"
arch/mips/cavium-octeon/smp.c:  .cpu_die                = octeon_cpu_die,
arch/mips/kernel/smp-up.c:      .cpu_die                = up_cpu_die,
arch/powerpc/kernel/smp.c:      if (ppc_md.cpu_die)
arch/powerpc/kernel/smp.c:              ppc_md.cpu_die();
arch/powerpc/kernel/sysfs.c:            if (ppc_md.cpu_die)
arch/powerpc/platforms/powermac/setup.c:        .cpu_die
 = pmac64_cpu_die,
arch/powerpc/platforms/powermac/setup.c:        .cpu_die
 = pmac32_cpu_die,
arch/powerpc/platforms/powermac/setup.c:        .cpu_die
 = generic_mach_cpu_die,
arch/powerpc/platforms/powermac/smp.c:  .cpu_die        = smp_core99_cpu_die,
arch/powerpc/platforms/powermac/smp.c:  .cpu_die        = generic_cpu_die,
arch/powerpc/platforms/pseries/hotplug-cpu.c:   ppc_md.cpu_die =
pseries_mach_cpu_die;
arch/sh/kernel/cpu/sh4a/smp-shx3.c:     .cpu_die                =
native_cpu_die,
arch/x86/include/asm/smp.h:     smp_ops.cpu_die(cpu);
arch/x86/kernel/smp.c:  .cpu_die                = native_cpu_die,
arch/x86/xen/smp.c:     .cpu_die = xen_cpu_die,



[1] http://permalink.gmane.org/gmane.linux.ports.arm.kernel/89542

  reply	other threads:[~2010-11-30 10:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTi=fJeOUhH0xUJF8qx-fTJ5popE7ZuVxDZXpTH-i@mail.gmail.com>
2010-11-29  9:54 ` [PATCH][ ARM cpu hotplug 1/2 ] extract common code for arm cpu hotplug Vincent Guittot
2010-11-29 10:41   ` Russell King - ARM Linux
2010-11-29 17:27     ` Vincent Guittot
2010-11-29 19:24       ` Russell King - ARM Linux
2010-11-30 10:47         ` Amit Kucheria [this message]
2010-11-30 11:03           ` Russell King - ARM Linux
2010-11-30 11:51             ` Russell King - ARM Linux
2010-11-30 14:05               ` Will Deacon
2010-11-30 16:24             ` Rob Herring
2010-11-30 16:58               ` Russell King - ARM Linux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimZfnmVMDZ2faUPpDHHv3oAhM9ZcVEpM0_MyHbq@mail.gmail.com \
    --to=amit.kucheria@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).