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: 9499209 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 2B627606E0 for ; Thu, 5 Jan 2017 15:30:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21F8F2840E for ; Thu, 5 Jan 2017 15:30:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16E282841D; Thu, 5 Jan 2017 15:30:48 +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 E8ED628419 for ; Thu, 5 Jan 2017 15:30:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S970972AbdAEPan (ORCPT ); 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 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 | 4 ++++ 1 file changed, 4 insertions(+) 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; }