From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753459AbdHWHXh (ORCPT ); Wed, 23 Aug 2017 03:23:37 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:37557 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753396AbdHWHXf (ORCPT ); Wed, 23 Aug 2017 03:23:35 -0400 From: Leo Yan To: Mathieu Poirier , Jonathan Corbet , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan , Kim Phillips Subject: [PATCH] doc: coresight: correct usage for '/dev/cpu_dma_latency' Date: Wed, 23 Aug 2017 15:23:18 +0800 Message-Id: <1503472998-9009-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 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 corrects the description when set latency = 0uS, in this case the idle state0 still can be selected by CPUIdle governor so this means on ARM platform the 'WFI' state is still enabled, but all other deeper states have been disabled so CPUs will not be powered off. Cc: Kim Phillips Reported-by: Kim Phillips Signed-off-by: Leo Yan --- Documentation/trace/coresight-cpu-debug.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/trace/coresight-cpu-debug.txt b/Documentation/trace/coresight-cpu-debug.txt index b3da1f9..17ff8ed 100644 --- a/Documentation/trace/coresight-cpu-debug.txt +++ b/Documentation/trace/coresight-cpu-debug.txt @@ -150,8 +150,10 @@ 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 +states (if latency = 0uS then CPU Idle governor selects idle state0, so this +means 'WFI' is still enabled but other deeper states have be disabled, this +can avoid power off CPUs): +# exec 3<> /dev/cpu_dma_latency; echo "what_ever_latency_you_need_in_uS" >&3 Disable specific CPU's specific idle state: # echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: leo.yan@linaro.org (Leo Yan) Date: Wed, 23 Aug 2017 15:23:18 +0800 Subject: [PATCH] doc: coresight: correct usage for '/dev/cpu_dma_latency' Message-ID: <1503472998-9009-1-git-send-email-leo.yan@linaro.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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 corrects the description when set latency = 0uS, in this case the idle state0 still can be selected by CPUIdle governor so this means on ARM platform the 'WFI' state is still enabled, but all other deeper states have been disabled so CPUs will not be powered off. Cc: Kim Phillips Reported-by: Kim Phillips Signed-off-by: Leo Yan --- Documentation/trace/coresight-cpu-debug.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/trace/coresight-cpu-debug.txt b/Documentation/trace/coresight-cpu-debug.txt index b3da1f9..17ff8ed 100644 --- a/Documentation/trace/coresight-cpu-debug.txt +++ b/Documentation/trace/coresight-cpu-debug.txt @@ -150,8 +150,10 @@ 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 +states (if latency = 0uS then CPU Idle governor selects idle state0, so this +means 'WFI' is still enabled but other deeper states have be disabled, this +can avoid power off CPUs): +# exec 3<> /dev/cpu_dma_latency; echo "what_ever_latency_you_need_in_uS" >&3 Disable specific CPU's specific idle state: # echo 1 > /sys/devices/system/cpu/cpu$cpu/cpuidle/state$state/disable -- 2.7.4