From patchwork Fri May 5 15:02:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 13232726 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B40CEC77B7F for ; Fri, 5 May 2023 15:03:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232349AbjEEPDB (ORCPT ); Fri, 5 May 2023 11:03:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232307AbjEEPDA (ORCPT ); Fri, 5 May 2023 11:03:00 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E77BF17DDF for ; Fri, 5 May 2023 08:02:54 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f1763ee8f8so13298425e9.1 for ; Fri, 05 May 2023 08:02:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683298973; x=1685890973; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=vPNq8x+5scNFhOFrThr9eIX+i+ZsMqOnHs2M2WuTbwo=; b=HXFrxhMereJ9btfSr9LxY3tv7rLs1IZj2Y5p6GppNwkQL0rTuRjQ1aGa1QtIHlDQym NY5t1Zd7kQ1gQLP3VNwDy9Ao+KRFl7fF8HYGiL35hod2478geb2zgUGfKv1gzgJep6Fk tujA4+981qIlsSMRnf23zTeTr5zYZzluG2l2nRK8kAVBpW6kHOoMDrG4tPeUpvFkOMRR t7ItPb6OHykWBQv4naa9H606Ek3Jui0zlv0GmsIi2/esY3kznHKlKsbuQfb7FmbVxtGv v+HErHrwMniE74ui+UyeFpmesevJKE8oO9gm4x0h4k1pAK7yXaH1TKPnXdK+ErJFdyR3 ag+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683298973; x=1685890973; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vPNq8x+5scNFhOFrThr9eIX+i+ZsMqOnHs2M2WuTbwo=; b=C2ghUMbvEU+Lp4L57cLFdeRn03BeWh0HTsQ4tiGCEUOgobJVteBz0hbr3nzS7z/sdt 3NNCYL235ssbdzDevq3dQq+sPZIgXPiFd2dGOUsmTmt/43sjz5w1tPEGeBzMXZb8ukXg c4Yeye3Y5g1HAPk1M7wAAC0RIcjqDT4f3iMcEMR43Ust0sTZjZasBbFw91+9R4YYc9PR sljdeHWJCbVtbXiCllmsClTl3NBwzEHcGjmeZZoiWFXmsSnDhjNAXWST6rDBz+Ol+tQc +lgYTWqiCUmg/797IHvqmsURpkn+6PrIg1fAiMRp/r1IwCkShnHsbVCvxIByGU761CjG UZTQ== X-Gm-Message-State: AC+VfDxfiWus0Plv2SLaUTyl8VJ58nr1PRZq1ZRXW3zFGZTpWz/7nYa+ qxWBSpLRTIjUHBXYBrNJz7s9qQ== X-Google-Smtp-Source: ACHHUZ552E1HSInQA+Wp1DS9m2O1OdUxQcw0FYXMFthsx50dEaV8iStUKJeF34SrXnWHI3zE6ZawpA== X-Received: by 2002:a1c:ed03:0:b0:3f1:e5f2:5e86 with SMTP id l3-20020a1ced03000000b003f1e5f25e86mr1300889wmh.23.1683298973330; Fri, 05 May 2023 08:02:53 -0700 (PDT) Received: from hackbox.lan ([86.121.163.20]) by smtp.gmail.com with ESMTPSA id a6-20020a1cf006000000b003f0aefcc457sm8262189wmb.45.2023.05.05.08.02.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 08:02:52 -0700 (PDT) From: Abel Vesa To: "Rafael J . Wysocki" , Kevin Hilman , Ulf Hansson , Pavel Machek , Len Brown , Greg Kroah-Hartman , Bjorn Andersson , Andy Gross , Konrad Dybcio , Mike Turquette , Stephen Boyd , Saravana Kannan , Matthias Kaehlcke Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Doug Anderson Subject: [RFC PATCH v4 0/2] PM: domain: Support skiping disabling unused domains until sync state Date: Fri, 5 May 2023 18:02:39 +0300 Message-Id: <20230505150241.3469424-1-abel.vesa@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This is another try at making the unused domain remain enabled until sync state of the provider. There have been already few attempts. Last one is [1]. This new approach comes after a discussion on the mentioned mail thread with Saravana and Ulf. The suggestion there was to move this to the genpd core. This new approach, first is adding the support for 'unknown' initial state of a domain, then uses 'boot status' to make decisions whether to power off a unused domain on late initcall or assume it will be powered off on the provider's sync state callback, if it has one registered. In order to make use of the newly added 'unknown' state, we need to update all the calls to pm_genpd_init to pass one of the 'on', 'off' or 'unknown' states. [1] https://lore.kernel.org/r/20230327193829.3756640-1-abel.vesa@linaro.org Abel Vesa (2): PM: domains: Expand initial state of domain to support unknown state PM: domains: Skip disabling unused until sync state arch/arm/mach-s3c/pm-s3c64xx.c | 4 +- arch/arm/mach-ux500/pm_domains.c | 2 +- drivers/base/power/domain.c | 62 +++++++++++++++++++--- drivers/clk/davinci/psc.c | 3 +- drivers/clk/mmp/pwr-island.c | 2 +- drivers/clk/qcom/gdsc.c | 2 +- drivers/clk/renesas/clk-mstp.c | 2 +- drivers/clk/renesas/r9a06g032-clocks.c | 2 +- drivers/clk/renesas/renesas-cpg-mssr.c | 2 +- drivers/clk/renesas/rzg2l-cpg.c | 2 +- drivers/cpuidle/cpuidle-psci-domain.c | 2 +- drivers/cpuidle/cpuidle-riscv-sbi.c | 2 +- drivers/firmware/arm_scmi/scmi_pm_domain.c | 2 +- drivers/firmware/imx/scu-pd.c | 3 +- drivers/firmware/scpi_pm_domain.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 2 +- drivers/irqchip/irq-qcom-mpm.c | 2 +- drivers/soc/actions/owl-sps.c | 2 +- drivers/soc/amlogic/meson-ee-pwrc.c | 7 +-- drivers/soc/amlogic/meson-gx-pwrc-vpu.c | 3 +- drivers/soc/amlogic/meson-secure-pwrc.c | 5 +- drivers/soc/apple/apple-pmgr-pwrstate.c | 2 +- drivers/soc/bcm/bcm2835-power.c | 2 +- drivers/soc/bcm/bcm63xx/bcm-pmb.c | 2 +- drivers/soc/bcm/bcm63xx/bcm63xx-power.c | 3 +- drivers/soc/bcm/raspberrypi-power.c | 2 +- drivers/soc/dove/pmu.c | 4 +- drivers/soc/imx/gpc.c | 4 +- drivers/soc/imx/gpcv2.c | 2 +- drivers/soc/imx/imx8m-blk-ctrl.c | 2 +- drivers/soc/imx/imx8mp-blk-ctrl.c | 2 +- drivers/soc/imx/imx93-blk-ctrl.c | 2 +- drivers/soc/imx/imx93-pd.c | 3 +- drivers/soc/mediatek/mtk-pm-domains.c | 4 +- drivers/soc/mediatek/mtk-scpsys.c | 2 +- drivers/soc/qcom/cpr.c | 2 +- drivers/soc/qcom/rpmhpd.c | 2 +- drivers/soc/qcom/rpmpd.c | 2 +- drivers/soc/renesas/rcar-gen4-sysc.c | 2 +- drivers/soc/renesas/rcar-sysc.c | 2 +- drivers/soc/renesas/rmobile-sysc.c | 2 +- drivers/soc/rockchip/pm_domains.c | 3 +- drivers/soc/samsung/pm_domains.c | 2 +- drivers/soc/starfive/jh71xx_pmu.c | 3 +- drivers/soc/sunxi/sun20i-ppu.c | 6 ++- drivers/soc/tegra/pmc.c | 5 +- drivers/soc/tegra/powergate-bpmp.c | 3 +- drivers/soc/ti/omap_prm.c | 2 +- drivers/soc/ti/ti_sci_pm_domains.c | 2 +- drivers/soc/xilinx/zynqmp_pm_domains.c | 2 +- include/linux/pm_domain.h | 12 ++++- 51 files changed, 140 insertions(+), 63 deletions(-)