From patchwork Thu Sep 24 11:04:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 256709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92DACC4727E for ; Thu, 24 Sep 2020 11:06:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 45BBB239EC for ; Thu, 24 Sep 2020 11:06:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mufSaWhJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727393AbgIXLGQ (ORCPT ); Thu, 24 Sep 2020 07:06:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727422AbgIXLGP (ORCPT ); Thu, 24 Sep 2020 07:06:15 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7A46C0613CE for ; Thu, 24 Sep 2020 04:06:13 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id w11so3454972lfn.2 for ; Thu, 24 Sep 2020 04:06:13 -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=LzyEVfHWmhqp2YeTW1iTgqjO0Sx0b8TSpBv6gZq633w=; b=mufSaWhJTEpeaZqLGunvZqqHp9vEfBBCJzxEWCpJIHPJWzWi4QefkwK17iHLj/pM7s fo3Q/6tkCYEU1JO1FR8d0Fw1SbQjuYNK7wD1jJbywuEiIMVj1wu0Mng26Fk8TMYlTMB0 ij9xlXAM5BmSstdnt4c6W+tgp8uqsCiOftPyb/HBtk14B1VLqILUzVHnIWT+skfcvSUt U8qor5QHgb8M4sS19ELlkfjSP4OJ8fk7aoQwkmaWj9VdJN7KhP6kR53XUzhLzSssLOfs TO42wpmo034sPiyRDcX4NGwSLBrA3zYMOw4IZcHOTu/pGikUUPWXM4fOpxD0Y/ULdQP+ lwew== 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=LzyEVfHWmhqp2YeTW1iTgqjO0Sx0b8TSpBv6gZq633w=; b=aZIy2P+jEuLXD1kdzKGzpPraHmEql3TMKJiFICCJ3D9rRmD8iuPiYqezv23GWIKFDQ bxRqBRBrmEIcEhkI8NHmQ1hJKBUJfRvKNNwUvGyGWjPSJqI3zhYexwtAT3uE+JPTzkiO v+kjZEiQjUAi6F/V0d6zee3DY5vNcCRfvd022q7u0ZVALmKAv6xGN/2l/dborL4cS5wx ff1oo1EG8u6aWWF434m2ohYLNGiyf/yfN7g1JjCX4vX3TbWdbkgFDDlmd4NjM6+Aln3I 3ENhK9MOhOUoJ4gaDcNAwX1DX7Btdf5GNR4GpJdlLW4SxGBtY/l07qZKxIHHqrPBn8h6 QlvA== X-Gm-Message-State: AOAM532pz8h4gfV/ITHj/fwg74j2s28uc87ptRn96ua3V9oZaK+nDT6j gn7YePDCTUNsOlNj1gApZfby0w== X-Google-Smtp-Source: ABdhPJx2FKWu3aQ4RnPGtoMvMr5etGzGRJYG6Q3BiqdvsBtHHdBydd7wU/4y8htyLWyho1WG9GSMIg== X-Received: by 2002:ac2:5110:: with SMTP id q16mr102229lfb.561.1600945572287; Thu, 24 Sep 2020 04:06:12 -0700 (PDT) Received: from localhost.localdomain (h-155-4-133-169.NA.cust.bahnhof.se. [155.4.133.169]) by smtp.gmail.com with ESMTPSA id w4sm1762393lfr.139.2020.09.24.04.06.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2020 04:06:11 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Kevin Hilman , linux-pm@vger.kernel.org Cc: Sudeep Holla , Lorenzo Pieralisi , Daniel Lezcano , Lina Iyer , Lukasz Luba , Vincent Guittot , Stephen Boyd , Bjorn Andersson , Ulf Hansson , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/3] PM / Domains: Add power on/off notifiers for genpd Date: Thu, 24 Sep 2020 13:04:46 +0200 Message-Id: <20200924110449.329523-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Changes in v2: - Improved error handling in patch3. A device may have specific HW constraints that must be obeyed to, before its corresponding PM domain (genpd) can be powered off - and vice verse at power on. These constraints can't be managed through the regular runtime PM based deployment for a device, because the access pattern for it, isn't always request based. In other words, using the runtime PM callbacks to deal with the constraints doesn't work for these cases. For these reasons, this series introduces a power on/off notification mechanism to genpd. To add/remove a notifier for a device, the device must already have been attached to the genpd, which also means that it needs to be a part of the PM domain topology. The intent is to allow these genpd power on/off notifiers to replace the need for the existing CPU_CLUSTER_PM_ENTER|EXIT notifiers. For example, those would otherwise be needed in psci_pd_power_off() in cpuidle-psci-domain.c, when powering off the CPU cluster. Another series that enables drivers/soc/qcom/rpmh-rsc.c to make use of the new genpd on/off notifiers, are soon to be posted. However, I would appreciate any feedback on the approach taken, even before that series hits LKML. Kind regards Ulf Hansson Ulf Hansson (3): PM / Domains: Rename power state enums for genpd PM / Domains: Allow to abort power off when no ->power_off() callback PM / Domains: Add support for PM domain on/off notifiers for genpd drivers/base/power/domain.c | 187 +++++++++++++++++++++++++++++------- include/linux/pm_domain.h | 19 +++- 2 files changed, 171 insertions(+), 35 deletions(-)