linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] cpuidle: A few improvements for ARM cpuidle via DT
@ 2014-11-19 10:16 Daniel Lezcano
  2014-11-19 10:17 ` [PATCH 1/3] drivers: cpuidle: Add status property to ARM idle states Daniel Lezcano
  2014-11-21 15:56 ` [GIT PULL] cpuidle: A few improvements for ARM cpuidle via DT Rafael J. Wysocki
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel Lezcano @ 2014-11-19 10:16 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Lorenzo Pieralisi, Linux Kernel Mailing List,
	linux-pm >> Linux PM mailing list, linux-arm-kernel


Hi Rafael,

this pull request, based on 3.18-rc5, contains a set of changes from 
Lorenzo Pieralisi.

  * Added a 'status' definition flag in the DT to specify the 
unsupported firmware idle states and ignore those states in the parsing 
code when initializing the cpuidle driver

  * Added an idle state description in the DT. As the idle states are 
not standardized on ARM, the description gives information about the 
idle state

  * Removed duplicate error message in the arm64 cpuidle drivers

Thanks !

   -- Daniel


The following changes since commit fc14f9c1272f62c3e8d01300f52467c0d9af50f9:

   Linux 3.18-rc5 (2014-11-16 16:36:20 -0800)

are available in the git repository at:

   http://git.linaro.org/git-ro/people/daniel.lezcano/linux.git cpuidle/3.19

for you to fetch changes up to 18f95a3640dbf421ab9532e517070a0c1cd4d582:

   drivers: cpuidle: Remove cpuidle-arm64 duplicate error messages 
(2014-11-19 10:16:28 +0100)

----------------------------------------------------------------
Lorenzo Pieralisi (3):
       drivers: cpuidle: Add status property to ARM idle states
       drivers: cpuidle: Add idle-state-name description to ARM idle states
       drivers: cpuidle: Remove cpuidle-arm64 duplicate error messages

  Documentation/devicetree/bindings/arm/idle-states.txt | 20 
++++++++++++++++++++
  drivers/cpuidle/cpuidle-arm64.c                       | 13 ++-----------
  drivers/cpuidle/dt_idle_states.c                      | 10 +++++++++-
  3 files changed, 31 insertions(+), 12 deletions(-)

-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

* [PATCH 1/3] drivers: cpuidle: Add status property to ARM idle states
  2014-11-19 10:16 [GIT PULL] cpuidle: A few improvements for ARM cpuidle via DT Daniel Lezcano
@ 2014-11-19 10:17 ` Daniel Lezcano
  2014-11-19 10:17   ` [PATCH 2/3] drivers: cpuidle: Add idle-state-name description " Daniel Lezcano
  2014-11-19 10:17   ` [PATCH 3/3] drivers: cpuidle: Remove cpuidle-arm64 duplicate error messages Daniel Lezcano
  2014-11-21 15:56 ` [GIT PULL] cpuidle: A few improvements for ARM cpuidle via DT Rafael J. Wysocki
  1 sibling, 2 replies; 6+ messages in thread
From: Daniel Lezcano @ 2014-11-19 10:17 UTC (permalink / raw)
  To: rjw; +Cc: Lorenzo.Pieralisi, linux-kernel, linux-pm, linux-arm-kernel

From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

On some platforms the device tree bindings must provide the kernel
with a status flag for idle states, that defines whether the idle
state is operational or not in the current configuration.

This patch adds a status property to the ARM idle states compliant
with ePAPR v1.1 and updates the DT parsing code accordingly.

Acked-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 Documentation/devicetree/bindings/arm/idle-states.txt | 14 ++++++++++++++
 drivers/cpuidle/dt_idle_states.c                      |  3 +++
 2 files changed, 17 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/idle-states.txt b/Documentation/devicetree/bindings/arm/idle-states.txt
index 37375c7..5e51511 100644
--- a/Documentation/devicetree/bindings/arm/idle-states.txt
+++ b/Documentation/devicetree/bindings/arm/idle-states.txt
@@ -317,6 +317,20 @@ follows:
 			    In such systems entry-latency-us + exit-latency-us
 			    will exceed wakeup-latency-us by this duration.
 
+	- status:
+		Usage: Optional
+		Value type: <string>
+		Definition: A standard device tree property [5] that indicates
+			    the operational status of an idle-state.
+			    If present, it shall be:
+			    "okay": to indicate that the idle state is
+				    operational.
+			    "disabled": to indicate that the idle state has
+					been disabled in firmware so it is not
+					operational.
+			    If the property is not present the idle-state must
+			    be considered operational.
+
 	In addition to the properties listed above, a state node may require
 	additional properties specifics to the entry-method defined in the
 	idle-states node, please refer to the entry-method bindings
diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c
index 52f4d11..22840f4 100644
--- a/drivers/cpuidle/dt_idle_states.c
+++ b/drivers/cpuidle/dt_idle_states.c
@@ -169,6 +169,9 @@ int dt_init_idle_driver(struct cpuidle_driver *drv,
 		if (!state_node)
 			break;
 
+		if (!of_device_is_available(state_node))
+			continue;
+
 		if (!idle_state_valid(state_node, i, cpumask)) {
 			pr_warn("%s idle state not valid, bailing out\n",
 				state_node->full_name);
-- 
1.9.1


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

* [PATCH 2/3] drivers: cpuidle: Add idle-state-name description to ARM idle states
  2014-11-19 10:17 ` [PATCH 1/3] drivers: cpuidle: Add status property to ARM idle states Daniel Lezcano
@ 2014-11-19 10:17   ` Daniel Lezcano
  2014-11-19 10:17   ` [PATCH 3/3] drivers: cpuidle: Remove cpuidle-arm64 duplicate error messages Daniel Lezcano
  1 sibling, 0 replies; 6+ messages in thread
From: Daniel Lezcano @ 2014-11-19 10:17 UTC (permalink / raw)
  To: rjw; +Cc: Lorenzo.Pieralisi, linux-kernel, linux-pm, linux-arm-kernel

From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

On ARM machines, where generally speaking the idle state numbering has
no fixed and standard meaning it is useful to provide a description
of the idle state inner workings for benchmarking and monitoring purposes.

This patch adds a property to the idle states bindings that if present
gives platform firmware a means of describing the idle state and export
the string description to user space.

The patch updates the DT parsing code accordingly to take the description,
if present, into consideration.

Acked-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 Documentation/devicetree/bindings/arm/idle-states.txt | 6 ++++++
 drivers/cpuidle/dt_idle_states.c                      | 7 ++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/arm/idle-states.txt b/Documentation/devicetree/bindings/arm/idle-states.txt
index 5e51511..a8274ea 100644
--- a/Documentation/devicetree/bindings/arm/idle-states.txt
+++ b/Documentation/devicetree/bindings/arm/idle-states.txt
@@ -331,6 +331,12 @@ follows:
 			    If the property is not present the idle-state must
 			    be considered operational.
 
+	- idle-state-name:
+		Usage: Optional
+		Value type: <string>
+		Definition: A string used as a descriptive name for the idle
+			    state.
+
 	In addition to the properties listed above, a state node may require
 	additional properties specifics to the entry-method defined in the
 	idle-states node, please refer to the entry-method bindings
diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c
index 22840f4..5301912 100644
--- a/drivers/cpuidle/dt_idle_states.c
+++ b/drivers/cpuidle/dt_idle_states.c
@@ -27,6 +27,7 @@ static int init_state_node(struct cpuidle_state *idle_state,
 {
 	int err;
 	const struct of_device_id *match_id;
+	const char *desc;
 
 	match_id = of_match_node(matches, state_node);
 	if (!match_id)
@@ -73,6 +74,10 @@ static int init_state_node(struct cpuidle_state *idle_state,
 		return -EINVAL;
 	}
 
+	err = of_property_read_string(state_node, "idle-state-name", &desc);
+	if (err)
+		desc = state_node->name;
+
 	idle_state->flags = CPUIDLE_FLAG_TIME_VALID;
 	if (of_property_read_bool(state_node, "local-timer-stop"))
 		idle_state->flags |= CPUIDLE_FLAG_TIMER_STOP;
@@ -82,7 +87,7 @@ static int init_state_node(struct cpuidle_state *idle_state,
 	 *	and desc become string pointers
 	 */
 	strncpy(idle_state->name, state_node->name, CPUIDLE_NAME_LEN - 1);
-	strncpy(idle_state->desc, state_node->name, CPUIDLE_DESC_LEN - 1);
+	strncpy(idle_state->desc, desc, CPUIDLE_DESC_LEN - 1);
 	return 0;
 }
 
-- 
1.9.1


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

* [PATCH 3/3] drivers: cpuidle: Remove cpuidle-arm64 duplicate error messages
  2014-11-19 10:17 ` [PATCH 1/3] drivers: cpuidle: Add status property to ARM idle states Daniel Lezcano
  2014-11-19 10:17   ` [PATCH 2/3] drivers: cpuidle: Add idle-state-name description " Daniel Lezcano
@ 2014-11-19 10:17   ` Daniel Lezcano
  1 sibling, 0 replies; 6+ messages in thread
From: Daniel Lezcano @ 2014-11-19 10:17 UTC (permalink / raw)
  To: rjw; +Cc: Lorenzo.Pieralisi, linux-kernel, linux-pm, linux-arm-kernel

From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

Current CPUidle driver for arm64 machines spits errors upon idle
state initialization and cpuidle driver registration failures.
These error messages are already printed in core code so there is
no need to print them again.

This patch removes the duplicate print messages from the cpuidle-arm64
driver.

Acked-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/cpuidle/cpuidle-arm64.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-arm64.c b/drivers/cpuidle/cpuidle-arm64.c
index 50997ea..1b10f92e 100644
--- a/drivers/cpuidle/cpuidle-arm64.c
+++ b/drivers/cpuidle/cpuidle-arm64.c
@@ -104,11 +104,8 @@ static int __init arm64_idle_init(void)
 	 * reason to initialize the idle driver if only wfi is supported.
 	 */
 	ret = dt_init_idle_driver(drv, arm64_idle_state_match, 1);
-	if (ret <= 0) {
-		if (ret)
-			pr_err("failed to initialize idle states\n");
+	if (ret <= 0)
 		return ret ? : -ENODEV;
-	}
 
 	/*
 	 * Call arch CPU operations in order to initialize
@@ -122,12 +119,6 @@ static int __init arm64_idle_init(void)
 		}
 	}
 
-	ret = cpuidle_register(drv, NULL);
-	if (ret) {
-		pr_err("failed to register cpuidle driver\n");
-		return ret;
-	}
-
-	return 0;
+	return cpuidle_register(drv, NULL);
 }
 device_initcall(arm64_idle_init);
-- 
1.9.1


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

* Re: [GIT PULL] cpuidle: A few improvements for ARM cpuidle via DT
  2014-11-19 10:16 [GIT PULL] cpuidle: A few improvements for ARM cpuidle via DT Daniel Lezcano
  2014-11-19 10:17 ` [PATCH 1/3] drivers: cpuidle: Add status property to ARM idle states Daniel Lezcano
@ 2014-11-21 15:56 ` Rafael J. Wysocki
  2014-11-21 16:13   ` Daniel Lezcano
  1 sibling, 1 reply; 6+ messages in thread
From: Rafael J. Wysocki @ 2014-11-21 15:56 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Lorenzo Pieralisi, Linux Kernel Mailing List,
	linux-pm >> Linux PM mailing list, linux-arm-kernel

On Wednesday, November 19, 2014 11:16:11 AM Daniel Lezcano wrote:
> 
> Hi Rafael,
> 
> this pull request, based on 3.18-rc5, contains a set of changes from 
> Lorenzo Pieralisi.
> 
>   * Added a 'status' definition flag in the DT to specify the 
> unsupported firmware idle states and ignore those states in the parsing 
> code when initializing the cpuidle driver
> 
>   * Added an idle state description in the DT. As the idle states are 
> not standardized on ARM, the description gives information about the 
> idle state
> 
>   * Removed duplicate error message in the arm64 cpuidle drivers
> 
> Thanks !
> 
>    -- Daniel
> 
> 
> The following changes since commit fc14f9c1272f62c3e8d01300f52467c0d9af50f9:
> 
>    Linux 3.18-rc5 (2014-11-16 16:36:20 -0800)
> 
> are available in the git repository at:
> 
>    http://git.linaro.org/git-ro/people/daniel.lezcano/linux.git cpuidle/3.19
> 
> for you to fetch changes up to 18f95a3640dbf421ab9532e517070a0c1cd4d582:
> 
>    drivers: cpuidle: Remove cpuidle-arm64 duplicate error messages 
> (2014-11-19 10:16:28 +0100)

Pulled, but I had a conflict with one patch from you I'd already queued up for
3.19-rc1.

Can you please have a look at my bleeding-edge branch and check if I resolved
the conflict correctly?

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [GIT PULL] cpuidle: A few improvements for ARM cpuidle via DT
  2014-11-21 15:56 ` [GIT PULL] cpuidle: A few improvements for ARM cpuidle via DT Rafael J. Wysocki
@ 2014-11-21 16:13   ` Daniel Lezcano
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Lezcano @ 2014-11-21 16:13 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Lorenzo Pieralisi, Linux Kernel Mailing List,
	linux-pm >> Linux PM mailing list, linux-arm-kernel

On 11/21/2014 04:56 PM, Rafael J. Wysocki wrote:
> On Wednesday, November 19, 2014 11:16:11 AM Daniel Lezcano wrote:
>>
>> Hi Rafael,
>>
>> this pull request, based on 3.18-rc5, contains a set of changes from
>> Lorenzo Pieralisi.
>>
>>    * Added a 'status' definition flag in the DT to specify the
>> unsupported firmware idle states and ignore those states in the parsing
>> code when initializing the cpuidle driver
>>
>>    * Added an idle state description in the DT. As the idle states are
>> not standardized on ARM, the description gives information about the
>> idle state
>>
>>    * Removed duplicate error message in the arm64 cpuidle drivers
>>
>> Thanks !
>>
>>     -- Daniel
>>
>>
>> The following changes since commit fc14f9c1272f62c3e8d01300f52467c0d9af50f9:
>>
>>     Linux 3.18-rc5 (2014-11-16 16:36:20 -0800)
>>
>> are available in the git repository at:
>>
>>     http://git.linaro.org/git-ro/people/daniel.lezcano/linux.git cpuidle/3.19
>>
>> for you to fetch changes up to 18f95a3640dbf421ab9532e517070a0c1cd4d582:
>>
>>     drivers: cpuidle: Remove cpuidle-arm64 duplicate error messages
>> (2014-11-19 10:16:28 +0100)
>
> Pulled, but I had a conflict with one patch from you I'd already queued up for
> 3.19-rc1.
>
> Can you please have a look at my bleeding-edge branch and check if I resolved
> the conflict correctly?

Hi Rafael,

yes the conflict is correctly resolved.

Thanks
   -- Daniel



-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

end of thread, other threads:[~2014-11-21 16:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-19 10:16 [GIT PULL] cpuidle: A few improvements for ARM cpuidle via DT Daniel Lezcano
2014-11-19 10:17 ` [PATCH 1/3] drivers: cpuidle: Add status property to ARM idle states Daniel Lezcano
2014-11-19 10:17   ` [PATCH 2/3] drivers: cpuidle: Add idle-state-name description " Daniel Lezcano
2014-11-19 10:17   ` [PATCH 3/3] drivers: cpuidle: Remove cpuidle-arm64 duplicate error messages Daniel Lezcano
2014-11-21 15:56 ` [GIT PULL] cpuidle: A few improvements for ARM cpuidle via DT Rafael J. Wysocki
2014-11-21 16:13   ` Daniel Lezcano

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).