Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752221AbdITEr2 (ORCPT ); Wed, 20 Sep 2017 00:47:28 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:46793 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751192AbdITErN (ORCPT ); Wed, 20 Sep 2017 00:47:13 -0400 X-Google-Smtp-Source: AOwi7QB6lENvvNGX3E9l96WN6OgUX96mDNgCAUlflVrHmh3MopsgnTiRrjEu1TrBQtk1+YoqJdLHLA== From: Leo Yan To: Mathieu Poirier , Jonathan Corbet , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Kim Phillips Cc: Leo Yan , Sudeep Holla Subject: [PATCH v3] doc: coresight: correct usage for disabling idle states Date: Wed, 20 Sep 2017 12:46:57 +0800 Message-Id: <1505882817-19582-1-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2375 Lines: 60 In the coresight CPU debug document it suggests to use 'echo' command to set latency request to /dev/cpu_dma_latency so can disable all CPU idle states, but in fact this doesn't work. This is because when the command 'echo' exits, it releases the device node's file descriptor and the kernel release function removes the QoS constraint; finally when the command 'echo' finished there have no constraint imposed on cpu_dma_latency. This patch changes to use 'exec' to access '/dev/cpu_dma_latency', the command 'exec' can avoid the file descriptor to be closed so we can keep the constraint on cpu_dma_latency. This patch also adds the info for reference docs for PM QoS and cpuidle sysfs. Cc: Jonathan Corbet Cc: Sudeep Holla Reported-by: Kim Phillips Suggested-by: Mathieu Poirier Signed-off-by: Leo Yan --- Documentation/trace/coresight-cpu-debug.txt | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Documentation/trace/coresight-cpu-debug.txt b/Documentation/trace/coresight-cpu-debug.txt index b3da1f9..2b9b51c 100644 --- a/Documentation/trace/coresight-cpu-debug.txt +++ b/Documentation/trace/coresight-cpu-debug.txt @@ -149,11 +149,23 @@ If you want to limit idle states at boot time, you can use "nohlt" or At the runtime you can disable idle states with below methods: -Set latency request to /dev/cpu_dma_latency to disable all CPUs specific idle -states (if latency = 0uS then disable all idle states): -# echo "what_ever_latency_you_need_in_uS" > /dev/cpu_dma_latency - -Disable specific CPU's specific idle state: +It is possible to disable CPU idle states by way of the PM QoS +subsystem, more specifically by using the "/dev/cpu_dma_latency" +interface (see Documentation/power/pm_qos_interface.txt for more +details). As specified in the PM QoS documentation the requested +parameter will stay in effect until the file descriptor is released. +For example: + +# exec 3<> /dev/cpu_dma_latency; echo 0 >&3 +... +Do some work... +... +# exec 3<>- + +The same can also be done from an application program. + +Disable specific CPU's specific idle state from cpuidle sysfs (see +Documentation/cpuidle/sysfs.txt): # echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable -- 2.7.4