From patchwork Thu Aug 25 08:42:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 74669 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp725508qga; Thu, 25 Aug 2016 01:43:46 -0700 (PDT) X-Received: by 10.98.12.200 with SMTP id 69mr13934785pfm.15.1472114626383; Thu, 25 Aug 2016 01:43:46 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg10si14518314pab.12.2016.08.25.01.43.46; Thu, 25 Aug 2016 01:43:46 -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=pass 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=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933657AbcHYIno (ORCPT + 27 others); Thu, 25 Aug 2016 04:43:44 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:36747 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933614AbcHYInk (ORCPT ); Thu, 25 Aug 2016 04:43:40 -0400 Received: by mail-pf0-f169.google.com with SMTP id h186so15824858pfg.3 for ; Thu, 25 Aug 2016 01:42:52 -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=AuL9a6xxvnRFjG7lrEyZ6Jte8WiYfTglIIpEgo4/y9E=; b=gXuIM44JucqReY4rkJKDpyBQbkX5Hb/uaDmg0viwCcTdxPfujlkJnUOi0vhGiYe9qy JITGpuE1tBDSMfFXykT38IeasCeYdUiak2gCfEzE06HwVEdS1PvwCqCN4B/d1E1bSUV7 3GAqIEFwQdKiKUxayK+nw+2F5s1lqPFQ/da3M= 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=AuL9a6xxvnRFjG7lrEyZ6Jte8WiYfTglIIpEgo4/y9E=; b=Tckr9kctMNMpX2vjVy1n1SJle4klF+8DggvCdejc9ka3wasZImD4y0z0MHrYDfvesZ 6ypIyNG9FP7SLyh4fPvoB1Soh3GnWWgPq/PEMgZVm0NbO3FFPQ9TmtY/xzE36+QPmmo4 rGb8YPFmuPHKNaPXIT2C76+28MmzhHrQ+wQ5yriH1UokqwgpPBto3FPuWTrAdhGicz2P pCdCzQLdInefzeql0OUNGJvFELzGgmyUMt+4ykMUCqyUsGUmW11bR3vuY11bcuZ8v2RM x9wc2DAxDFZQEcgmysRTddOPYTDvY41ZsxB9S737ByFP/ur80/2DlTc9xKtY6noRjZUa gpEQ== X-Gm-Message-State: AE9vXwN5M3trnPDNgFm9tq0HBihecbnF8D30hiAgAoVGbJ3yK4U6hzpp3FgkE6ebvlSczlSO X-Received: by 10.98.65.81 with SMTP id o78mr14004601pfa.48.1472114571533; Thu, 25 Aug 2016 01:42:51 -0700 (PDT) Received: from localhost.localdomain ([139.59.249.186]) by smtp.gmail.com with ESMTPSA id h66sm19016433pfe.58.2016.08.25.01.42.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Aug 2016 01:42:51 -0700 (PDT) From: Alex Shi To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org (open list) Cc: linux-pm@vger.kernel.org, Ulf Hansson , Daniel Lezcano Subject: [PATCH 2/4] cpu: expose pm_qos_resume_latency for each cpu Date: Thu, 25 Aug 2016 16:42:40 +0800 Message-Id: <1472114562-2736-2-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.8.1.101.g72d917a In-Reply-To: <1472114562-2736-1-git-send-email-alex.shi@linaro.org> References: <1472114562-2736-1-git-send-email-alex.shi@linaro.org> 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: 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 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; }