diff mbox series

[2/2] cpuidle: dt: Add support to keep idle state disabled

Message ID 20230608085544.16211-4-quic_tnimkar@quicinc.com
State New
Headers show
Series Add provision to keep idle state disabled | expand

Commit Message

Tushar Nimkar June 8, 2023, 8:55 a.m. UTC
Mark the idle state as disabled using CPUIDLE_FLAG_OFF when
idle-state-disabled property is present.

Such idle states stays disabled and can be enabled using below command.

echo N > /sys/devices/system/cpu/cpuX/cpuidle/stateX/disable

Signed-off-by: Tushar Nimkar <quic_tnimkar@quicinc.com>
---
 drivers/cpuidle/dt_idle_states.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c
index 12fec92a85fd..3d50181512a3 100644
--- a/drivers/cpuidle/dt_idle_states.c
+++ b/drivers/cpuidle/dt_idle_states.c
@@ -79,6 +79,9 @@  static int init_state_node(struct cpuidle_state *idle_state,
 	idle_state->flags = CPUIDLE_FLAG_RCU_IDLE;
 	if (of_property_read_bool(state_node, "local-timer-stop"))
 		idle_state->flags |= CPUIDLE_FLAG_TIMER_STOP;
+
+	if (of_property_read_bool(state_node, "idle-state-disabled"))
+		idle_state->flags |= CPUIDLE_FLAG_OFF;
 	/*
 	 * TODO:
 	 *	replace with kstrdup and pointer assignment when name