From: gregory.clement@free-electrons•com (Gregory CLEMENT)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] ARM: mvebu: add broken-idle option
Date: Fri, 23 Oct 2015 17:37:30 +0200 [thread overview]
Message-ID: <87bnbp38at.fsf@free-electrons.com> (raw)
In-Reply-To: <1445597998-23751-2-git-send-email-vdonnefort@gmail.com> (Vincent Donnefort's message of "Fri, 23 Oct 2015 12:59:58 +0200")
Hi Vincent,
On ven., oct. 23 2015, Vincent Donnefort <vdonnefort@gmail•com> wrote:
> The broken-idle option can be activated from the coherency-fabric DT
> node. This property allows to disable the idle capability, when the
> hardware doesn't support it, like the Seagate Personal Cloud boards.
Applied on mvebu/soc
Thanks,
Gregory
>
> Signed-off-by: Vincent Donnefort <vdonnefort@gmail•com>
>
> diff --git a/Documentation/devicetree/bindings/arm/coherency-fabric.txt b/Documentation/devicetree/bindings/arm/coherency-fabric.txt
> index 8dd4661..9b5c3f6 100644
> --- a/Documentation/devicetree/bindings/arm/coherency-fabric.txt
> +++ b/Documentation/devicetree/bindings/arm/coherency-fabric.txt
> @@ -27,6 +27,11 @@ Required properties:
> * For "marvell,armada-380-coherency-fabric", only one pair is needed
> for the per-CPU fabric registers.
>
> +Optional properties:
> +
> +- broken-idle: boolean to set when the Idle mode is not supported by the
> + hardware.
> +
> Examples:
>
> coherency-fabric at d0020200 {
> diff --git a/arch/arm/mach-mvebu/pmsu.c b/arch/arm/mach-mvebu/pmsu.c
> index 4f4e222..0e97b97 100644
> --- a/arch/arm/mach-mvebu/pmsu.c
> +++ b/arch/arm/mach-mvebu/pmsu.c
> @@ -379,6 +379,16 @@ static struct notifier_block mvebu_v7_cpu_pm_notifier = {
>
> static struct platform_device mvebu_v7_cpuidle_device;
>
> +static int broken_idle(struct device_node *np)
> +{
> + if (of_property_read_bool(np, "broken-idle")) {
> + pr_warn("CPU idle is currently broken: disabling\n");
> + return 1;
> + }
> +
> + return 0;
> +}
> +
> static __init int armada_370_cpuidle_init(void)
> {
> struct device_node *np;
> @@ -387,7 +397,9 @@ static __init int armada_370_cpuidle_init(void)
> np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric");
> if (!np)
> return -ENODEV;
> - of_node_put(np);
> +
> + if (broken_idle(np))
> + goto end;
>
> /*
> * On Armada 370, there is "a slow exit process from the deep
> @@ -406,6 +418,8 @@ static __init int armada_370_cpuidle_init(void)
> mvebu_v7_cpuidle_device.dev.platform_data = armada_370_xp_cpu_suspend;
> mvebu_v7_cpuidle_device.name = "cpuidle-armada-370";
>
> +end:
> + of_node_put(np);
> return 0;
> }
>
> @@ -422,6 +436,10 @@ static __init int armada_38x_cpuidle_init(void)
> "marvell,armada-380-coherency-fabric");
> if (!np)
> return -ENODEV;
> +
> + if (broken_idle(np))
> + goto end;
> +
> of_node_put(np);
>
> np = of_find_compatible_node(NULL, NULL,
> @@ -430,7 +448,6 @@ static __init int armada_38x_cpuidle_init(void)
> return -ENODEV;
> mpsoc_base = of_iomap(np, 0);
> BUG_ON(!mpsoc_base);
> - of_node_put(np);
>
> /* Set up reset mask when powering down the cpus */
> reg = readl(mpsoc_base + MPCORE_RESET_CTL);
> @@ -450,6 +467,8 @@ static __init int armada_38x_cpuidle_init(void)
> mvebu_v7_cpuidle_device.dev.platform_data = armada_38x_cpu_suspend;
> mvebu_v7_cpuidle_device.name = "cpuidle-armada-38x";
>
> +end:
> + of_node_put(np);
> return 0;
> }
>
> @@ -460,12 +479,16 @@ static __init int armada_xp_cpuidle_init(void)
> np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric");
> if (!np)
> return -ENODEV;
> - of_node_put(np);
> +
> + if (broken_idle(np))
> + goto end;
>
> mvebu_cpu_resume = armada_370_xp_cpu_resume;
> mvebu_v7_cpuidle_device.dev.platform_data = armada_370_xp_cpu_suspend;
> mvebu_v7_cpuidle_device.name = "cpuidle-armada-xp";
>
> +end:
> + of_node_put(np);
> return 0;
> }
>
> --
> 2.1.4
>
--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
next prev parent reply other threads:[~2015-10-23 15:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-06 14:13 [PATCH v5 0/4] Add support for the Armada-370-based Seagate NAS Simon Guinot
2015-10-06 14:13 ` [PATCH v5 1/4] ARM: mvebu: add broken-idle option Simon Guinot
2015-10-12 16:19 ` Gregory CLEMENT
2015-10-12 16:23 ` Gregory CLEMENT
2015-10-22 17:40 ` Olof Johansson
2015-10-23 7:57 ` Gregory CLEMENT
2015-10-23 10:59 ` [PATCH v6] " Vincent Donnefort
2015-10-23 10:59 ` [PATCH] " Vincent Donnefort
2015-10-23 15:37 ` Gregory CLEMENT [this message]
2015-10-06 14:13 ` [PATCH v5 2/4] ARM: mvebu: add DT support for Seagate NAS 2 and 4-Bay Simon Guinot
2015-10-12 16:20 ` Gregory CLEMENT
2015-10-06 14:13 ` [PATCH v5 3/4] ARM: mvebu: add DT support for Seagate Personal Cloud Simon Guinot
2015-10-12 16:20 ` Gregory CLEMENT
2015-10-06 14:13 ` [PATCH v5 4/4] ARM: mvebu: enable options for Seagate NAS in mvebu_v7_defconfig Simon Guinot
2015-10-12 16:22 ` Gregory CLEMENT
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=87bnbp38at.fsf@free-electrons.com \
--to=gregory.clement@free-electrons$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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