Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1037361imm; Wed, 20 Jun 2018 10:30:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI6eivDepQ81qzVxLDVs7SNR/rMZ+HrkI8ordEtlCqchvHktn0/skYej6xk2USuQs53n9A6 X-Received: by 2002:a65:5d4a:: with SMTP id e10-v6mr16683422pgt.25.1529515805433; Wed, 20 Jun 2018 10:30:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529515805; cv=none; d=google.com; s=arc-20160816; b=S4KyO06EjvJX3eVxbore2L3drKAdPUa/MSHCA6B1vX4ZFOnGHJnwHOmhF9Ne44qrit Tn/Qwo70PO1vVqdzkWJfkrEisN6f0xAD/t/ohyq7c/OKrxtYlpXwmW8ggEyjjgVu4HnO cpT11/T7ybT4bqfNQaBYPUgdgjEl+cCzOmtXpWTkCT39LnbgexE3TTnPkX86EVXy/zv5 I6gNjJrJAPoSNBswRVvEXn90vTu26w7/07dplEOPbMx8MXgCIMdAxqxF9mAQtgNF/CmT uzOTzDyIHKpdlZscwlbpGw6/J8cE3Ae8OvZ23JYiLRBoxKvbauoE0KyrIYzdc9xYts2l NvWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=2rOnhZC3M8EvYQA2pnS1IS2IzGGNUg71SNxnGjjFgcI=; b=Jza5BuOHwbH5wd5iI75GcUjmzgDXCC7Cc9w8xd9uxuhF+CIfsLLVpXaiiT0weWav0B lRnXhjI32zvk4YwjOKGMZDZ7gjly3wGc7FHvJiV7ozShTksYFHVuYBTRjZtEvBo2CiPA zEh964QQ4vuwU3ckhnbdvDXdiCJQJ6jJUuAmNblRo7NXKNn1IFiSg2lsPJUOwU7NyYdF a+k18VqbeW3hXNmD3FlHFwxJvaTQLkcQhmEBuzJqbZ014sUfjg7xfll8GaN9/pY+F1B0 VzzcRntzn+ySHOrnwMffNON6cWvn5Fp/dSMm1CFs3twGcmzyd//plooSADLlaAj1Z0ut wnSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HN4tGITL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6-v6si2370520pgy.224.2018.06.20.10.29.51; Wed, 20 Jun 2018 10:30:05 -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 header.s=google header.b=HN4tGITL; 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 S1754311AbeFTRWj (ORCPT + 99 others); Wed, 20 Jun 2018 13:22:39 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:38567 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754199AbeFTRWh (ORCPT ); Wed, 20 Jun 2018 13:22:37 -0400 Received: by mail-lf0-f66.google.com with SMTP id i83-v6so478913lfh.5 for ; Wed, 20 Jun 2018 10:22:36 -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; bh=2rOnhZC3M8EvYQA2pnS1IS2IzGGNUg71SNxnGjjFgcI=; b=HN4tGITLriAPJBOwSUImCbB68VgiP2Xs07VoBelIjZQOv6yV5px2TyapLHwB9f8fRj E2obSd5hLORAYOW6hlWz9JUdtvMYnbI3/r07Rpl9vK614YRHNtFvJed12jNUBzdyz4va wtsSJKH3Cmv0rqRzccG+W/1zYzJfi+DjdVBxA= 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; bh=2rOnhZC3M8EvYQA2pnS1IS2IzGGNUg71SNxnGjjFgcI=; b=WbYFo5Jk9zQhmWacOIDiqBQDxqbkX3TEcyCEx+860/ZyTjBtlfVt3NVA+yBfVbLSQP 6xEPWQVFJ/Mu7pO4XZbXLoTixsmX85XWb6/lPXN4J2wXs+nVxYmLzX28tQ10B10+BJPg TLbm9bBSEeagPHqjC15FpDGTmGCkWhjqVoprPrMVgqq4sjzMiQ/WMJfKiUAhkw1/PODA 5Jh21tmF5PgeLCncgM9HlxjmcdEkDr8XS6a0PbSWdzyNdcwrAO06yIoR/dEdHmc+ozXI +s9aKSmmpmgCr+XCRSih+JxJHSlhXV6ezE/YKhM9Oj51/wFsIMLc5FsR4+BP8Qic7Xmq pNbw== X-Gm-Message-State: APt69E0oh847nDVZlAN7XWtBEpUYxzLjauqB23e2PjxirK+ak4xZy6xa H9cA6z+tvSnYzjMk5bXPDCj5DRQdP2w= X-Received: by 2002:a2e:2917:: with SMTP id u23-v6mr493044lje.130.1529515355349; Wed, 20 Jun 2018 10:22:35 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id b2-v6sm514441lji.85.2018.06.20.10.22.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 10:22:34 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Sudeep Holla , Lorenzo Pieralisi , Mark Rutland , linux-pm@vger.kernel.org Cc: Kevin Hilman , Lina Iyer , Lina Iyer , Ulf Hansson , Rob Herring , Daniel Lezcano , Thomas Gleixner , Vincent Guittot , Stephen Boyd , Juri Lelli , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 00/26] PM / Domains: Support hierarchical CPU arrangement (PSCI/ARM) Date: Wed, 20 Jun 2018 19:22:00 +0200 Message-Id: <20180620172226.15012-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes in v8: - Added some tags for reviews and acks. - Cleanup timer patch (patch6) according to comments from Rafael. - Rebased series on top of v4.18rc1 - it applied cleanly, except for patch 5. - While adopting patch 5 to new genpd changes, I took the opportunity to improve the new function description a bit. - Corrected malformed SPDX-License-Identifier in patch20. Changes in v7: - Addressed comments concerning the PSCI changes from Mark Rutland, which moves the psci firmware driver to a new firmware subdir and change to force PSCI PC mode during boot to cope with kexec'ed booted kernels. - Added some maintainers in cc for the timer/nohz patches. - Minor update to the new genpd governor, taking into account the state's poweroff latency while validating the sleep duration time. - Addressed a problem pointed out by Geert Uytterhoeven, around calling pm_runtime_get|put() for CPUs that has not been attached to a CPU PM domain. - Re-based on Linus' latest master. Some background: Overall this series have been discussed over years at various Linux conferences and LKML, although let me give a brief introduction and then the rest can be read in each changelog. For ARM, the PSCI firmware interface may be managing the power to the CPUs. Depending on the SoC, CPUs may also be arranged in hierarchical manner, which could add another level of complexity from a CPU idle management point of view. PSCI v1.0+ adds support for the so called OS initiated CPU suspend mode, which enables a more fine grained method, allowing Linux to get more control, in regards to being energy efficient. This is typically useful for these kind of complex battery driven platforms. Now, in principle what is missing today around CPU idle management for these SoCs arranging CPUs in a hierarchical manner, that is what this series intends to address. - Patch 1 -> Patch 12: The first part are generic changes to genpd, cpu_pm, timers, cpuidle and DT. Of course the solution is based on an opt-in method, so no users should be affected of any of these changes. - Patch 13 -> Patch 26: The second part are changes to PSCI and ARM64, which deploys the support for CPU idle management, based upon the new generic changes from the first part. The series is based on v4.18rc1 and the code has been tested on a QCOM 410c dragonboard. You may find the code at: git.linaro.org/people/ulf.hansson/linux-pm.git next Kind regards Ulf Hansson Lina Iyer (6): PM / Domains: Add generic data pointer to genpd_power_state struct timer: Export next wakeup time of a CPU dt: psci: Update DT bindings to support hierarchical PSCI states cpuidle: dt: Support hierarchical CPU idle states drivers: firmware: psci: Support hierarchical CPU idle states arm64: dts: Convert to the hierarchical CPU topology layout for MSM8916 Ulf Hansson (20): PM / Domains: Don't treat zero found compatible idle states as an error PM / Domains: Deal with multiple states but no governor in genpd PM / Domains: Add support for CPU devices to genpd PM / Domains: Add helper functions to attach/detach CPUs to/from genpd PM / Domains: Add genpd governor for CPUs PM / Domains: Extend genpd CPU governor to cope with QoS constraints kernel/cpu_pm: Manage runtime PM in the idle path for CPUs of: base: Add of_get_cpu_state_node() to get idle states for a CPU node drivers: firmware: psci: Move psci to separate directory MAINTAINERS: Update files for PSCI drivers: firmware: psci: Split psci_dt_cpu_init_idle() drivers: firmware: psci: Simplify error path of psci_dt_init() drivers: firmware: psci: Announce support for OS initiated suspend mode drivers: firmware: psci: Prepare to use OS initiated suspend mode drivers: firmware: psci: Share a few internal PSCI functions drivers: firmware: psci: Add support for PM domains using genpd drivers: firmware: psci: Introduce psci_dt_topology_init() drivers: firmware: psci: Try to attach CPU devices to their PM domains drivers: firmware: psci: Deal with CPU hotplug when using OSI mode arm64: kernel: Respect the hierarchical CPU topology in DT for PSCI .../devicetree/bindings/arm/psci.txt | 156 +++++++++++++++ MAINTAINERS | 2 +- arch/arm64/boot/dts/qcom/msm8916.dtsi | 53 +++++- arch/arm64/kernel/setup.c | 3 + drivers/base/power/domain.c | 158 ++++++++++++++- drivers/base/power/domain_governor.c | 67 ++++++- drivers/cpuidle/dt_idle_states.c | 5 +- drivers/firmware/Kconfig | 15 +- drivers/firmware/Makefile | 3 +- drivers/firmware/psci/Kconfig | 13 ++ drivers/firmware/psci/Makefile | 4 + drivers/firmware/{ => psci}/psci.c | 174 +++++++++++++---- drivers/firmware/psci/psci.h | 19 ++ drivers/firmware/{ => psci}/psci_checker.c | 0 drivers/firmware/psci/psci_pm_domain.c | 180 ++++++++++++++++++ drivers/of/base.c | 35 ++++ include/linux/of.h | 8 + include/linux/pm_domain.h | 16 ++ include/linux/psci.h | 2 + include/linux/tick.h | 8 + include/uapi/linux/psci.h | 5 + kernel/cpu_pm.c | 11 ++ kernel/time/tick-sched.c | 10 + 23 files changed, 877 insertions(+), 70 deletions(-) create mode 100644 drivers/firmware/psci/Kconfig create mode 100644 drivers/firmware/psci/Makefile rename drivers/firmware/{ => psci}/psci.c (83%) create mode 100644 drivers/firmware/psci/psci.h rename drivers/firmware/{ => psci}/psci_checker.c (100%) create mode 100644 drivers/firmware/psci/psci_pm_domain.c -- 2.17.1