lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230608085544.16211-4-quic_tnimkar@quicinc.com>
Date:   Thu, 8 Jun 2023 14:25:44 +0530
From:   Tushar Nimkar <quic_tnimkar@...cinc.com>
To:     "Rafael J . Wysocki" <rafael@...nel.org>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Ulf Hansson <ulf.hansson@...aro.org>
CC:     <linux-pm@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <quic_lsrao@...cinc.com>,
        <quic_mkshah@...cinc.com>, Tushar Nimkar <quic_tnimkar@...cinc.com>
Subject: [PATCH 2/2] cpuidle: dt: Add support to keep idle state disabled

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@...cinc.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ