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: 91150 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp1914242obz; Thu, 12 Jan 2017 05:27:32 -0800 (PST) X-Received: by 10.98.64.195 with SMTP id f64mr16479524pfd.16.1484227651967; Thu, 12 Jan 2017 05:27:31 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 123si9297742pfe.90.2017.01.12.05.27.31; Thu, 12 Jan 2017 05:27:31 -0800 (PST) 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 sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751502AbdALN12 (ORCPT + 25 others); Thu, 12 Jan 2017 08:27:28 -0500 Received: from mail-pf0-f174.google.com ([209.85.192.174]:34678 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750796AbdALN1Z (ORCPT ); Thu, 12 Jan 2017 08:27:25 -0500 Received: by mail-pf0-f174.google.com with SMTP id 127so13448672pfg.1 for ; Thu, 12 Jan 2017 05:27:25 -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=jSe/8DEz/TbMYzC21fWL7wMhcZ3RbZLO5lvz3S31JrvKswxG8um6m3iOjWiZvAaogy +Y72JwTdSBwfvf00yJf9sw/wygG9L/2rbGEllse0vhP2RVWk0//6rLbdNDfl0uskIAI8 9cJjQvySaRnkE3E1G1JUiobZSxZ2G1jFCvwL+InB1Ku2NH5C5rHf8lRFwnGUVvLDfu7Q mnW1h2wEpumgUVXs5IX14x8v7A/+NXt1Kq6U1oe0dJ4DWv3m4m+BKCYn1jCMmIaJ8+YY 444oAvRCd+cGbSLxsrwpbthmnKSGVv3Tb/vi4kCf55iTz2PTb/QQtHNOPOdS1OEDMhXt IoUQ== X-Gm-Message-State: AIkVDXK3Ipo+dPhjNRU9FzLEWqFDhgj/7smXTZ3jiBAtWLvyd/conGfRkrgWF0u7bNZ2IZzY 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-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 Cc: "Rafael J. Wysocki" --- 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; }