From patchwork Mon Mar 20 13:42:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 665476 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 42863C7618A for ; Mon, 20 Mar 2023 13:42:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231433AbjCTNmj (ORCPT ); Mon, 20 Mar 2023 09:42:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231183AbjCTNm3 (ORCPT ); Mon, 20 Mar 2023 09:42:29 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A38ECB74B for ; Mon, 20 Mar 2023 06:42:25 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id x3so46840516edb.10 for ; Mon, 20 Mar 2023 06:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679319744; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=KrZdAoTHd1rYa6+2bns0LZXrcUZt1Y0m6OA8qCzTSf0=; b=nKq81/J0FvmXA5JsN+7z0xgyaD9ypIJv/BMXgeposmSq7l8XikkO3z4up7Arj9kxwi VuV2Ip6nA1LpGeefrIatp+un0KTSs0rYOS6Tns2H8z0qDvBpOQn4PGu/17PQCK9/UrzB yjh5iCdll2J6urVxY2BAcIEfwBQm44lRHj4nFo9prwAtLKSjAEph5Ln1HT9R9Y9bLrc1 9VArIsZE/0RK4GeOFr3eStNrxoP7l7MQOVxbIByaB70Fr0BlXOjIEf+KCuOyZH/BI93l GP1lLQIpAnmwfrEAXAGbt+3Jw8C7d0gMuunLiRhQY6q7LhdK5hkG2BqUO/wAk0Yf9dUc ETjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679319744; 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=KrZdAoTHd1rYa6+2bns0LZXrcUZt1Y0m6OA8qCzTSf0=; b=aRkNsRHvvporbM42c/7m2cZBvV2ke0Ew8vcHS4B6iUdgGSLQYFdOje8bnIUzZ4Qy5+ 0PO49o5hZXJEzccniOgo4+bT6gUnrMVcVT/8/MK0OaTGkxDTcRdgaua3TOi7s8lF8iB/ kbVc9cX7oUdnIw1pKYQwGV/9hvY/9uEHfoDqyPc1IHI2QvG+cviv+MnufPEWBMAeFBUk AHmhDO3E1Vlcqqwz3SPDrhTXVB/FtQAguoI/RL0sD014hPBC2zD0Vl1fGGX9tcnlCzk0 NifGh6HraGod6BKO+t6j4W4sz81w4PPT5vbLsxREQwMTIF+du0UqzSg8xUP6x/wXYg1C H7mg== X-Gm-Message-State: AO0yUKWIJLc6+GgftrdH/HJ8dDaI61H6YohHDrRaotR8hHk8JlfGe/ww 3zfjOJMKvTUTyFknrigpekvJ/A== X-Google-Smtp-Source: AK7set8a5ZEuGsV4rxIxgp5mWPOeREMId+pRDTv53eMzIMjUrfk9Hm1tTkVX6dtosamqVSw3/ut4yA== X-Received: by 2002:a17:907:86a8:b0:937:9a24:370b with SMTP id qa40-20020a17090786a800b009379a24370bmr1347382ejc.67.1679319744054; Mon, 20 Mar 2023 06:42:24 -0700 (PDT) Received: from localhost.localdomain ([94.52.112.99]) by smtp.gmail.com with ESMTPSA id u23-20020a170906409700b009334a6ef3e8sm2368602ejj.141.2023.03.20.06.42.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 06:42:23 -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 Cc: linux-pm@vger.kernel.org, Linux Kernel Mailing List , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, Doug Anderson , Matthias Kaehlcke Subject: [RFC PATCH v2 0/5] Allow genpd providers to power off domains on sync state Date: Mon, 20 Mar 2023 15:42:12 +0200 Message-Id: <20230320134217.1685781-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 There have been already a couple of tries to make the genpd "disable unused" late initcall skip the powering off of domains that might be needed until later on (i.e. until some consumer probes). The conclusion was that the provider could return -EBUSY from the power_off callback until the provider's sync state has been reached. This patch series tries to provide a proof-of-concept that is working on Qualcomm platforms. I've been doing extensive testing on SM8450, but I've also spinned this on my X13s (SC8280XP). Both patches that add the sync state callback to the SC8280XP and SM8450 are here to provide context. Once we agree on the form, I intend to add the sync state callback to all gdsc providers. Currently, some of the gdsc providers might not reach sync state due to list of consumers not probing yet (or at all). The sync state can be enforced by writing 1 to the state_synced sysfs attribute of the provider, thanks to Saravana's commit [1] which has been already merged. [1] https://lore.kernel.org/r/20230304005355.746421-3-saravanak@google.com V1 of this patchset was here: https://lore.kernel.org/all/20230315132330.450877-1-abel.vesa@linaro.org/ Changes since v1: * Added the qcom_cc sync state callback which calls in turn the gdsc one * dropped extra semicolon from pm_domain.h Abel Vesa (5): PM: domains: Allow power off queuing from providers soc: qcom: rpmhpd: Do proper power off when state synced clk: qcom: gdsc: Avoid actual power off until sync state clk: qcom: Add sync state callback to all SC8280XP providers clk: qcom: Add sync state callback to all SM8450 providers drivers/base/power/domain.c | 3 ++- drivers/clk/qcom/camcc-sm8450.c | 1 + drivers/clk/qcom/common.c | 19 +++++++++++++++++++ drivers/clk/qcom/common.h | 2 ++ drivers/clk/qcom/dispcc-sc8280xp.c | 1 + drivers/clk/qcom/dispcc-sm8450.c | 1 + drivers/clk/qcom/gcc-sc8280xp.c | 1 + drivers/clk/qcom/gcc-sm8450.c | 1 + drivers/clk/qcom/gdsc.c | 26 ++++++++++++++++++++++++++ drivers/clk/qcom/gdsc.h | 6 ++++++ drivers/clk/qcom/gpucc-sc8280xp.c | 1 + drivers/soc/qcom/rpmhpd.c | 19 +++++++------------ include/linux/pm_domain.h | 6 ++++++ 13 files changed, 74 insertions(+), 13 deletions(-) Reviewed-by: Ulf Hansson