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: 137134 Delivered-To: patches@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3845302lji; Tue, 29 May 2018 03:04:27 -0700 (PDT) X-Received: by 2002:a2e:2948:: with SMTP id u69-v6mr3740190lje.130.1527588267873; Tue, 29 May 2018 03:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527588267; cv=none; d=google.com; s=arc-20160816; b=In28RTWUODJugOuavIf9JPDgS4q29PnhJmXaE9nUkdVzRhUU7eHvDvX8q5IhpcgUDP /K9/OCHdRzoNWprz6mcHJkIdFDmnlzVvvVUW20Gg49GcxYinoXLhND/2nYN+wJjDhFAE BQCjgZrQ+N/CWSa03S8N05XrApueNXHpvt2a/AfsXLpuK+Li1voHrPLz6EFF+Ultlice ytRh0iFR7DrL/Z0IIS6Zyz9s2FQwJw6vItn0DNFUrQFy8CGuCfT2sWfCW4usBgw0XDjB U9zHp+0ZFEw4iuYnZhmV5o3qHCb9EHnF5wCtdzHTwlwGwCMLjZ+V0clM05ZF+7yqrG/Q bbWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=GXhK1/flt4Ho3posxsl4AhuoR08jhDEdbM1B5kSVClY=; b=BvEDjrW3KHeJvcZsCJuYSV16Q2729GyvGfG5776wn4gHOjflbuGeTseX2tBaDdQsMB 14WZ8VR/OL6yl65mQLfx8A4SGa1CsCy60tFLrq19Vt2BLNVmOAxlL3ew7vJ8bBJgqNWS Gh++tyyD6Nk7IujocaNOnlCD/KPgY94kiPmt/KPFaKzyrcVO1fwGXLTYWQNuNLt48pNq 9FfsSThLEeiKDfkbmSba5tsxXPIkXjY/h0bok5xsQK+CWWiHjbyd23qsVsXDTDtdS4VQ JT/iyNHV2FV9wBlcE4giIkaGF+i/O4DuyPbIXN3PZL4OEHy3zCeypL8tVuE0UlO4gGxG 7jSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G7NdfK6Q; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id o6-v6sor7012738ljc.35.2018.05.29.03.04.27 for (Google Transport Security); Tue, 29 May 2018 03:04:27 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G7NdfK6Q; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=HKxZlNhwt8xH19Po1AkNltAOXvqt8Guzx6WsJk0/9h9PbB6NxSasB0dJR4ABxUg0SN S+7RbWpUyR7Qu8H1bAa3uVc695ar30DaGTRb+hSeBvgPcbh8i1DumiLUVekmKjWvBDx9 J/a6eGbcoppAgrgq7whTc3nQ7zJ74HsXR+9wn0a9ShrlRVTIqjTfbH3VuoNG5KQ3kzy0 GAz9cBxNemHUa5EgpSvXnha2LJrT8DERlJxnmLdgxlyxilxc5RIJbACYg8mKATRGpzHX PjvpEKSxo4TgAnuyhLczyMKRSTz7zWE8++79fRTuRANcXWayGicH6vzBPc/PtVYb12nK 5xAw== X-Gm-Message-State: ALKqPwfcZIb056xintEm94BGZxq5w1TouEXFAWGGPwhesKdriMElJ6Ra q6jgJaOTfico3/TbkMwqGXx76iSN 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) Return-Path: 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 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 Reviewed-by: Viresh Kumar