All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Control PL310 pwr_ctrl register through DT
@ 2016-02-23 22:03 ` Brad Mouring
  0 siblings, 0 replies; 29+ messages in thread
From: Brad Mouring @ 2016-02-23 22:03 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Russell King


During some performance-oriented benchmarking on a Cortex A9
platform, a slight performance degradation was noted on datasets
that spanned into the L2 cache (<10%). This performance hit was
minor, but it prompted investigation into the cause.

One difference in the actual PL310 configuration that was concerning
was the enabling of two PM-related changes: Dynamic Clock Gating
and Standby Mode Enabling. As the kernel being tested was patched
and configured to use the PREEMPT_RT patchset, it was desired to
disable these settings for our use-case since anything PM can
(and usually does) impact determinism.

Making these changes resulted in a modest performance improvement
and those wonderful warm-n-fuzzies regarding determinism and enabling
system control without needing to change the kernel.

In the following set, there's the actual change to control these
features given DT presence of a couple of new bindings and the
documenation to accompany those changes. Thanks!
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 0/2] Control PL310 pwr_ctrl register through DT
@ 2016-02-23 22:03 ` Brad Mouring
  0 siblings, 0 replies; 29+ messages in thread
From: Brad Mouring @ 2016-02-23 22:03 UTC (permalink / raw)
  To: linux-arm-kernel


During some performance-oriented benchmarking on a Cortex A9
platform, a slight performance degradation was noted on datasets
that spanned into the L2 cache (<10%). This performance hit was
minor, but it prompted investigation into the cause.

One difference in the actual PL310 configuration that was concerning
was the enabling of two PM-related changes: Dynamic Clock Gating
and Standby Mode Enabling. As the kernel being tested was patched
and configured to use the PREEMPT_RT patchset, it was desired to
disable these settings for our use-case since anything PM can
(and usually does) impact determinism.

Making these changes resulted in a modest performance improvement
and those wonderful warm-n-fuzzies regarding determinism and enabling
system control without needing to change the kernel.

In the following set, there's the actual change to control these
features given DT presence of a couple of new bindings and the
documenation to accompany those changes. Thanks!

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 1/2] pl2x0: Add OF control of cache power management
  2016-02-23 22:03 ` Brad Mouring
@ 2016-02-23 22:03     ` Brad Mouring
  -1 siblings, 0 replies; 29+ messages in thread
From: Brad Mouring @ 2016-02-23 22:03 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Russell King, Brad Mouring

Add ability to override power management bits of 310 controllers
through OF entries. As the saved register is only applied when
working on a supported controller, it is safe to save the settings.

Additionally, to control the actual configuration of the power
control register, remove the unconditional enabling of features in
the l2c310_enable function.

Signed-off-by: Brad Mouring <brad.mouring-acOepvfBmUk@public.gmane.org>
Acked-by: Josh Cartwright <joshc-acOepvfBmUk@public.gmane.org>
---
 arch/arm/mm/cache-l2x0.c | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index d6e43d8..42f4ad1 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -639,11 +639,6 @@ static void __init l2c310_enable(void __iomem *base, u32 aux, unsigned num_lock)
 		aux &= ~(L310_AUX_CTRL_FULL_LINE_ZERO | L310_AUX_CTRL_EARLY_BRESP);
 	}
 
-	/* r3p0 or later has power control register */
-	if (rev >= L310_CACHE_ID_RTL_R3P0)
-		l2x0_saved_regs.pwr_ctrl = L310_DYNAMIC_CLK_GATING_EN |
-						L310_STNDBY_MODE_EN;
-
 	/*
 	 * Always enable non-secure access to the lockdown registers -
 	 * we write to them as part of the L2C enable sequence so they
@@ -1103,6 +1098,7 @@ static void __init l2c310_of_parse(const struct device_node *np,
 	u32 filter[2] = { 0, 0 };
 	u32 assoc;
 	u32 prefetch;
+	u32 power;
 	u32 val;
 	int ret;
 
@@ -1220,6 +1216,29 @@ static void __init l2c310_of_parse(const struct device_node *np,
 	}
 
 	l2x0_saved_regs.prefetch_ctrl = prefetch;
+
+	power = l2x0_saved_regs.pwr_ctrl;
+
+	ret = of_property_read_u32(np, "arm,dynamic-clock-gating", &val);
+	if (ret == 0) {
+		if (val)
+			power |= L310_DYNAMIC_CLK_GATING_EN;
+		else
+			power &= ~L310_DYNAMIC_CLK_GATING_EN;
+	} else if (ret != -EINVAL) {
+		pr_err("L2C-310 OF dynamic-clock-gating property value is missing\n");
+	}
+	ret = of_property_read_u32(np, "arm,standby-mode", &val);
+	if (ret == 0) {
+		if (val)
+			power |= L310_STNDBY_MODE_EN;
+		else
+			power &= ~L310_STNDBY_MODE_EN;
+	} else if (ret != -EINVAL) {
+		pr_err("L2C-310 OF standby-mode property value is missing\n");
+	}
+
+	l2x0_saved_regs.pwr_ctrl = power;
 }
 
 static const struct l2c_init_data of_l2c310_data __initconst = {
-- 
2.7.1

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

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 1/2] pl2x0: Add OF control of cache power management
@ 2016-02-23 22:03     ` Brad Mouring
  0 siblings, 0 replies; 29+ messages in thread
From: Brad Mouring @ 2016-02-23 22:03 UTC (permalink / raw)
  To: linux-arm-kernel

Add ability to override power management bits of 310 controllers
through OF entries. As the saved register is only applied when
working on a supported controller, it is safe to save the settings.

Additionally, to control the actual configuration of the power
control register, remove the unconditional enabling of features in
the l2c310_enable function.

Signed-off-by: Brad Mouring <brad.mouring@ni.com>
Acked-by: Josh Cartwright <joshc@ni.com>
---
 arch/arm/mm/cache-l2x0.c | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index d6e43d8..42f4ad1 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -639,11 +639,6 @@ static void __init l2c310_enable(void __iomem *base, u32 aux, unsigned num_lock)
 		aux &= ~(L310_AUX_CTRL_FULL_LINE_ZERO | L310_AUX_CTRL_EARLY_BRESP);
 	}
 
-	/* r3p0 or later has power control register */
-	if (rev >= L310_CACHE_ID_RTL_R3P0)
-		l2x0_saved_regs.pwr_ctrl = L310_DYNAMIC_CLK_GATING_EN |
-						L310_STNDBY_MODE_EN;
-
 	/*
 	 * Always enable non-secure access to the lockdown registers -
 	 * we write to them as part of the L2C enable sequence so they
@@ -1103,6 +1098,7 @@ static void __init l2c310_of_parse(const struct device_node *np,
 	u32 filter[2] = { 0, 0 };
 	u32 assoc;
 	u32 prefetch;
+	u32 power;
 	u32 val;
 	int ret;
 
@@ -1220,6 +1216,29 @@ static void __init l2c310_of_parse(const struct device_node *np,
 	}
 
 	l2x0_saved_regs.prefetch_ctrl = prefetch;
+
+	power = l2x0_saved_regs.pwr_ctrl;
+
+	ret = of_property_read_u32(np, "arm,dynamic-clock-gating", &val);
+	if (ret == 0) {
+		if (val)
+			power |= L310_DYNAMIC_CLK_GATING_EN;
+		else
+			power &= ~L310_DYNAMIC_CLK_GATING_EN;
+	} else if (ret != -EINVAL) {
+		pr_err("L2C-310 OF dynamic-clock-gating property value is missing\n");
+	}
+	ret = of_property_read_u32(np, "arm,standby-mode", &val);
+	if (ret == 0) {
+		if (val)
+			power |= L310_STNDBY_MODE_EN;
+		else
+			power &= ~L310_STNDBY_MODE_EN;
+	} else if (ret != -EINVAL) {
+		pr_err("L2C-310 OF standby-mode property value is missing\n");
+	}
+
+	l2x0_saved_regs.pwr_ctrl = power;
 }
 
 static const struct l2c_init_data of_l2c310_data __initconst = {
-- 
2.7.1

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-02-23 22:03 ` Brad Mouring
@ 2016-02-23 22:03     ` Brad Mouring
  -1 siblings, 0 replies; 29+ messages in thread
From: Brad Mouring @ 2016-02-23 22:03 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Russell King, Brad Mouring

Document the DT bindings for controlling ARM PL310 Power Control
settings.

Signed-off-by: Brad Mouring <brad.mouring-acOepvfBmUk@public.gmane.org>
Acked-by: Josh Cartwright <joshc-acOepvfBmUk@public.gmane.org>
---
 Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
index 2251dcc..4c2d764 100644
--- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
+++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
@@ -72,6 +72,10 @@ Optional properties:
 - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
   <1> (forcibly enable), property absent (retain settings set by
   firmware)
+- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
+  disable), <1> (forcibly enable), property absent (retain firmware settings)
+- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
+  <1> (forcibly enable), property absent (retain firmware settings)
 
 Example:
 
-- 
2.7.1

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

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 2/2] Documentation: devicetree: Add PL310 PM bindings
@ 2016-02-23 22:03     ` Brad Mouring
  0 siblings, 0 replies; 29+ messages in thread
From: Brad Mouring @ 2016-02-23 22:03 UTC (permalink / raw)
  To: linux-arm-kernel

Document the DT bindings for controlling ARM PL310 Power Control
settings.

Signed-off-by: Brad Mouring <brad.mouring@ni.com>
Acked-by: Josh Cartwright <joshc@ni.com>
---
 Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
index 2251dcc..4c2d764 100644
--- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
+++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
@@ -72,6 +72,10 @@ Optional properties:
 - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
   <1> (forcibly enable), property absent (retain settings set by
   firmware)
+- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
+  disable), <1> (forcibly enable), property absent (retain firmware settings)
+- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
+  <1> (forcibly enable), property absent (retain firmware settings)
 
 Example:
 
-- 
2.7.1

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-02-23 22:03     ` Brad Mouring
@ 2016-02-24  1:33         ` Rob Herring
  -1 siblings, 0 replies; 29+ messages in thread
From: Rob Herring @ 2016-02-24  1:33 UTC (permalink / raw)
  To: Brad Mouring
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Russell King

On Tue, Feb 23, 2016 at 04:03:39PM -0600, Brad Mouring wrote:
> Document the DT bindings for controlling ARM PL310 Power Control
> settings.
> 
> Signed-off-by: Brad Mouring <brad.mouring-acOepvfBmUk@public.gmane.org>
> Acked-by: Josh Cartwright <joshc-acOepvfBmUk@public.gmane.org>
> ---
>  Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
>  1 file changed, 4 insertions(+)

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 2/2] Documentation: devicetree: Add PL310 PM bindings
@ 2016-02-24  1:33         ` Rob Herring
  0 siblings, 0 replies; 29+ messages in thread
From: Rob Herring @ 2016-02-24  1:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 23, 2016 at 04:03:39PM -0600, Brad Mouring wrote:
> Document the DT bindings for controlling ARM PL310 Power Control
> settings.
> 
> Signed-off-by: Brad Mouring <brad.mouring@ni.com>
> Acked-by: Josh Cartwright <joshc@ni.com>
> ---
>  Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
>  1 file changed, 4 insertions(+)

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 1/2] pl2x0: Add OF control of cache power management
  2016-02-23 22:03 ` Brad Mouring
@ 2016-02-29 16:01     ` Brad Mouring
  -1 siblings, 0 replies; 29+ messages in thread
From: Brad Mouring @ 2016-02-29 16:01 UTC (permalink / raw)
  To: Russell King
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Brad Mouring

Add ability to override power management bits of 310 controllers
through OF entries. As the saved register is only applied when
working on a supported controller, it is safe to save the settings.

Additionally, to control the actual configuration of the power
control register, remove the unconditional enabling of features in
the l2c310_enable function.

Signed-off-by: Brad Mouring <brad.mouring-acOepvfBmUk@public.gmane.org>
Acked-by: Josh Cartwright <joshc-acOepvfBmUk@public.gmane.org>
---
 arch/arm/mm/cache-l2x0.c | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 9f9d542..7432dea 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -647,11 +647,6 @@ static void __init l2c310_enable(void __iomem *base, unsigned num_lock)
 		aux &= ~(L310_AUX_CTRL_FULL_LINE_ZERO | L310_AUX_CTRL_EARLY_BRESP);
 	}
 
-	/* r3p0 or later has power control register */
-	if (rev >= L310_CACHE_ID_RTL_R3P0)
-		l2x0_saved_regs.pwr_ctrl = L310_DYNAMIC_CLK_GATING_EN |
-						L310_STNDBY_MODE_EN;
-
 	/*
 	 * Always enable non-secure access to the lockdown registers -
 	 * we write to them as part of the L2C enable sequence so they
@@ -1141,6 +1136,7 @@ static void __init l2c310_of_parse(const struct device_node *np,
 	u32 filter[2] = { 0, 0 };
 	u32 assoc;
 	u32 prefetch;
+	u32 power;
 	u32 val;
 	int ret;
 
@@ -1271,6 +1267,29 @@ static void __init l2c310_of_parse(const struct device_node *np,
 	}
 
 	l2x0_saved_regs.prefetch_ctrl = prefetch;
+
+	power = l2x0_saved_regs.pwr_ctrl;
+
+	ret = of_property_read_u32(np, "arm,dynamic-clock-gating", &val);
+	if (ret == 0) {
+		if (val)
+			power |= L310_DYNAMIC_CLK_GATING_EN;
+		else
+			power &= ~L310_DYNAMIC_CLK_GATING_EN;
+	} else if (ret != -EINVAL) {
+		pr_err("L2C-310 OF dynamic-clock-gating property value is missing\n");
+	}
+	ret = of_property_read_u32(np, "arm,standby-mode", &val);
+	if (ret == 0) {
+		if (val)
+			power |= L310_STNDBY_MODE_EN;
+		else
+			power &= ~L310_STNDBY_MODE_EN;
+	} else if (ret != -EINVAL) {
+		pr_err("L2C-310 OF standby-mode property value is missing\n");
+	}
+
+	l2x0_saved_regs.pwr_ctrl = power;
 }
 
 static const struct l2c_init_data of_l2c310_data __initconst = {
-- 
2.7.1

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

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 1/2] pl2x0: Add OF control of cache power management
@ 2016-02-29 16:01     ` Brad Mouring
  0 siblings, 0 replies; 29+ messages in thread
From: Brad Mouring @ 2016-02-29 16:01 UTC (permalink / raw)
  To: linux-arm-kernel

Add ability to override power management bits of 310 controllers
through OF entries. As the saved register is only applied when
working on a supported controller, it is safe to save the settings.

Additionally, to control the actual configuration of the power
control register, remove the unconditional enabling of features in
the l2c310_enable function.

Signed-off-by: Brad Mouring <brad.mouring@ni.com>
Acked-by: Josh Cartwright <joshc@ni.com>
---
 arch/arm/mm/cache-l2x0.c | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 9f9d542..7432dea 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -647,11 +647,6 @@ static void __init l2c310_enable(void __iomem *base, unsigned num_lock)
 		aux &= ~(L310_AUX_CTRL_FULL_LINE_ZERO | L310_AUX_CTRL_EARLY_BRESP);
 	}
 
-	/* r3p0 or later has power control register */
-	if (rev >= L310_CACHE_ID_RTL_R3P0)
-		l2x0_saved_regs.pwr_ctrl = L310_DYNAMIC_CLK_GATING_EN |
-						L310_STNDBY_MODE_EN;
-
 	/*
 	 * Always enable non-secure access to the lockdown registers -
 	 * we write to them as part of the L2C enable sequence so they
@@ -1141,6 +1136,7 @@ static void __init l2c310_of_parse(const struct device_node *np,
 	u32 filter[2] = { 0, 0 };
 	u32 assoc;
 	u32 prefetch;
+	u32 power;
 	u32 val;
 	int ret;
 
@@ -1271,6 +1267,29 @@ static void __init l2c310_of_parse(const struct device_node *np,
 	}
 
 	l2x0_saved_regs.prefetch_ctrl = prefetch;
+
+	power = l2x0_saved_regs.pwr_ctrl;
+
+	ret = of_property_read_u32(np, "arm,dynamic-clock-gating", &val);
+	if (ret == 0) {
+		if (val)
+			power |= L310_DYNAMIC_CLK_GATING_EN;
+		else
+			power &= ~L310_DYNAMIC_CLK_GATING_EN;
+	} else if (ret != -EINVAL) {
+		pr_err("L2C-310 OF dynamic-clock-gating property value is missing\n");
+	}
+	ret = of_property_read_u32(np, "arm,standby-mode", &val);
+	if (ret == 0) {
+		if (val)
+			power |= L310_STNDBY_MODE_EN;
+		else
+			power &= ~L310_STNDBY_MODE_EN;
+	} else if (ret != -EINVAL) {
+		pr_err("L2C-310 OF standby-mode property value is missing\n");
+	}
+
+	l2x0_saved_regs.pwr_ctrl = power;
 }
 
 static const struct l2c_init_data of_l2c310_data __initconst = {
-- 
2.7.1

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-02-29 16:01     ` Brad Mouring
@ 2016-02-29 16:01         ` Brad Mouring
  -1 siblings, 0 replies; 29+ messages in thread
From: Brad Mouring @ 2016-02-29 16:01 UTC (permalink / raw)
  To: Russell King
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Brad Mouring

Document the DT bindings for controlling ARM PL310 Power Control
settings.

Signed-off-by: Brad Mouring <brad.mouring-acOepvfBmUk@public.gmane.org>
Acked-by: Josh Cartwright <joshc-acOepvfBmUk@public.gmane.org>
Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
index fe0398c..6b2366ed 100644
--- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
+++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
@@ -84,6 +84,10 @@ Optional properties:
 - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
   <1> (forcibly enable), property absent (retain settings set by
   firmware)
+- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
+  disable), <1> (forcibly enable), property absent (retain firmware settings)
+- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
+  <1> (forcibly enable), property absent (retain firmware settings)
 
 Example:
 
-- 
2.7.1

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

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 2/2] Documentation: devicetree: Add PL310 PM bindings
@ 2016-02-29 16:01         ` Brad Mouring
  0 siblings, 0 replies; 29+ messages in thread
From: Brad Mouring @ 2016-02-29 16:01 UTC (permalink / raw)
  To: linux-arm-kernel

Document the DT bindings for controlling ARM PL310 Power Control
settings.

Signed-off-by: Brad Mouring <brad.mouring@ni.com>
Acked-by: Josh Cartwright <joshc@ni.com>
Acked-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
index fe0398c..6b2366ed 100644
--- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
+++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
@@ -84,6 +84,10 @@ Optional properties:
 - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
   <1> (forcibly enable), property absent (retain settings set by
   firmware)
+- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
+  disable), <1> (forcibly enable), property absent (retain firmware settings)
+- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
+  <1> (forcibly enable), property absent (retain firmware settings)
 
 Example:
 
-- 
2.7.1

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v2 0/2] Control PL310 pwr_ctrl register through DT
  2016-02-23 22:03 ` Brad Mouring
  (?)
  (?)
@ 2016-04-18 21:36 ` Brad Mouring
  2016-04-18 21:36   ` [PATCH v2 1/2] pl2x0: Add OF control of cache power management Brad Mouring
                     ` (2 more replies)
  -1 siblings, 3 replies; 29+ messages in thread
From: Brad Mouring @ 2016-04-18 21:36 UTC (permalink / raw)
  To: linux-arm-kernel


This submission addresses the concerns brought up here:
http://www.spinics.net/lists/arm-kernel/msg495003.html

The of_property_read_u32 returns -EINVAL when the property is
not found in the dtb, and we ignore that error. An error message
is only printed when the property is present with an invalid value.

The other issue raised was concerning the default behavior if
the properties are not in the dtb. The existing behavior prior
to this changeset is maintained.

During some performance-oriented benchmarking on a Cortex A9
platform, a slight performance degradation was noted on datasets
that spanned into the L2 cache (<10%). This performance hit was
minor, but it prompted investigation into the cause.

One difference in the actual PL310 configuration that was concerning
was the enabling of two PM-related changes: Dynamic Clock Gating
and Standby Mode Enabling. As the kernel being tested was patched
and configured to use the PREEMPT_RT patchset, it was desired to
disable these settings for our use-case since anything PM can
(and usually does) impact determinism.

Making these changes resulted in a modest performance improvement
and those wonderful warm-n-fuzzies regarding determinism and enabling
system control without needing to change the kernel.

In the following set, there's the actual change to control these
features given DT presence of a couple of new bindings and the
documenation to accompany those changes.

Thanks for the feedback!

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v2 1/2] pl2x0: Add OF control of cache power management
  2016-04-18 21:36 ` [PATCH v2 0/2] Control PL310 pwr_ctrl register through DT Brad Mouring
@ 2016-04-18 21:36   ` Brad Mouring
  2016-04-18 21:36   ` [PATCH v2 2/2] Documentation: devicetree: Add PL310 PM bindings Brad Mouring
  2016-04-27 15:35   ` [PATCH v3 0/2] Control PL310 pwr_ctrl register through DT Brad Mouring
  2 siblings, 0 replies; 29+ messages in thread
From: Brad Mouring @ 2016-04-18 21:36 UTC (permalink / raw)
  To: linux-arm-kernel

Add ability to override power management bits of 310 controllers
(dynamic clock gating and standby mode) through OF entries. As the
saved register is only applied when working on a supported controller,
it is safe to save the settings.

In order to maintain existing behavior, if the settings are not found
in the DT, the corresponding feature will be enabled.

Signed-off-by: Brad Mouring <brad.mouring@ni.com>
---
 arch/arm/mm/cache-l2x0.c | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 9f9d542..f284bd3 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -647,11 +647,6 @@ static void __init l2c310_enable(void __iomem *base, unsigned num_lock)
 		aux &= ~(L310_AUX_CTRL_FULL_LINE_ZERO | L310_AUX_CTRL_EARLY_BRESP);
 	}
 
-	/* r3p0 or later has power control register */
-	if (rev >= L310_CACHE_ID_RTL_R3P0)
-		l2x0_saved_regs.pwr_ctrl = L310_DYNAMIC_CLK_GATING_EN |
-						L310_STNDBY_MODE_EN;
-
 	/*
 	 * Always enable non-secure access to the lockdown registers -
 	 * we write to them as part of the L2C enable sequence so they
@@ -1141,6 +1136,7 @@ static void __init l2c310_of_parse(const struct device_node *np,
 	u32 filter[2] = { 0, 0 };
 	u32 assoc;
 	u32 prefetch;
+	u32 power;
 	u32 val;
 	int ret;
 
@@ -1271,6 +1267,30 @@ static void __init l2c310_of_parse(const struct device_node *np,
 	}
 
 	l2x0_saved_regs.prefetch_ctrl = prefetch;
+
+	power = l2x0_saved_regs.pwr_ctrl |
+		L310_DYNAMIC_CLK_GATING_EN | L310_STNDBY_MODE_EN;
+
+	ret = of_property_read_u32(np, "arm,dynamic-clock-gating", &val);
+	if (ret == 0) {
+		if (val)
+			power |= L310_DYNAMIC_CLK_GATING_EN;
+		else
+			power &= ~L310_DYNAMIC_CLK_GATING_EN;
+	} else if (ret != -EINVAL) {
+		pr_err("L2C-310 OF dynamic-clock-gating property value is missing or invalid\n");
+	}
+	ret = of_property_read_u32(np, "arm,standby-mode", &val);
+	if (ret == 0) {
+		if (val)
+			power |= L310_STNDBY_MODE_EN;
+		else
+			power &= ~L310_STNDBY_MODE_EN;
+	} else if (ret != -EINVAL) {
+		pr_err("L2C-310 OF standby-mode property value is missing or invalid\n");
+	}
+
+	l2x0_saved_regs.pwr_ctrl = power;
 }
 
 static const struct l2c_init_data of_l2c310_data __initconst = {
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v2 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-04-18 21:36 ` [PATCH v2 0/2] Control PL310 pwr_ctrl register through DT Brad Mouring
  2016-04-18 21:36   ` [PATCH v2 1/2] pl2x0: Add OF control of cache power management Brad Mouring
@ 2016-04-18 21:36   ` Brad Mouring
  2016-04-19 21:38     ` Rob Herring
  2016-04-27 15:35   ` [PATCH v3 0/2] Control PL310 pwr_ctrl register through DT Brad Mouring
  2 siblings, 1 reply; 29+ messages in thread
From: Brad Mouring @ 2016-04-18 21:36 UTC (permalink / raw)
  To: linux-arm-kernel

Document the DT bindings for controlling ARM PL310 Power Control
settings.

Signed-off-by: Brad Mouring <brad.mouring@ni.com>
---
 Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
index fe0398c..c1c756e 100644
--- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
+++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
@@ -84,6 +84,10 @@ Optional properties:
 - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
   <1> (forcibly enable), property absent (retain settings set by
   firmware)
+- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
+  disable), <1> or property absent (forcibly enable)
+- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
+  <1>  or property absent (forcibly enable)
 
 Example:
 
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v2 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-04-18 21:36   ` [PATCH v2 2/2] Documentation: devicetree: Add PL310 PM bindings Brad Mouring
@ 2016-04-19 21:38     ` Rob Herring
  2016-04-19 22:41       ` Russell King - ARM Linux
  2016-04-20 14:23       ` Brad Mouring
  0 siblings, 2 replies; 29+ messages in thread
From: Rob Herring @ 2016-04-19 21:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 18, 2016 at 4:36 PM, Brad Mouring <brad.mouring@ni.com> wrote:
> Document the DT bindings for controlling ARM PL310 Power Control
> settings.
>
> Signed-off-by: Brad Mouring <brad.mouring@ni.com>

What happened to Josh's ack?

> ---
>  Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
> index fe0398c..c1c756e 100644
> --- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
> +++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
> @@ -84,6 +84,10 @@ Optional properties:
>  - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
>    <1> (forcibly enable), property absent (retain settings set by
>    firmware)
> +- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
> +  disable), <1> or property absent (forcibly enable)
> +- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
> +  <1>  or property absent (forcibly enable)

What happened to "retain settings set by firmware"?

Rob

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v2 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-04-19 21:38     ` Rob Herring
@ 2016-04-19 22:41       ` Russell King - ARM Linux
  2016-04-20 14:04         ` Rob Herring
  2016-04-20 14:23       ` Brad Mouring
  1 sibling, 1 reply; 29+ messages in thread
From: Russell King - ARM Linux @ 2016-04-19 22:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 19, 2016 at 04:38:14PM -0500, Rob Herring wrote:
> On Mon, Apr 18, 2016 at 4:36 PM, Brad Mouring <brad.mouring@ni.com> wrote:
> > Document the DT bindings for controlling ARM PL310 Power Control
> > settings.
> >
> > Signed-off-by: Brad Mouring <brad.mouring@ni.com>
> 
> What happened to Josh's ack?
> 
> > ---
> >  Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
> > index fe0398c..c1c756e 100644
> > --- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
> > +++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
> > @@ -84,6 +84,10 @@ Optional properties:
> >  - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
> >    <1> (forcibly enable), property absent (retain settings set by
> >    firmware)
> > +- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
> > +  disable), <1> or property absent (forcibly enable)
> > +- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
> > +  <1>  or property absent (forcibly enable)
> 
> What happened to "retain settings set by firmware"?

I said we shouldn't.  Current behaviour is that we enable these features,
and moving to missing-means-retain means that everything today ends up
with these features disabled.  IOW, it's yet another change of actual
behaviour that every platform would see.

-- 
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v2 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-04-19 22:41       ` Russell King - ARM Linux
@ 2016-04-20 14:04         ` Rob Herring
  2016-04-21 20:48           ` Brad Mouring
  2016-04-27  8:59           ` Russell King - ARM Linux
  0 siblings, 2 replies; 29+ messages in thread
From: Rob Herring @ 2016-04-20 14:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 19, 2016 at 5:41 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Tue, Apr 19, 2016 at 04:38:14PM -0500, Rob Herring wrote:
>> On Mon, Apr 18, 2016 at 4:36 PM, Brad Mouring <brad.mouring@ni.com> wrote:
>> > Document the DT bindings for controlling ARM PL310 Power Control
>> > settings.
>> >
>> > Signed-off-by: Brad Mouring <brad.mouring@ni.com>
>>
>> What happened to Josh's ack?
>>
>> > ---
>> >  Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
>> >  1 file changed, 4 insertions(+)
>> >
>> > diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
>> > index fe0398c..c1c756e 100644
>> > --- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
>> > +++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
>> > @@ -84,6 +84,10 @@ Optional properties:
>> >  - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
>> >    <1> (forcibly enable), property absent (retain settings set by
>> >    firmware)
>> > +- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
>> > +  disable), <1> or property absent (forcibly enable)
>> > +- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
>> > +  <1>  or property absent (forcibly enable)
>>
>> What happened to "retain settings set by firmware"?
>
> I said we shouldn't.  Current behaviour is that we enable these features,
> and moving to missing-means-retain means that everything today ends up
> with these features disabled.  IOW, it's yet another change of actual
> behaviour that every platform would see.

Right, but then the properties are different from prefetch-instr and
others IIRC. We're letting the OS define the binding. If BSD doesn't
enable these settings currently, then there is a mismatch between the
binding and actual behavior. Saying "retain firmware settings" also
defines specific OS behavior. I think absent should mean OS is free to
do whatever it wants which could be retain firmware settings, enable
or disable. In other words, it is undefined as this ship has already
sailed.

Rob

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v2 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-04-19 21:38     ` Rob Herring
  2016-04-19 22:41       ` Russell King - ARM Linux
@ 2016-04-20 14:23       ` Brad Mouring
  1 sibling, 0 replies; 29+ messages in thread
From: Brad Mouring @ 2016-04-20 14:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 19, 2016 at 04:38:14PM -0500, Rob Herring wrote:
> On Mon, Apr 18, 2016 at 4:36 PM, Brad Mouring <brad.mouring@ni.com> wrote:
> > Document the DT bindings for controlling ARM PL310 Power Control
> > settings.
> >
> > Signed-off-by: Brad Mouring <brad.mouring@ni.com>
> 
> What happened to Josh's ack?

This is not the change that Josh reviewed, if he does agree with it, I'll
put his ack on it. This was done purposefully.

> > ---
> >  Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
> > index fe0398c..c1c756e 100644
> > --- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
> > +++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
> > @@ -84,6 +84,10 @@ Optional properties:
> >  - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
> >    <1> (forcibly enable), property absent (retain settings set by
> >    firmware)
> > +- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
> > +  disable), <1> or property absent (forcibly enable)
> > +- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
> > +  <1>  or property absent (forcibly enable)
> 
> What happened to "retain settings set by firmware"?
>
> Rob
This is the difference. There was discussion that this would be a
functional regression for some, and Russell (while noting that he
generally agreed with keeping fw settings) noted that this would be
a possible functional regression sprung on those who wanted PM.

In all honesty, I don't really care one way or the other, since
we'll be defining this property in our dtbs. I'm all ears if you
have a strong oppinion (and this *does* seem like the sort of
setting that can be overridden in the kernel, but should be left
otherwise as the fw set it).

Brad

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v2 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-04-20 14:04         ` Rob Herring
@ 2016-04-21 20:48           ` Brad Mouring
  2016-04-27  8:59           ` Russell King - ARM Linux
  1 sibling, 0 replies; 29+ messages in thread
From: Brad Mouring @ 2016-04-21 20:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 20, 2016 at 09:04:39AM -0500, Rob Herring wrote:
> On Tue, Apr 19, 2016 at 5:41 PM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > On Tue, Apr 19, 2016 at 04:38:14PM -0500, Rob Herring wrote:
> >> On Mon, Apr 18, 2016 at 4:36 PM, Brad Mouring <brad.mouring@ni.com> wrote:
> >> > Document the DT bindings for controlling ARM PL310 Power Control
> >> > settings.
> >> >
> >> > Signed-off-by: Brad Mouring <brad.mouring@ni.com>
> >>
> >> What happened to Josh's ack?
> >>
> >> > ---
> >> >  Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
> >> >  1 file changed, 4 insertions(+)
> >> >
> >> > diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
> >> > index fe0398c..c1c756e 100644
> >> > --- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
> >> > +++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
> >> > @@ -84,6 +84,10 @@ Optional properties:
> >> >  - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
> >> >    <1> (forcibly enable), property absent (retain settings set by
> >> >    firmware)
> >> > +- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
> >> > +  disable), <1> or property absent (forcibly enable)
> >> > +- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
> >> > +  <1>  or property absent (forcibly enable)
> >>
> >> What happened to "retain settings set by firmware"?
> >
> > I said we shouldn't.  Current behaviour is that we enable these features,
> > and moving to missing-means-retain means that everything today ends up
> > with these features disabled.  IOW, it's yet another change of actual
> > behaviour that every platform would see.
> 
> Right, but then the properties are different from prefetch-instr and
> others IIRC. We're letting the OS define the binding. If BSD doesn't
> enable these settings currently, then there is a mismatch between the
> binding and actual behavior. Saying "retain firmware settings" also
> defines specific OS behavior. I think absent should mean OS is free to
> do whatever it wants which could be retain firmware settings, enable
> or disable. In other words, it is undefined as this ship has already
> sailed.

Both positions have validity, I think the idealist in me sides with Rob
(for something with definite tradeoffs, it's odd to force an assumption
when there's no property) while the developer with experience sides with
Russell (why needlessly change behavior that may have wide-reaching
impact?) At this point, I don't have nearly the perspective to make a
call on which is overall the "right" choice for the community, so maybe
it should be an [RFC] instead? Thoughts?

Brad

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v2 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-04-20 14:04         ` Rob Herring
  2016-04-21 20:48           ` Brad Mouring
@ 2016-04-27  8:59           ` Russell King - ARM Linux
  2016-04-27 12:48             ` Rob Herring
  1 sibling, 1 reply; 29+ messages in thread
From: Russell King - ARM Linux @ 2016-04-27  8:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 20, 2016 at 09:04:39AM -0500, Rob Herring wrote:
> On Tue, Apr 19, 2016 at 5:41 PM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > On Tue, Apr 19, 2016 at 04:38:14PM -0500, Rob Herring wrote:
> >> On Mon, Apr 18, 2016 at 4:36 PM, Brad Mouring <brad.mouring@ni.com> wrote:
> >> > Document the DT bindings for controlling ARM PL310 Power Control
> >> > settings.
> >> >
> >> > Signed-off-by: Brad Mouring <brad.mouring@ni.com>
> >>
> >> What happened to Josh's ack?
> >>
> >> > ---
> >> >  Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
> >> >  1 file changed, 4 insertions(+)
> >> >
> >> > diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
> >> > index fe0398c..c1c756e 100644
> >> > --- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
> >> > +++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
> >> > @@ -84,6 +84,10 @@ Optional properties:
> >> >  - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
> >> >    <1> (forcibly enable), property absent (retain settings set by
> >> >    firmware)
> >> > +- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
> >> > +  disable), <1> or property absent (forcibly enable)
> >> > +- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
> >> > +  <1>  or property absent (forcibly enable)
> >>
> >> What happened to "retain settings set by firmware"?
> >
> > I said we shouldn't.  Current behaviour is that we enable these features,
> > and moving to missing-means-retain means that everything today ends up
> > with these features disabled.  IOW, it's yet another change of actual
> > behaviour that every platform would see.
> 
> Right, but then the properties are different from prefetch-instr and
> others IIRC. We're letting the OS define the binding. If BSD doesn't
> enable these settings currently, then there is a mismatch between the
> binding and actual behavior. Saying "retain firmware settings" also
> defines specific OS behavior. I think absent should mean OS is free to
> do whatever it wants which could be retain firmware settings, enable
> or disable. In other words, it is undefined as this ship has already
> sailed.

I agree with "the ship has already sailed" but I disagree with the
rest of your comment.  The ship has already sailed in that we have
an established behaviour which has been there for 18 months.  Given
the time period, it's not something I'm going to change at this
stage, sorry.

Why?  Such a change will go unnoticed, and it's particularly hard
to debug why battery life has reduced.

I guess we need to find a way to ensure that the default behaviour
stays.  Whether that's by _everyone_ updating their DT files with
the new properties or some other way, I don't care.  I only care
that we retain the behaviour we've had for the last 18 months.

-- 
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v2 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-04-27  8:59           ` Russell King - ARM Linux
@ 2016-04-27 12:48             ` Rob Herring
  2016-04-27 14:08               ` Brad Mouring
  2016-04-28 13:57               ` Russell King - ARM Linux
  0 siblings, 2 replies; 29+ messages in thread
From: Rob Herring @ 2016-04-27 12:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 27, 2016 at 3:59 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Wed, Apr 20, 2016 at 09:04:39AM -0500, Rob Herring wrote:
>> On Tue, Apr 19, 2016 at 5:41 PM, Russell King - ARM Linux
>> <linux@arm.linux.org.uk> wrote:
>> > On Tue, Apr 19, 2016 at 04:38:14PM -0500, Rob Herring wrote:
>> >> On Mon, Apr 18, 2016 at 4:36 PM, Brad Mouring <brad.mouring@ni.com> wrote:
>> >> > Document the DT bindings for controlling ARM PL310 Power Control
>> >> > settings.
>> >> >
>> >> > Signed-off-by: Brad Mouring <brad.mouring@ni.com>
>> >>
>> >> What happened to Josh's ack?
>> >>
>> >> > ---
>> >> >  Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
>> >> >  1 file changed, 4 insertions(+)
>> >> >
>> >> > diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
>> >> > index fe0398c..c1c756e 100644
>> >> > --- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
>> >> > +++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
>> >> > @@ -84,6 +84,10 @@ Optional properties:
>> >> >  - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
>> >> >    <1> (forcibly enable), property absent (retain settings set by
>> >> >    firmware)
>> >> > +- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
>> >> > +  disable), <1> or property absent (forcibly enable)
>> >> > +- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
>> >> > +  <1>  or property absent (forcibly enable)
>> >>
>> >> What happened to "retain settings set by firmware"?
>> >
>> > I said we shouldn't.  Current behaviour is that we enable these features,
>> > and moving to missing-means-retain means that everything today ends up
>> > with these features disabled.  IOW, it's yet another change of actual
>> > behaviour that every platform would see.
>>
>> Right, but then the properties are different from prefetch-instr and
>> others IIRC. We're letting the OS define the binding. If BSD doesn't
>> enable these settings currently, then there is a mismatch between the
>> binding and actual behavior. Saying "retain firmware settings" also
>> defines specific OS behavior. I think absent should mean OS is free to
>> do whatever it wants which could be retain firmware settings, enable
>> or disable. In other words, it is undefined as this ship has already
>> sailed.
>
> I agree with "the ship has already sailed" but I disagree with the
> rest of your comment.  The ship has already sailed in that we have
> an established behaviour which has been there for 18 months.  Given
> the time period, it's not something I'm going to change at this
> stage, sorry.
>
> Why?  Such a change will go unnoticed, and it's particularly hard
> to debug why battery life has reduced.
>
> I guess we need to find a way to ensure that the default behaviour
> stays.  Whether that's by _everyone_ updating their DT files with
> the new properties or some other way, I don't care.  I only care
> that we retain the behaviour we've had for the last 18 months.

I'm not suggesting that we change behavior at all. I'm only suggesting
that we leave it undefined in the binding documentation because the
behavior is possibly OS specific and can't really be defined there.

Rob

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v2 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-04-27 12:48             ` Rob Herring
@ 2016-04-27 14:08               ` Brad Mouring
  2016-04-27 14:34                 ` Rob Herring
  2016-04-28 13:57               ` Russell King - ARM Linux
  1 sibling, 1 reply; 29+ messages in thread
From: Brad Mouring @ 2016-04-27 14:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 27, 2016 at 07:48:18AM -0500, Rob Herring wrote:
> On Wed, Apr 27, 2016 at 3:59 AM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > On Wed, Apr 20, 2016 at 09:04:39AM -0500, Rob Herring wrote:
> >> On Tue, Apr 19, 2016 at 5:41 PM, Russell King - ARM Linux
> >> <linux@arm.linux.org.uk> wrote:
> >> > On Tue, Apr 19, 2016 at 04:38:14PM -0500, Rob Herring wrote:
> >> >> On Mon, Apr 18, 2016 at 4:36 PM, Brad Mouring <brad.mouring@ni.com> wrote:
> >> >> > Document the DT bindings for controlling ARM PL310 Power Control
> >> >> > settings.
> >> >> >
> >> >> > Signed-off-by: Brad Mouring <brad.mouring@ni.com>
> >> >>
> >> >> What happened to Josh's ack?
> >> >>
> >> >> > ---
> >> >> >  Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
> >> >> >  1 file changed, 4 insertions(+)
> >> >> >
> >> >> > diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
> >> >> > index fe0398c..c1c756e 100644
> >> >> > --- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
> >> >> > +++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
> >> >> > @@ -84,6 +84,10 @@ Optional properties:
> >> >> >  - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
> >> >> >    <1> (forcibly enable), property absent (retain settings set by
> >> >> >    firmware)
> >> >> > +- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
> >> >> > +  disable), <1> or property absent (forcibly enable)
> >> >> > +- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
> >> >> > +  <1>  or property absent (forcibly enable)
> >> >>
> >> >> What happened to "retain settings set by firmware"?
> >> >
> >> > I said we shouldn't.  Current behaviour is that we enable these features,
> >> > and moving to missing-means-retain means that everything today ends up
> >> > with these features disabled.  IOW, it's yet another change of actual
> >> > behaviour that every platform would see.
> >>
> >> Right, but then the properties are different from prefetch-instr and
> >> others IIRC. We're letting the OS define the binding. If BSD doesn't
> >> enable these settings currently, then there is a mismatch between the
> >> binding and actual behavior. Saying "retain firmware settings" also
> >> defines specific OS behavior. I think absent should mean OS is free to
> >> do whatever it wants which could be retain firmware settings, enable
> >> or disable. In other words, it is undefined as this ship has already
> >> sailed.
> >
> > I agree with "the ship has already sailed" but I disagree with the
> > rest of your comment.  The ship has already sailed in that we have
> > an established behaviour which has been there for 18 months.  Given
> > the time period, it's not something I'm going to change at this
> > stage, sorry.
> >
> > Why?  Such a change will go unnoticed, and it's particularly hard
> > to debug why battery life has reduced.
> >
> > I guess we need to find a way to ensure that the default behaviour
> > stays.  Whether that's by _everyone_ updating their DT files with
> > the new properties or some other way, I don't care.  I only care
> > that we retain the behaviour we've had for the last 18 months.
> 
> I'm not suggesting that we change behavior at all. I'm only suggesting
> that we leave it undefined in the binding documentation because the
> behavior is possibly OS specific and can't really be defined there.
>
> Rob

Ah, thanks for clarifying. However, I do have some additional
clarifying questions:

When you note that it should be left undefined in the binding
documentation, do you mean document the actual, well-defined behavior
and leave it at that, or document the well-defined behavior and note
that, in the case where the binding is missing, behavior is OS
specific (my interpretation of your comment), or completely removed
from the documentation altogether (I'd want to know the reasoning if
this is what you meant, for my own edification).

Thanks as always for the feedback

Brad

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v2 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-04-27 14:08               ` Brad Mouring
@ 2016-04-27 14:34                 ` Rob Herring
  0 siblings, 0 replies; 29+ messages in thread
From: Rob Herring @ 2016-04-27 14:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 27, 2016 at 9:08 AM, Brad Mouring <brad.mouring@ni.com> wrote:
> On Wed, Apr 27, 2016 at 07:48:18AM -0500, Rob Herring wrote:
>> On Wed, Apr 27, 2016 at 3:59 AM, Russell King - ARM Linux
>> <linux@arm.linux.org.uk> wrote:
>> > On Wed, Apr 20, 2016 at 09:04:39AM -0500, Rob Herring wrote:
>> >> On Tue, Apr 19, 2016 at 5:41 PM, Russell King - ARM Linux
>> >> <linux@arm.linux.org.uk> wrote:
>> >> > On Tue, Apr 19, 2016 at 04:38:14PM -0500, Rob Herring wrote:
>> >> >> On Mon, Apr 18, 2016 at 4:36 PM, Brad Mouring <brad.mouring@ni.com> wrote:
>> >> >> > Document the DT bindings for controlling ARM PL310 Power Control
>> >> >> > settings.
>> >> >> >
>> >> >> > Signed-off-by: Brad Mouring <brad.mouring@ni.com>
>> >> >>
>> >> >> What happened to Josh's ack?
>> >> >>
>> >> >> > ---
>> >> >> >  Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
>> >> >> >  1 file changed, 4 insertions(+)
>> >> >> >
>> >> >> > diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
>> >> >> > index fe0398c..c1c756e 100644
>> >> >> > --- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
>> >> >> > +++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
>> >> >> > @@ -84,6 +84,10 @@ Optional properties:
>> >> >> >  - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
>> >> >> >    <1> (forcibly enable), property absent (retain settings set by
>> >> >> >    firmware)
>> >> >> > +- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
>> >> >> > +  disable), <1> or property absent (forcibly enable)
>> >> >> > +- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
>> >> >> > +  <1>  or property absent (forcibly enable)
>> >> >>
>> >> >> What happened to "retain settings set by firmware"?
>> >> >
>> >> > I said we shouldn't.  Current behaviour is that we enable these features,
>> >> > and moving to missing-means-retain means that everything today ends up
>> >> > with these features disabled.  IOW, it's yet another change of actual
>> >> > behaviour that every platform would see.
>> >>
>> >> Right, but then the properties are different from prefetch-instr and
>> >> others IIRC. We're letting the OS define the binding. If BSD doesn't
>> >> enable these settings currently, then there is a mismatch between the
>> >> binding and actual behavior. Saying "retain firmware settings" also
>> >> defines specific OS behavior. I think absent should mean OS is free to
>> >> do whatever it wants which could be retain firmware settings, enable
>> >> or disable. In other words, it is undefined as this ship has already
>> >> sailed.
>> >
>> > I agree with "the ship has already sailed" but I disagree with the
>> > rest of your comment.  The ship has already sailed in that we have
>> > an established behaviour which has been there for 18 months.  Given
>> > the time period, it's not something I'm going to change at this
>> > stage, sorry.
>> >
>> > Why?  Such a change will go unnoticed, and it's particularly hard
>> > to debug why battery life has reduced.
>> >
>> > I guess we need to find a way to ensure that the default behaviour
>> > stays.  Whether that's by _everyone_ updating their DT files with
>> > the new properties or some other way, I don't care.  I only care
>> > that we retain the behaviour we've had for the last 18 months.
>>
>> I'm not suggesting that we change behavior at all. I'm only suggesting
>> that we leave it undefined in the binding documentation because the
>> behavior is possibly OS specific and can't really be defined there.
>>
>> Rob
>
> Ah, thanks for clarifying. However, I do have some additional
> clarifying questions:
>
> When you note that it should be left undefined in the binding
> documentation, do you mean document the actual, well-defined behavior
> and leave it at that, or document the well-defined behavior and note
> that, in the case where the binding is missing, behavior is OS
> specific (my interpretation of your comment), or completely removed
> from the documentation altogether (I'd want to know the reasoning if
> this is what you meant, for my own edification).

The 2nd case. Missing property should be documented as undefined or OS
specific. However, that does make this property different from others
already present. So perhaps we should document recommended OS behavior
even though Linux doesn't follow it. Something like: "If not present,
retaining the firmware setting is recommended. However, the actual
behavior may be OS specific."

Rob

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v3 0/2] Control PL310 pwr_ctrl register through DT
  2016-04-18 21:36 ` [PATCH v2 0/2] Control PL310 pwr_ctrl register through DT Brad Mouring
  2016-04-18 21:36   ` [PATCH v2 1/2] pl2x0: Add OF control of cache power management Brad Mouring
  2016-04-18 21:36   ` [PATCH v2 2/2] Documentation: devicetree: Add PL310 PM bindings Brad Mouring
@ 2016-04-27 15:35   ` Brad Mouring
  2016-04-27 15:35     ` [PATCH v3 1/2] arm: pl2x0: Add OF control of cache power management Brad Mouring
  2016-04-27 15:35     ` [PATCH 2/2] Documentation: devicetree: Add PL310 PM bindings Brad Mouring
  2 siblings, 2 replies; 29+ messages in thread
From: Brad Mouring @ 2016-04-27 15:35 UTC (permalink / raw)
  To: linux-arm-kernel


This revision of the patches addresses the concerns on documenting
the DT bindings brought up here:
http://www.spinics.net/lists/arm-kernel/msg500784.html

The technical change remains functionally the same, however v2 was
needlessly setting the bits twice in the case that the binding
existed and was non-zero.

Thanks!

Brad

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH v3 1/2] arm: pl2x0: Add OF control of cache power management
  2016-04-27 15:35   ` [PATCH v3 0/2] Control PL310 pwr_ctrl register through DT Brad Mouring
@ 2016-04-27 15:35     ` Brad Mouring
  2016-04-27 15:35     ` [PATCH 2/2] Documentation: devicetree: Add PL310 PM bindings Brad Mouring
  1 sibling, 0 replies; 29+ messages in thread
From: Brad Mouring @ 2016-04-27 15:35 UTC (permalink / raw)
  To: linux-arm-kernel

Add ability to override power management bits of 310 controllers
(dynamic clock gating and standby mode) through OF entries. As the
saved register is only applied when working on a supported controller,
it is safe to save the settings.

In order to maintain existing behavior, if the settings are not found
in the DT, the corresponding feature will be enabled.

Signed-off-by: Brad Mouring <brad.mouring@ni.com>
---
 arch/arm/mm/cache-l2x0.c | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 9f9d542..c61996c 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -647,11 +647,6 @@ static void __init l2c310_enable(void __iomem *base, unsigned num_lock)
 		aux &= ~(L310_AUX_CTRL_FULL_LINE_ZERO | L310_AUX_CTRL_EARLY_BRESP);
 	}
 
-	/* r3p0 or later has power control register */
-	if (rev >= L310_CACHE_ID_RTL_R3P0)
-		l2x0_saved_regs.pwr_ctrl = L310_DYNAMIC_CLK_GATING_EN |
-						L310_STNDBY_MODE_EN;
-
 	/*
 	 * Always enable non-secure access to the lockdown registers -
 	 * we write to them as part of the L2C enable sequence so they
@@ -1141,6 +1136,7 @@ static void __init l2c310_of_parse(const struct device_node *np,
 	u32 filter[2] = { 0, 0 };
 	u32 assoc;
 	u32 prefetch;
+	u32 power;
 	u32 val;
 	int ret;
 
@@ -1271,6 +1267,26 @@ static void __init l2c310_of_parse(const struct device_node *np,
 	}
 
 	l2x0_saved_regs.prefetch_ctrl = prefetch;
+
+	power = l2x0_saved_regs.pwr_ctrl |
+		L310_DYNAMIC_CLK_GATING_EN | L310_STNDBY_MODE_EN;
+
+	ret = of_property_read_u32(np, "arm,dynamic-clock-gating", &val);
+	if (!ret) {
+		if (!val)
+			power &= ~L310_DYNAMIC_CLK_GATING_EN;
+	} else if (ret != -EINVAL) {
+		pr_err("L2C-310 OF dynamic-clock-gating property value is missing or invalid\n");
+	}
+	ret = of_property_read_u32(np, "arm,standby-mode", &val);
+	if (!ret) {
+		if (!val)
+			power &= ~L310_STNDBY_MODE_EN;
+	} else if (ret != -EINVAL) {
+		pr_err("L2C-310 OF standby-mode property value is missing or invalid\n");
+	}
+
+	l2x0_saved_regs.pwr_ctrl = power;
 }
 
 static const struct l2c_init_data of_l2c310_data __initconst = {
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-04-27 15:35   ` [PATCH v3 0/2] Control PL310 pwr_ctrl register through DT Brad Mouring
  2016-04-27 15:35     ` [PATCH v3 1/2] arm: pl2x0: Add OF control of cache power management Brad Mouring
@ 2016-04-27 15:35     ` Brad Mouring
  2016-04-28 19:56       ` Rob Herring
  1 sibling, 1 reply; 29+ messages in thread
From: Brad Mouring @ 2016-04-27 15:35 UTC (permalink / raw)
  To: linux-arm-kernel

Document the DT bindings for controlling ARM PL310 Power Control
settings.

Discussion on the binding wording:
http://archive.arm.linux.org.uk/lurker/message/20160427.143444.5141d302.en.html

Signed-off-by: Brad Mouring <brad.mouring@ni.com>
---
 Documentation/devicetree/bindings/arm/l2c2x0.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
index fe0398c..c453ab5 100644
--- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
+++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
@@ -84,6 +84,12 @@ Optional properties:
 - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
   <1> (forcibly enable), property absent (retain settings set by
   firmware)
+- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
+  disable), <1> (forcibly enable), property absent (OS specific behavior,
+  preferrably retain firmware settings)
+- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
+  <1> (forcibly enable), property absent (OS specific behavior,
+  preferrably retain firmware settings)
 
 Example:
 
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH v2 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-04-27 12:48             ` Rob Herring
  2016-04-27 14:08               ` Brad Mouring
@ 2016-04-28 13:57               ` Russell King - ARM Linux
  1 sibling, 0 replies; 29+ messages in thread
From: Russell King - ARM Linux @ 2016-04-28 13:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 27, 2016 at 07:48:18AM -0500, Rob Herring wrote:
> On Wed, Apr 27, 2016 at 3:59 AM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > On Wed, Apr 20, 2016 at 09:04:39AM -0500, Rob Herring wrote:
> >> On Tue, Apr 19, 2016 at 5:41 PM, Russell King - ARM Linux
> >> <linux@arm.linux.org.uk> wrote:
> >> > On Tue, Apr 19, 2016 at 04:38:14PM -0500, Rob Herring wrote:
> >> >> On Mon, Apr 18, 2016 at 4:36 PM, Brad Mouring <brad.mouring@ni.com> wrote:
> >> >> > Document the DT bindings for controlling ARM PL310 Power Control
> >> >> > settings.
> >> >> >
> >> >> > Signed-off-by: Brad Mouring <brad.mouring@ni.com>
> >> >>
> >> >> What happened to Josh's ack?
> >> >>
> >> >> > ---
> >> >> >  Documentation/devicetree/bindings/arm/l2c2x0.txt | 4 ++++
> >> >> >  1 file changed, 4 insertions(+)
> >> >> >
> >> >> > diff --git a/Documentation/devicetree/bindings/arm/l2c2x0.txt b/Documentation/devicetree/bindings/arm/l2c2x0.txt
> >> >> > index fe0398c..c1c756e 100644
> >> >> > --- a/Documentation/devicetree/bindings/arm/l2c2x0.txt
> >> >> > +++ b/Documentation/devicetree/bindings/arm/l2c2x0.txt
> >> >> > @@ -84,6 +84,10 @@ Optional properties:
> >> >> >  - prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
> >> >> >    <1> (forcibly enable), property absent (retain settings set by
> >> >> >    firmware)
> >> >> > +- arm,dynamic-clock-gating : L2 dynamic clock gating. Value: <0> (forcibly
> >> >> > +  disable), <1> or property absent (forcibly enable)
> >> >> > +- arm,standby-mode: L2 standby mode enable. Value <0> (forcibly disable),
> >> >> > +  <1>  or property absent (forcibly enable)
> >> >>
> >> >> What happened to "retain settings set by firmware"?
> >> >
> >> > I said we shouldn't.  Current behaviour is that we enable these features,
> >> > and moving to missing-means-retain means that everything today ends up
> >> > with these features disabled.  IOW, it's yet another change of actual
> >> > behaviour that every platform would see.
> >>
> >> Right, but then the properties are different from prefetch-instr and
> >> others IIRC. We're letting the OS define the binding. If BSD doesn't
> >> enable these settings currently, then there is a mismatch between the
> >> binding and actual behavior. Saying "retain firmware settings" also
> >> defines specific OS behavior. I think absent should mean OS is free to
> >> do whatever it wants which could be retain firmware settings, enable
> >> or disable. In other words, it is undefined as this ship has already
> >> sailed.
> >
> > I agree with "the ship has already sailed" but I disagree with the
> > rest of your comment.  The ship has already sailed in that we have
> > an established behaviour which has been there for 18 months.  Given
> > the time period, it's not something I'm going to change at this
> > stage, sorry.
> >
> > Why?  Such a change will go unnoticed, and it's particularly hard
> > to debug why battery life has reduced.
> >
> > I guess we need to find a way to ensure that the default behaviour
> > stays.  Whether that's by _everyone_ updating their DT files with
> > the new properties or some other way, I don't care.  I only care
> > that we retain the behaviour we've had for the last 18 months.
> 
> I'm not suggesting that we change behavior at all. I'm only suggesting
> that we leave it undefined in the binding documentation because the
> behavior is possibly OS specific and can't really be defined there.

Ok.

-- 
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 2/2] Documentation: devicetree: Add PL310 PM bindings
  2016-04-27 15:35     ` [PATCH 2/2] Documentation: devicetree: Add PL310 PM bindings Brad Mouring
@ 2016-04-28 19:56       ` Rob Herring
  0 siblings, 0 replies; 29+ messages in thread
From: Rob Herring @ 2016-04-28 19:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 27, 2016 at 10:35 AM, Brad Mouring <brad.mouring@ni.com> wrote:
> Document the DT bindings for controlling ARM PL310 Power Control
> settings.
>
> Discussion on the binding wording:
> http://archive.arm.linux.org.uk/lurker/message/20160427.143444.5141d302.en.html
>
> Signed-off-by: Brad Mouring <brad.mouring@ni.com>
> ---
>  Documentation/devicetree/bindings/arm/l2c2x0.txt | 6 ++++++
>  1 file changed, 6 insertions(+)

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2016-04-28 19:56 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-23 22:03 [PATCH 0/2] Control PL310 pwr_ctrl register through DT Brad Mouring
2016-02-23 22:03 ` Brad Mouring
     [not found] ` <1456265019-23900-1-git-send-email-brad.mouring-acOepvfBmUk@public.gmane.org>
2016-02-23 22:03   ` [PATCH 1/2] pl2x0: Add OF control of cache power management Brad Mouring
2016-02-23 22:03     ` Brad Mouring
2016-02-23 22:03   ` [PATCH 2/2] Documentation: devicetree: Add PL310 PM bindings Brad Mouring
2016-02-23 22:03     ` Brad Mouring
     [not found]     ` <1456265019-23900-3-git-send-email-brad.mouring-acOepvfBmUk@public.gmane.org>
2016-02-24  1:33       ` Rob Herring
2016-02-24  1:33         ` Rob Herring
2016-02-29 16:01   ` [PATCH 1/2] pl2x0: Add OF control of cache power management Brad Mouring
2016-02-29 16:01     ` Brad Mouring
     [not found]     ` <1456761716-10174-1-git-send-email-brad.mouring-acOepvfBmUk@public.gmane.org>
2016-02-29 16:01       ` [PATCH 2/2] Documentation: devicetree: Add PL310 PM bindings Brad Mouring
2016-02-29 16:01         ` Brad Mouring
2016-04-18 21:36 ` [PATCH v2 0/2] Control PL310 pwr_ctrl register through DT Brad Mouring
2016-04-18 21:36   ` [PATCH v2 1/2] pl2x0: Add OF control of cache power management Brad Mouring
2016-04-18 21:36   ` [PATCH v2 2/2] Documentation: devicetree: Add PL310 PM bindings Brad Mouring
2016-04-19 21:38     ` Rob Herring
2016-04-19 22:41       ` Russell King - ARM Linux
2016-04-20 14:04         ` Rob Herring
2016-04-21 20:48           ` Brad Mouring
2016-04-27  8:59           ` Russell King - ARM Linux
2016-04-27 12:48             ` Rob Herring
2016-04-27 14:08               ` Brad Mouring
2016-04-27 14:34                 ` Rob Herring
2016-04-28 13:57               ` Russell King - ARM Linux
2016-04-20 14:23       ` Brad Mouring
2016-04-27 15:35   ` [PATCH v3 0/2] Control PL310 pwr_ctrl register through DT Brad Mouring
2016-04-27 15:35     ` [PATCH v3 1/2] arm: pl2x0: Add OF control of cache power management Brad Mouring
2016-04-27 15:35     ` [PATCH 2/2] Documentation: devicetree: Add PL310 PM bindings Brad Mouring
2016-04-28 19:56       ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.