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: 9396645 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 B79FE60231 for ; Wed, 26 Oct 2016 11:47:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CDCA28F94 for ; Wed, 26 Oct 2016 11:47:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5FDE1298DE; Wed, 26 Oct 2016 11:47:23 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1453D28F94 for ; Wed, 26 Oct 2016 11:47:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752561AbcJZLrU (ORCPT ); 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 X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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; }