From patchwork Wed Jun 2 10:12:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 452486 Delivered-To: patches@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp429497jao; Wed, 2 Jun 2021 03:12:30 -0700 (PDT) X-Received: by 2002:a2e:91cc:: with SMTP id u12mr6130868ljg.53.1622628749964; Wed, 02 Jun 2021 03:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622628749; cv=none; d=google.com; s=arc-20160816; b=hlHIztHCOKhbmumMXjvwBFYJ5AKNk/WE1S/3LdGNdddP5ZRAi4+TptfFsGGmnmJvMP gDCaz34Cz3vkcCeGNdFkffOqB0uc6fUBvLkAssE2B4tbj1LvY60wzbtDuqHEIarVqSR6 5SUBvBRsKGNwjnV4aWMA+ARxI8FPYOlRB0lK0IJ3lszN0AHCyqSO4rfn5fXTpnjihWXP 0vzC4qeeZJ23+GUiuTk9TP+Q4FqZGTgfT8WZpASMRfe/ac21BmF424DP5x7MAzlVh3JB 23UAunyDNjMwpgLArM6TuyWB0TSqqF6cGeBmdA99QYwYt9DcrsN2KbQyKNgdNfaEGBZ9 jM2g== 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; bh=slzS5YZjZxl565Kd+2lXyghUenj3OYVJLEop1Uqbr+w=; b=kRMTRxm+psIQYfyyH1c/+/hwzee89rVymnSJYrHh2AH+cXGWCVuTF0k4tdCbidke9j TKh302Kc0kTd9xVm6BrMyHivor8qobckm4Dyx1vCHw8T1RQzLDIkY8cdFyx/zRWV6JG+ di7rBL7wIzvoc2Whw3LVTSedx/zvpTXW96dfVOw7KNCc013vcAQVZyEsTdUaAaYG1dL3 a6y3KalYOmWuxDM0qP/uf5K45o//qH35iTgoHb4lDtuB8fZweHEQLN2QZEwzeOAAe9y4 I25x0k9eA71O6mGkfBfdNNF/H1BVfnzi4OGFHSfp0/rPlhBJPV8hXEZScsLFJyid9T+s 60qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oMkbusaI; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 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-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id n21sor8721627ljg.3.2021.06.02.03.12.29 for (Google Transport Security); Wed, 02 Jun 2021 03:12:29 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oMkbusaI; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 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=slzS5YZjZxl565Kd+2lXyghUenj3OYVJLEop1Uqbr+w=; b=oMkbusaI+atgT4iQ2MrSJwQ489dT1MD7I9rbptbNlBVQ4o7cpLIC8AbaY03ZmzXVn5 zjzJe0XDnJrD3JD1soMrauHuOgjOiGXCY4DT2AxDWW7u9QhPXPi+G1P6g32mv0uB4yxV JudFNjxWyxpJp/1dXd7E/4a4RvAkyNMNQUgDLbRpSJqcf9U86YcxmFqK32cUAKGdzSLn Mx0UabYcvmpB3DtRjLuKWkUUoTddVzZrSaRxoGowFvqbUyGGta99sltyMw5A99aA+Yib kdaoJI5ffUZiPSvuacnfrl0d0sC2kzzWe11Qxmew+60F8dWNurpM3UbISlpdrbWV4HyX KAHA== 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=slzS5YZjZxl565Kd+2lXyghUenj3OYVJLEop1Uqbr+w=; b=NZqZyuHzOjboq/21NrOQr7tRssqVGzq78gE/SU4M3wrIZLGyLKYJMsby/EjWNwd8Ko dR7RZRplF/B7iD88nAdvjUokRfzLB/FaP0G4vWBkMfHwZfX83zKYNwOp53JWEKYOOTPz RhpJqWoOYK7HzanmitYfjxuHg+saT1D5fem3vh2gVdfmF5m1O7RX7AxI0bw0eVVT06nz +1vpVj8Wx+IP8naLu2Ll5JUQ7I5MPTRUT+Z+z6Al2TvdC18M9utp7TV6ZqwTyrGeHcM9 e9ydjMqoeoQhMy0+DipXYGI/BVqAUithdtSMlpT0r6y/aBKjY8LntMnNLoN5mnWi2NSA lJBA== X-Gm-Message-State: AOAM533nBEkQOvtW0/PKc53jGtUG+AXTxkOFch3uc3JeEnjvf7LGq2Nx Ayqjv87otqyocXA8/wo8XyBMUwmH X-Google-Smtp-Source: ABdhPJyLUiGKrkXuEIpXMj03EEh0a0syVDYqqtQUysi0GWfDCtQYSve4ntEt1YwOshobDqSD8KBEug== X-Received: by 2002:a2e:b0e4:: with SMTP id h4mr13970498ljl.463.1622628749599; Wed, 02 Jun 2021 03:12:29 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-155-4-129-146.NA.cust.bahnhof.se. [155.4.129.146]) by smtp.gmail.com with ESMTPSA id y35sm1948938lfa.122.2021.06.02.03.12.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 03:12:28 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Viresh Kumar , linux-pm@vger.kernel.org Cc: Ulf Hansson , Dmitry Osipenko , Jonathan Hunter , Thierry Reding , Rajendra Nayak , Stephan Gerhold , Roja Rani Yarubandi , Bjorn Andersson , Vincent Guittot , Stephen Boyd , linux-kernel@vger.kernel.org Subject: [PATCH 0/3] PM: domains: Avoid boilerplate code for DVFS in subsystem/drivers Date: Wed, 2 Jun 2021 12:12:12 +0200 Message-Id: <20210602101215.78094-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Various discussions on LKML have pointed out that many subsystem/drivers for devices that may be attached to a genpd and which manages DVFS/OPP though the genpd performance states, would need very similar updates. More precisely, they would likely have to call dev_pm_opp_set_rate|opp() to drop and restore OPPs (which propagates upwards into performance states votes in genpd), every time their devices should enter/exit a low power state, via their device PM callbacks. Rather than having to add the boilerplate code for these things into the subsystems/drivers, this series implements the logic internally into genpd. Concerns have been raised about this approach, mostly by myself, around that it limits flexibility. On the other hand, it starts to look like more and more people are requesting this to be manged internally in genpd, for good reasons. So, I think it's worth to give this a try. In the long run, if it turns out that the flexibility was indeed needed, we can always deal with that as special cases on top. Test and reviews are of course greatly appreciated! Kind regards Ulf Hansson Ulf Hansson (3): PM: domains: Split code in dev_pm_genpd_set_performance_state() PM: domains: Drop/restore performance state votes for devices at runtime PM PM: domains: Drop/restore performance state votes for devices at system PM drivers/base/power/domain.c | 66 +++++++++++++++++++++++++++++-------- include/linux/pm_domain.h | 2 ++ 2 files changed, 54 insertions(+), 14 deletions(-) -- 2.25.1