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: 921934 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-tegra-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; 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 vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40w8Tb08BYz9s0W for ; Tue, 29 May 2018 20:04:35 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932972AbeE2KEb (ORCPT ); Tue, 29 May 2018 06:04:31 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:56149 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932888AbeE2KE2 (ORCPT ); Tue, 29 May 2018 06:04:28 -0400 Received: by mail-wm0-f68.google.com with SMTP id a8-v6so38802323wmg.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=arfgGR6t2U8Paq3k37Djh21sRxMQHgqWMg/twUHPsFLeFOxbUbpBwUm25xTo7HSmgo 7mQ+C05dC6Z7uK9uyt5xQMHnAo5upp9cKZj1smuD1uTxjpwMxemv8YzEdmxMum8fQL1X kSuqzpEc1hLRD9eIVRv9HKKUGnNvVHyKSkIllqCvnYEM8CPb16+bJLobf4P0LJ7ijkCG 32pEz/Bd2WPHg63WdWzcVtV5ERPfCM/AhhM+puYiL/f73z8cb8QFkJNMt9PHcA5lh928 tJ8mj6Z2Wr5nfz8L5gQxYIQyEcV5ur+nTschDppRpML0fD5iH/zEY1J5hvqwNF9WimKW bwXA== X-Gm-Message-State: ALKqPwcdPqcv/F1ZO7eiDmOn0bVlZ/Cg7nvaS3SgKRBPGPtEhHg4vduS FORpfmUF95cVE+P7Xv+zr8KIxg== 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 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 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@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(-) Reviewed-by: Viresh Kumar