From patchwork Thu Jan 5 15:29:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 90041 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp9022147qgi; Thu, 5 Jan 2017 07:30:55 -0800 (PST) X-Received: by 10.84.210.5 with SMTP id z5mr147585817plh.32.1483630255769; Thu, 05 Jan 2017 07:30:55 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a188si76303352pfb.180.2017.01.05.07.30.55; Thu, 05 Jan 2017 07:30:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S970972AbdAEPan (ORCPT + 13 others); Thu, 5 Jan 2017 10:30:43 -0500 Received: from mail-io0-f181.google.com ([209.85.223.181]:34015 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969440AbdAEPaX (ORCPT ); Thu, 5 Jan 2017 10:30:23 -0500 Received: by mail-io0-f181.google.com with SMTP id f103so13219371ioi.1 for ; Thu, 05 Jan 2017 07:30:23 -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=y9eEAccNGV+ix6ya6mKHOTBmtYS2wwu+2cP2MgIv6CA=; b=jPDKGKnK0lb/xi12Ov49nUQ/7ILIE30VILfBRibFu2pQUrI5cslLI2ufzhA0BgTNbu +KVwYYBw9vjfgE2BEw/Hd48RLM2vaC/Fs0nip+eldbSfJwat5s+kGX4nwUFWrPOmwvbe xbiHP5Zvt7YOpk0uXdypYbc7fsdn4MDZ+k6QA= 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=y9eEAccNGV+ix6ya6mKHOTBmtYS2wwu+2cP2MgIv6CA=; b=UyrT+lT2xExj0TPYtMLjwtscUD1c6zaKTRN40gTO6VmaFnp5jMmjOS57XLYnkvAUFs Mg0pQOaF6e1SJfO6UuhqA7QZkKCsEH6tNMn2FMVBt1bfsIQgf/t0BOa+Yoibx6TTP5X5 8bUptXF7NLJsT2tvhwFidNqjKP0cRdvf3jc60pYxYm3LWLGGfaVuO+l+3lDtDsEjtq3X kdrOTYvSNTrWABeHOg8axusx5L7ySbEGEWSuUDNxLUAclxSQ1ZeVva51aI7AYkqPktDa V0w5OF8RBSaOkFSnbu8Ikxp+M22yQU1RSUqNKCd+ReJaV0KGz2GjNUloYkpyG3JfnOYx Z+Nw== X-Gm-Message-State: AIkVDXJHtIBdrFlNzndDp5EmoSBsXbwMk354XJKett8FxpMFMLtBEMzLGlURYJpSI8I1krOF X-Received: by 10.107.147.10 with SMTP id v10mr53678332iod.63.1483630223068; Thu, 05 Jan 2017 07:30:23 -0800 (PST) Received: from localhost.localdomain ([85.203.36.82]) by smtp.gmail.com with ESMTPSA id 130sm36051198ity.5.2017.01.05.07.30.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jan 2017 07:30:22 -0800 (PST) From: Alex Shi To: Daniel Lezcano , "Rafael J . Wysocki" , vincent.guittot@linaro.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org (open list) Cc: linux-pm@vger.kernel.org, Ulf Hansson Subject: [PATCH 2/3] cpu: expose pm_qos_resume_latency for each cpu Date: Thu, 5 Jan 2017 23:29:46 +0800 Message-Id: <1483630187-29622-3-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.8.1.101.g72d917a In-Reply-To: <1483630187-29622-1-git-send-email-alex.shi@linaro.org> References: <1483630187-29622-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 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 | 4 ++++ 1 file changed, 4 insertions(+) -- 2.8.1.101.g72d917a -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 4c28e1a..29cf3459 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,9 @@ 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)); +#ifdef CONFIG_CPU_IDLE_GOV_MENU + dev_pm_qos_expose_latency_limit(&cpu->dev, 0); +#endif return 0; }