From patchwork Wed Sep 20 04:46:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 9960707 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B1FBC6056A for ; Wed, 20 Sep 2017 04:48:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A06B722B27 for ; Wed, 20 Sep 2017 04:48:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93C58252D5; Wed, 20 Sep 2017 04:48:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9723A28F99 for ; Wed, 20 Sep 2017 04:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=VdqAJsqM349V77RuJKsFRE875mreNdu8OAsNhp+Vkq8=; b=Pbl grIfHEPbgUjXB+XVNW6tR5yZ6TrwU3RwGhdrGw9BqN+Cys8o3Ty/03eZCVF2kVn0aXeudwykKo9Ur FnACeqwyQlYVLN4CMRSNMioHHjNQh+3ODaqRtUNXP9O6PWgpWpb4uqDgQ2qjdTCgWrvzyJ1Lttsd7 SsESbKvmjEMNNStCmpmDSqci1jRZMiQiKaPbK3vIwzFma6bbupqGa2hr42lmJcUnHyU1UNvLCrLmo UMSGaEV/j+6I3DEnTsnflFpu7mZeEs0Z+XcXWBWlW5Trf/8TD78p7D1neTvhglqNtphN53iE8Q/Lp I1pkAaS9IU1CawN6hyfDo3CBzuvKOBg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1duWvD-00031Y-6l; Wed, 20 Sep 2017 04:47:39 +0000 Received: from mail-pf0-x22d.google.com ([2607:f8b0:400e:c00::22d]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1duWv8-0002w0-Hu for linux-arm-kernel@lists.infradead.org; Wed, 20 Sep 2017 04:47:36 +0000 Received: by mail-pf0-x22d.google.com with SMTP id d187so962264pfg.11 for ; Tue, 19 Sep 2017 21:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=7l1nlaJUvLAvmE9tf09ieA1b26GIrhW9ERxcn2CvvNo=; b=R9ppmXEoHit6UZYGPyhmk2OTPpi2YKOL3W6ukMtEV0nU/fJuqOsPw2LBBC2MOmSTbT BEbH6TjVuIOqWGvOa8TxtwYwx9mFjoGUCUvxuBM5cc44vl2rC4ob8oz4c1Qluh6l+PFl +eeZMeJUaEW1VJZlXDBc48EQ53quIDEjL/Q80= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7l1nlaJUvLAvmE9tf09ieA1b26GIrhW9ERxcn2CvvNo=; b=fNsQgfQeMXD1WMnqiYcCFr1zNi4oqLIpfTN/rb7QDQpoEYL5PdfM4kMx0+hkFxPiHu +MvNr5iP8AzY6LGh5HabQ68GK2vn6VAdSswoQfQNl4k1ZI3CzXDr6KMBXYhgQ6L1HzZ4 l2EURSSKvMsCwDjAJWd3oDHNAYgw35Te65My3NVfrWAJAUP40UX8+++YAN8AcHccvmXo EprO0lNuHHG1v/osdHidHHh1gkuQFdalHSus+PsrPiX8W8fL2fLcyDg6KZN57mKw2Oxs 5isXhwNz6Q+dFSdWooM3bpdOfJHA1sgazUjqRvU7uQglM6eyYCoygRQ1Pj8K2V9AMZyX d/ig== X-Gm-Message-State: AHPjjUjHuMS7qsP4fLrCwTcVETxnJr70uBu58/09uMEeM94b1qgIgGNp jnu+FKiYfXhHzEZ9qZ64y1BRqQ== X-Google-Smtp-Source: AOwi7QB6lENvvNGX3E9l96WN6OgUX96mDNgCAUlflVrHmh3MopsgnTiRrjEu1TrBQtk1+YoqJdLHLA== X-Received: by 10.101.93.5 with SMTP id e5mr901549pgr.55.1505882833052; Tue, 19 Sep 2017 21:47:13 -0700 (PDT) Received: from localhost.localdomain (c-69-181-16-182.hsd1.ca.comcast.net. [69.181.16.182]) by smtp.gmail.com with ESMTPSA id m21sm6398665pgn.60.2017.09.19.21.47.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Sep 2017 21:47:11 -0700 (PDT) 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170919_214734_634769_B5767500 X-CRM114-Status: GOOD ( 15.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sudeep Holla , Leo Yan MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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