From patchwork Thu Jan 12 13:27:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 9513195 X-Patchwork-Delegate: rjw@sisk.pl 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 C8EF160476 for ; Thu, 12 Jan 2017 13:27:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB4DE286BF for ; Thu, 12 Jan 2017 13:27:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AFAC7286B9; Thu, 12 Jan 2017 13:27:35 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 4D6BB286B9 for ; Thu, 12 Jan 2017 13:27:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751098AbdALN1c (ORCPT ); Thu, 12 Jan 2017 08:27:32 -0500 Received: from mail-pf0-f173.google.com ([209.85.192.173]:33287 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750796AbdALN1a (ORCPT ); Thu, 12 Jan 2017 08:27:30 -0500 Received: by mail-pf0-f173.google.com with SMTP id y143so13650237pfb.0 for ; Thu, 12 Jan 2017 05:27:30 -0800 (PST) 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=x1voPZx26JiJZ2JirJ/gyeKFSZyUztF7gI6B83tt/l8=; b=AQGnvWd6OW65bjt+JCf+JKxmAmPiRs+MFwKnZMmgnYiRPEFyeeiLzLMn4uzoyb6Va1 tqtKS2moCvXMbaHdmDlOJMEHrQknk1p7QDZT9NP2V6corn66KmPo1moG4m8LKrTWfUkb IAWzCdu1BIqDiFnxYicrfR8+7GqIiwqt8JMbk= 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:in-reply-to :references; bh=x1voPZx26JiJZ2JirJ/gyeKFSZyUztF7gI6B83tt/l8=; b=tTw8EmCzgPYQEGyWX5yBMQY6WaLSyYHIGq15/9qT/9pMECsdJbk5NfteUIaq53shxJ 6tpsv3SCDDhJagwba0J+mr/s3eYeBEwc3E/IEEBdCQhLIudcyfZa4NeQka0IGuUdGMGr 6UQAmNhd5siHV8DnA6mD3FebDVX1FpoG3n4IAkN0cNpRvJH6QBli2Za6IKk9bnm6u/5a jJx1cdJMZ4uW3VVHH1oves2K6i/Bg5wEly+9c2x2l5mhQIEkPLQsTA7MLCOUGmX1+kdx c6ew+D2Od2ml2LhRf428DdOnB766nQBkX3v9Lb//VqUBn3rNN4o8lBUXM4dkaqpUNexX nP4A== X-Gm-Message-State: AIkVDXIcZx/y1H61RT8RsBugsOH9PZgIHFd0cKIvfnRN1hI5VALb5JF/xtad2mgryWLfPR6n X-Received: by 10.99.106.200 with SMTP id f191mr17372461pgc.143.1484227644857; Thu, 12 Jan 2017 05:27:24 -0800 (PST) Received: from localhost.localdomain ([85.203.36.61]) by smtp.gmail.com with ESMTPSA id h17sm21849939pfh.62.2017.01.12.05.27.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Jan 2017 05:27:24 -0800 (PST) From: Alex Shi To: Greg Kroah-Hartman , Daniel Lezcano , "Rafael J . Wysocki" , vincent.guittot@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Alex Shi , Ulf Hansson Subject: [PATCH v2 2/3] cpu: expose pm_qos_resume_latency for each cpu Date: Thu, 12 Jan 2017 21:27:03 +0800 Message-Id: <1484227624-6740-3-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.8.1.101.g72d917a In-Reply-To: <1484227624-6740-1-git-send-email-alex.shi@linaro.org> References: <1484227624-6740-1-git-send-email-alex.shi@linaro.org> 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 Cc: "Rafael J. Wysocki" --- drivers/base/cpu.c | 2 ++ 1 file changed, 2 insertions(+) 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; }