From patchwork Fri Aug 19 08:25:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 74215 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp195819qga; Fri, 19 Aug 2016 01:25:45 -0700 (PDT) X-Received: by 10.67.3.197 with SMTP id by5mr11402014pad.119.1471595145086; Fri, 19 Aug 2016 01:25:45 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3si4011676pfg.65.2016.08.19.01.25.44; Fri, 19 Aug 2016 01:25:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1754388AbcHSIZY (ORCPT + 27 others); Fri, 19 Aug 2016 04:25:24 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:34198 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752431AbcHSIZW (ORCPT ); Fri, 19 Aug 2016 04:25:22 -0400 Received: by mail-pf0-f174.google.com with SMTP id p64so7367551pfb.1 for ; Fri, 19 Aug 2016 01:25:21 -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:in-reply-to:references; bh=DBX9oFoef0lLVK6uKs/F4wPKTnrXeApx8vCCRq8j3HY=; b=Rn/8r/+At8c3kajHOWEdcV8GToF57A7Oy9oCO+c46g9HawW15Et8mKLooxOGs8yuBl nGlVBjaS7KXlurCpoQl9s2TarNgcZQkQTfBoOP26igy8qwP88qCIvUvNVey3cfE07Cbn rrR13snskknB4blHDVow/+Hqmxq5Xi/V/DfwQ= 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:in-reply-to :references; bh=DBX9oFoef0lLVK6uKs/F4wPKTnrXeApx8vCCRq8j3HY=; b=SMfw+I2cjqDotKXlGHypA9aZyjpnubhuLMkIRzDhIh0y2QQ4bt8rSQ8q4ke4reZXog c00jYq9vOz/ADwtRY0LpRUEq44ztwcMFZ6xwUMDpqsHKyknvFyCGJyww3NzgvhIDTfhx 5TAR51K9z+DJIrjk5SN1g3KCgLdTYfJz/cfSpJ1N3pgptxrUbfG9S5BR+jAuBCis4ufO xYQAgsmwhn+Z0rz2AJNkxnFfNVYlPndDYP4+5gFufXYFfwS/qcwNWMmjQ9mc4bQbAj/s d64OkRQNlFweqgsttA4el3ET41gxmjHMv+MEI+MzUQVDQYFyau8RTMr7k2TtbnQUiAIt B9oA== X-Gm-Message-State: AEkoouvWgz4lUO9Y5CAKPglKX5wh1NVtR18JrC3XRdOKy8Xcy0DsQJ2/ziXtgcxNkIO+NyGB X-Received: by 10.98.149.131 with SMTP id c3mr12186780pfk.73.1471595121280; Fri, 19 Aug 2016 01:25:21 -0700 (PDT) Received: from localhost.localdomain ([139.59.249.186]) by smtp.gmail.com with ESMTPSA id p4sm4290183pfp.60.2016.08.19.01.25.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Aug 2016 01:25:20 -0700 (PDT) From: Alex Shi Cc: Daniel Lezcano , Greg Kroah-Hartman , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/4] cpu: expose pm_qos_resume_latency for each cpu Date: Fri, 19 Aug 2016 16:25:12 +0800 Message-Id: <1471595114-1688-2-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.8.1.101.g72d917a In-Reply-To: <1471595114-1688-1-git-send-email-alex.shi@linaro.org> References: <1471595114-1688-1-git-send-email-alex.shi@linaro.org> To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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: Daniel Lezcano --- drivers/base/cpu.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.8.1.101.g72d917a diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 4c28e1a..2c3b359 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,7 @@ 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)); + dev_pm_qos_expose_latency_limit(&cpu->dev, 0); return 0; }