Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3204042imm; Tue, 29 May 2018 03:05:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrWYsqFgEmc37ETvHGnn/xZfjuimv3WNIOtN247EHrQiOGh7enKwePyHPLrQm0STUVkDFZC X-Received: by 2002:a63:7848:: with SMTP id t69-v6mr13360480pgc.380.1527588329497; Tue, 29 May 2018 03:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527588329; cv=none; d=google.com; s=arc-20160816; b=sfM0Kc4OtvSKx3ajeuBg8Sw4NGxBtpc6tp0zcnH4gyLB7eH4fUh9NRt5MENa9B8LCU XPNG/6+rauZvSASCEuKmS17vtJhWG2GNFH8YF7P0AbfQ/J1RwoTiFArs9gTYi2QVgRAZ PPE8KjIouUQ6VNbchkRKfBnv1ARZZ9evpYrjAtu32CO/VxNyaVYFoJcl42fq6PGvHHHg SLaJIXti3UQfOpGQfqr2HxT4KrlxNQsvA5J73STLfZeYfLCPt08LvvOLkvnG3yReLSFt VG7s69VYxfHrhLyeRUhbgVdInyo/sgoF7qiWdEFuD+N2QX9Z5x1CDICv/A5VWksAOygl s0rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=GXhK1/flt4Ho3posxsl4AhuoR08jhDEdbM1B5kSVClY=; b=u7FBfgRChvBckNqGLmg57UgyxaB6Woc8zGLnODJN7a2q5Zc9+93i8R3JkHgNjxPQls pMTWIHnXY4gxl2JQScYoQ11i0+QOXWhZK06mqsVgfhRBlcrM7vBQEGTmOgRw42s9VggM p/xd2WUWRMf0yHpknDdM95GKshytOpiZo6jwAZ19bC+4H+iFUgr0jhmw9w06pMOvCfGw miysDKsIDJ9FS+3KVoIdlogHYTqH0Im5pi4iyRZeNL/KKY3TnTevrHZb2C+zKi73eit2 YGLNhXPVruc38l8T6eb92724tUPX+w3i2AQ07vKwh+herdy3EqNY81bd51wXkqmSdH9q BraQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G7NdfK6Q; 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 89-v6si3846510plf.224.2018.05.29.03.05.15; Tue, 29 May 2018 03:05:29 -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=G7NdfK6Q; 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 S932910AbeE2KEf (ORCPT + 99 others); Tue, 29 May 2018 06:04:35 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:56148 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932828AbeE2KE2 (ORCPT ); Tue, 29 May 2018 06:04:28 -0400 Received: by mail-wm0-f67.google.com with SMTP id a8-v6so38802322wmg.5 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=Fe6BsIZA+lYTdOoZlDzMz+KRxL5HhvsrBaWjHjI8XQYAMZHw/QEFU2vdkIoVSod+Yc m+AH4kScGKc8yByePJ8945UDEtM8l8dBNH0YglzLgp0jS/e3JTDe0/rcN+QcHlA/rck1 Uy2xF0qeUozlaVFbIcswNtGHX0tVq/XYnAfFWD0J9yaoAclX1z1plLXeuEYy+VM8EHRG CoxUyLF3KHAlXCyXuzOCoXMoE5HhVM0tppUP161D0dIh/kzj/DSfKvic6trlgh+YKedO 1LOUSRrFz1uuxMJNXUE1UY1gyiLbMcyfJCM1krHJ48/E0U/JmugIgppHgwPCvXkO7w3h wp7w== X-Gm-Message-State: ALKqPweKeNgWUZr1XSU7Azh8jCTAm3weAjljmB85QXR6a5vC3l8pYnHX at3bHyBHnSFJq91r7VHEv7UgpQ== 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 Cc: Ulf Hansson , Greg Kroah-Hartman , Jon Hunter , Geert Uytterhoeven , Todor Tomov , Rajendra Nayak , Viresh Kumar , Vincent Guittot , Kevin Hilman , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) -- 2.17.0