diff mbox

[01/02] ARM: shmobile: Multicluster APMU prototype support

Message ID 20140408124807.9773.97405.sendpatchset@w520 (mailing list archive)
State RFC
Headers show

Commit Message

Magnus Damm April 8, 2014, 12:48 p.m. UTC
From: Magnus Damm <damm@opensource.se>

Allow APMU multicluster operation when enabled via
the kernel command line. Default is still single
cluster operation. Use together with appropriate
scheduler modifcations or static CPU affinity.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 Applies on top of renesas-devel-v3.14-20140408

 arch/arm/mach-shmobile/platsmp-apmu.c |   16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Geert Uytterhoeven April 10, 2014, 7:28 p.m. UTC | #1
Hi Magnus,

On Tue, Apr 8, 2014 at 2:48 PM, Magnus Damm <magnus.damm@gmail.com> wrote:
> +++ work/arch/arm/mach-shmobile/platsmp-apmu.c  2014-04-08 19:01:55.000000000 +0900
> @@ -18,6 +18,19 @@
>  #include <asm/smp_plat.h>
>  #include <mach/common.h>
>
> +/* only enable the cluster that includes the boot CPU by default */
> +static bool enable_multicluster = false;
> +
> +static __init int apmu_setup(char *opt)
> +{
> +       if (!opt)
> +               return -EINVAL;
> +       if (!strncmp(opt, "multicluster", 12))

Why do you ignore the characters after "multicluster", i.e. why not
simply "!strcmp(opt, "multicluster)"?

> +               enable_multicluster = true;
> +       return 0;
> +}
> +early_param("apmu", apmu_setup);

This can use some documentation under Documentation/.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Magnus Damm April 11, 2014, 5:51 a.m. UTC | #2
Hi Geert,

On Fri, Apr 11, 2014 at 4:28 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> Hi Magnus,
>
> On Tue, Apr 8, 2014 at 2:48 PM, Magnus Damm <magnus.damm@gmail.com> wrote:
>> +++ work/arch/arm/mach-shmobile/platsmp-apmu.c  2014-04-08 19:01:55.000000000 +0900
>> @@ -18,6 +18,19 @@
>>  #include <asm/smp_plat.h>
>>  #include <mach/common.h>
>>
>> +/* only enable the cluster that includes the boot CPU by default */
>> +static bool enable_multicluster = false;
>> +
>> +static __init int apmu_setup(char *opt)
>> +{
>> +       if (!opt)
>> +               return -EINVAL;
>> +       if (!strncmp(opt, "multicluster", 12))
>
> Why do you ignore the characters after "multicluster", i.e. why not
> simply "!strcmp(opt, "multicluster)"?

Good point, thanks.

>> +               enable_multicluster = true;
>> +       return 0;
>> +}
>> +early_param("apmu", apmu_setup);
>
> This can use some documentation under Documentation/.

If this was destined for upstream merge I totally agree, but in this
particular case it is just prototype-level code. The proper solution
involves upstream scheduler modifications and perhaps also MCPM once
we care about cluster-level power management.

Cheers,

/ magnus
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- 0001/arch/arm/mach-shmobile/platsmp-apmu.c
+++ work/arch/arm/mach-shmobile/platsmp-apmu.c	2014-04-08 19:01:55.000000000 +0900
@@ -18,6 +18,19 @@ 
 #include <asm/smp_plat.h>
 #include <mach/common.h>
 
+/* only enable the cluster that includes the boot CPU by default */
+static bool enable_multicluster = false;
+
+static __init int apmu_setup(char *opt)
+{
+	if (!opt)
+		return -EINVAL;
+	if (!strncmp(opt, "multicluster", 12))
+		enable_multicluster = true;
+	return 0;
+}
+early_param("apmu", apmu_setup);
+
 static struct {
 	void __iomem *iomem;
 	int bit;
@@ -100,8 +113,7 @@  static void apmu_parse_cfg(void (*fn)(st
 	bool is_allowed;
 
 	for (k = 0; k < ARRAY_SIZE(apmu_config); k++) {
-		/* only enable the cluster that includes the boot CPU */
-		is_allowed = false;
+		is_allowed = enable_multicluster;
 		for (bit = 0; bit < ARRAY_SIZE(apmu_config[k].cpus); bit++) {
 			id = apmu_config[k].cpus[bit];
 			if (id >= 0) {