From patchwork Wed Oct 26 11:46:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 79401 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp16392qge; Wed, 26 Oct 2016 04:47:26 -0700 (PDT) X-Received: by 10.98.10.6 with SMTP id s6mr3522717pfi.8.1477482446148; Wed, 26 Oct 2016 04:47:26 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2si2165808pgn.278.2016.10.26.04.47.21; Wed, 26 Oct 2016 04:47:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752561AbcJZLrU (ORCPT + 14 others); Wed, 26 Oct 2016 07:47:20 -0400 Received: from mail-pf0-f175.google.com ([209.85.192.175]:35221 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750890AbcJZLrT (ORCPT ); Wed, 26 Oct 2016 07:47:19 -0400 Received: by mail-pf0-f175.google.com with SMTP id s8so138802023pfj.2 for ; Wed, 26 Oct 2016 04:46:20 -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=AuL9a6xxvnRFjG7lrEyZ6Jte8WiYfTglIIpEgo4/y9E=; b=YVo2RxlnM4aFzywj8SECtfCGKVNMjj/4u8/XuRLc8BrvCBqschY1ZlD9ullyD0loPP 4yBynyK4GFNvTzK3c2roJ2LITLI4/jbIc7v+LFQQf/2onhbkX3z/P872TErOBupZ3THN 6AwhD58oVD4719n//DgbGjEujP/OdEEwzFf1s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AuL9a6xxvnRFjG7lrEyZ6Jte8WiYfTglIIpEgo4/y9E=; b=RVYoC1q+wwVy7XcO4bfsKxFL/au26zP843VaUO3aq5eiKLzrA+yGjKOh/P93ClBsHA Y3LlHn2Oe+B1+XkgVNQX90BfeCOEUiWmjMrwFfTIs8oHu0RKEfoqESsL05f/rwf3Vx9/ ayZwlOhbj1axVctUXsd6yFUEJnel63Jw/fZLMgbALRZYcmLeX3/TkzZpO3x0KyL5ncox tAp21qUSEI3YMhotPEdh1O6Apvmv1+daVLuIGKS0NdD9lw2tvEX8QJoWXa+bjfzW+CJA Xd7JGGOW7QLtZqUQNvu7SqMWzMgndoPiGfTJ2rmuCNeLwU95bK6NkLDDcjq5aN9+jwqZ S8Zw== X-Gm-Message-State: ABUngvdz4GBlD9KKY2FfFL646rZVuqyRUDi8SvyN9AO73J9WnwuKMDjXP6BzrhpndUvMEs6X X-Received: by 10.98.64.76 with SMTP id n73mr3411454pfa.33.1477482379718; Wed, 26 Oct 2016 04:46:19 -0700 (PDT) Received: from localhost.localdomain ([104.237.91.82]) by smtp.gmail.com with ESMTPSA id xk6sm3729147pab.26.2016.10.26.04.46.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Oct 2016 04:46:19 -0700 (PDT) From: Alex Shi To: alex.shi@linaro.org Cc: linux-pm@vger.kernel.org, Ulf Hansson , Daniel Lezcano Subject: [PATCH 1/3] cpu: expose pm_qos_resume_latency for each cpu Date: Wed, 26 Oct 2016 19:46:13 +0800 Message-Id: <1477482375-32067-1-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.8.1.101.g72d917a Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The cpu-dma PM QoS constraint impacts all the cpus in the system. There is no way to let the user to choose a PM QoS constraint per cpu. The following patch exposes to the userspace a per cpu based sysfs file in order to let the userspace to change the value of the PM QoS latency constraint. This change is inoperative in its form and the cpuidle governors have to take into account the per cpu latency constraint in addition to the global cpu-dma latency constraint in order to operate properly. BTW The pm_qos_resume_latency usage defined in Documentation/ABI/testing/sysfs-devices-power The /sys/devices/.../power/pm_qos_resume_latency_us attribute contains the PM QoS resume latency limit for the given device, which is the maximum allowed time it can take to resume the device, after it has been suspended at run time, from a resume request to the moment the device will be ready to process I/O, in microseconds. If it is equal to 0, however, this means that the PM QoS resume latency may be arbitrary. Signed-off-by: Alex Shi To: linux-kernel@vger.kernel.org To: Greg Kroah-Hartman Cc: linux-pm@vger.kernel.org Cc: Ulf Hansson Cc: Daniel Lezcano --- drivers/base/cpu.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.8.1.101.g72d917a -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 4c28e1a..ba11e23 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "base.h" @@ -376,6 +377,8 @@ int register_cpu(struct cpu *cpu, int num) per_cpu(cpu_sys_devices, num) = &cpu->dev; register_cpu_under_node(num, cpu_to_node(num)); + if (dev_pm_qos_expose_latency_limit(&cpu->dev, 0)) + pr_debug("CPU%d: add resume latency failed\n", num); return 0; }