From patchwork Tue May 29 10:04:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 921937 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lh2r8JMX"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="G7NdfK6Q"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40w8Tv131Jz9s15 for ; Tue, 29 May 2018 20:04:51 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=a0B1RUAH0IfYYtB7IfysRHTdg4WkdU3N5/PjVZdDK2o=; b=lh2r8JMXMpApdb MVtOaWDjrquZgv+GOMDbXR6JqM9SxuJioPADDFWT2283oUhwEiPE/7e1V5OCSDIBfYC9og+Wp2mZj p07uDtVpQCJJaGtYKfwexNnZMX6reOeYUzBBHGOMzAeE6uspQ/1hcgcTSXUSUkLRm8Ca18N5vK2z0 vSwkHMndMlMRd9PzztmRxubwveCKG0IWxktXTqpq05wKqmFq0A5feQJF392yO+rXrvqV/eYTzFhsD 3y6MPif5Rj/nIKzEHnsp7YWDloOlSrPQmTv6q9H7B1JwjjIbxg4gZS1QqsgApEMVyB8XE5Ny0cBCO UbxoSdNlDRPO4BWu1hhg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fNbUk-0004xu-HK; Tue, 29 May 2018 10:04:46 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fNbUe-0004uF-7k for linux-arm-kernel@lists.infradead.org; Tue, 29 May 2018 10:04:42 +0000 Received: by mail-wm0-x242.google.com with SMTP id 18-v6so33273229wml.2 for ; Tue, 29 May 2018 03:04:28 -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:mime-version :content-transfer-encoding; bh=GXhK1/flt4Ho3posxsl4AhuoR08jhDEdbM1B5kSVClY=; b=G7NdfK6Q8TLuIhp/xSXIlTCJfHA1VpBz05D8JyZ/25i6LplFEizO8LZKlnLJ/AmFzs Pw1apE5tTH+4utJ6LzQRYRAmjL50TaRizCjIybluFmGnQY+/x18H3Hk+rRp8DyDBW5TX bKixTx4qz5UF7XeHfHbi0m5ieQALz8SAyZccQ= 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:mime-version :content-transfer-encoding; bh=GXhK1/flt4Ho3posxsl4AhuoR08jhDEdbM1B5kSVClY=; b=bZdDYYICpaT6wMFVndy939ORESkENayvWvS6D8dXwJtMDIy+pMMVKNCfKIsG9Xuzx2 7Eed+fXw7GC9m2fOY+EOmJf0sO5XdkemC67SNUb1tvE4H1p6Hu6SgzN6OmZBP3BQvtwh f/srCfcJNS17ydHDH4P3WMyUCXL2RxsKYdd0kbCOuuJC635X82Cj57s8qmQNtR95omZk woy2fWjt+vDiodswZGSpZjsHZaOqnTD6pUDqm8JIjiOUe2eLrMVdN9/Rbp6PpN6ugxZG kRA/Nu5QbBs/e2E657VcWVwp3BUVGkNyMoPGeJ9C4s0uoHIuqDWAon8dQaJ1jcIgdsOs XT9Q== X-Gm-Message-State: ALKqPwflLBpJKcgnJ5XNFcX1U2KGGOl1R41M+U4Hp4ZKwLjowgr5QrEa idPVSaRMm//+6peWsZl5G9m36Q== X-Google-Smtp-Source: ADUXVKKKTekgJ6oP7wcHUvmuuqTyTGddJhGStQ3mQRGsqqljHPLB+jxkBjOeF1AjX2rCTeQg8IE8mw== X-Received: by 2002:a2e:9b89:: with SMTP id z9-v6mr10682930lji.121.1527588267625; Tue, 29 May 2018 03:04:27 -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 e21-v6sm2561718lfg.74.2018.05.29.03.04.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 May 2018 03:04:26 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Subject: [PATCH v2 0/9] PM / Domains: Add support for multi PM domains per device Date: Tue, 29 May 2018 12:04:12 +0200 Message-Id: <20180529100421.31022-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180529_030440_303897_4A5BA91A X-CRM114-Status: GOOD ( 17.03 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:400c:c09:0:0:0:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , Rajendra Nayak , Geert Uytterhoeven , Kevin Hilman , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Jon Hunter , Todor Tomov , Viresh Kumar , linux-tegra@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Changes in v2: - Addressed comments from Geert around DT doc. - Addressed comments from Jon around clarification of how to use this and changes to returned error codes. - Fixed build error in case CONFIG_PM was unset. There are devices that are partitioned across multiple PM domains. Currently these can't be supported well by the available PM infrastructures we have in the kernel. This series is an attempt to address this. The interesting parts happens from patch 5 an onwards, including a minor DT update to the existing power-domain bindings, the 4 earlier are just trivial clean-ups of some related code in genpd, which I happened to stumble over. Some additional background: One existing case where devices are partitioned across multiple PM domains, is the Nvida Tegra 124/210 X-USB subsystem. A while ago Jon Hunter (Nvidia) sent a series, trying to address these issues, however this is a new approach, while it re-uses the same concepts from DT point of view. The Tegra 124/210 X-USB subsystem contains of a host controller and a device controller. Each controller have its own independent PM domain, but are being partitioned across another shared PM domain for the USB super-speed logic. Currently to make the drivers work, either the related PM domains needs to stay powered on always or the PM domain topology needs to be in-correctly modelled through sub-domains. In both cases PM domains may be powered on while they don't need to be, so in the end this means - wasting power -. As stated above, this series intends to address these problem from a PM infrastructure point of view. More details are available in each changelog. It should be noted that this series has been tested on HW, however only by using a home-cooked test PM domain driver for genpd and together with a test driver. This allowed me to play with PM domain (genpd), runtime PM and device links. Any further deployment for real use cases are greatly appreciated. I am happy to to help, if needed! Kind regards Ulf Hansson Ulf Hansson (9): PM / Domains: Drop extern declarations of functions in pm_domain.h PM / Domains: Drop __pm_genpd_add_device() PM / Domains: Drop genpd as in-param for pm_genpd_remove_device() PM / Domains: Drop unused parameter in genpd_allocate_dev_data() PM / Domains: dt: Allow power-domain property to be a list of specifiers PM / Domains: Don't attach devices in genpd with multi PM domains PM / Domains: Split genpd_dev_pm_attach() PM / Domains: Add support for multi PM domains per device to genpd PM / Domains: Add dev_pm_domain_attach_by_id() to manage multi PM domains .../bindings/power/power_domain.txt | 19 ++- drivers/base/power/common.c | 39 ++++- drivers/base/power/domain.c | 155 ++++++++++++++---- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 2 +- include/linux/pm_domain.h | 79 ++++----- 5 files changed, 216 insertions(+), 78 deletions(-) Acked-by: Jon Hunter Tested-by: Jon Hunter Acked-by: Jon Hunter Tested-by: Jon Hunter Reviewed-by: Rob Herring Acked-by: Viresh Kumar Reviewed-by: Viresh Kumar Reviewed-by: Viresh Kumar Reviewed-by: Viresh Kumar Reviewed-by: Viresh Kumar Reviewed-by: Viresh Kumar