All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tushar Nimkar <quic_tnimkar@quicinc.com>
To: "Rafael J . Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: <linux-pm@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <quic_lsrao@quicinc.com>,
	<quic_mkshah@quicinc.com>,
	Tushar Nimkar <quic_tnimkar@quicinc.com>
Subject: [PATCH 2/2] cpuidle: dt: Add support to keep idle state disabled
Date: Thu, 8 Jun 2023 14:25:44 +0530	[thread overview]
Message-ID: <20230608085544.16211-4-quic_tnimkar@quicinc.com> (raw)
In-Reply-To: <20230608085544.16211-1-quic_tnimkar@quicinc.com>

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 --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
-- 
2.17.1


  parent reply	other threads:[~2023-06-08  8:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08  8:55 [PATCH 0/2] Add provision to keep idle state disabled Tushar Nimkar
2023-06-08  8:55 ` [PATCH 1/2] dt-bindings: arm: idle-states: Add idle-state-disabled property Tushar Nimkar
2023-06-08  9:19   ` Conor Dooley
2023-06-09  4:39     ` Tushar Nimkar
2023-06-09 13:14   ` Krzysztof Kozlowski
2023-06-14  6:45     ` Tushar Nimkar
2023-06-15  8:56   ` Sudeep Holla
2023-06-16  5:56     ` Tushar Nimkar
2023-06-16 15:39       ` Sudeep Holla
2023-06-21  6:27         ` Tushar Nimkar
2023-06-08  8:55 ` [PATCH 1/2] dt-bindings: cpu: " Tushar Nimkar
2023-06-09 13:15   ` Krzysztof Kozlowski
2023-06-08  8:55 ` Tushar Nimkar [this message]
2023-06-12 10:26 ` [PATCH 0/2] Add provision to keep idle state disabled Ulf Hansson
2023-06-14  6:43   ` Tushar Nimkar
2023-06-16 10:55     ` Ulf Hansson
2023-06-21  6:21       ` Tushar Nimkar
2023-06-22 13:01         ` Ulf Hansson
2023-06-26  6:44           ` Tushar Nimkar

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=20230608085544.16211-4-quic_tnimkar@quicinc.com \
    --to=quic_tnimkar@quicinc.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=quic_lsrao@quicinc.com \
    --cc=quic_mkshah@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.