Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19030515rwd; Wed, 28 Jun 2023 04:13:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ433TDpIAah7H8il07D0i/yiTDkyjKedPgzKNHGhMcyV0E5kyeaLKr9n9SK4Ic84XtXmtrB X-Received: by 2002:a05:6a21:6d88:b0:10b:764b:a942 with SMTP id wl8-20020a056a216d8800b0010b764ba942mr1465799pzb.11.1687950838686; Wed, 28 Jun 2023 04:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687950838; cv=none; d=google.com; s=arc-20160816; b=FMAoWAELs/p4Y4c7sRG3hexOTfuii5Bfvt2yggjIjYL+79hpCS4zBW76KF50Di6No8 ZEmA8pb68069S5tBzSBzkd+XIS3SF9jHZAa+LGHGjBr/uPB4wKjehSI+jJgCZI+yGh9U pdFdaRwu7Xe4KdfZOx41Wiwr3GAONmFkA2FAXOtfi768k1C8g3hLuHuQH8BbxFBUnd48 saMNnhDOj2i2SGYSBzleCPMeiZ2DAi3zNGry/002cYALl50aBWZ2pUDzGQXXdM6j1GDS SptTKHW6UvmoJPZabEW1sQ05dm/Sc3E/nnLko60ao9ARm6TUD0/wWa/vAeTUemwITSyL vDNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=mTQsoS+h53Vzzjs8qIkqE4wzhWloV1Y4NhbaPd70qbM=; fh=yUwTDGrsvlHouV3fEPRrlKTGD+MlkkPh+H7LyYpVu8M=; b=E/QFoO4MgfRXwOxiRGr2lcKZuK5JdEC7uFldHc1cu3rsXXC4nbVQRKoQRgCJFjt84x Xt9MSDzgJMbvi3JsWD2P2+5RFqF6X1CfQyKMnjQrN5tphnY2TEOqNIAtUYWlC98wflP3 aaglXKfJnrDSxx6QWafH4kvZcVPabR2yFr0XrlfIbRkmYbu+yjIaZez9321lyjjXo8Cu BENEKTwyvoxf5KFWJlxfbWB0WuCGlEyedCYsZWXuDfqGnRI27E32UigfIr4Fj/2ws5ln kGX+N6h8u4V3YTebNDWfhIYyZuJkUlpgP0/eNYR67VJRlSeNpF2sxrEnROj4md9ucrhb rjiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Fb/Wu62f"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l13-20020a6542cd000000b0053b8f80c63dsi9230228pgp.734.2023.06.28.04.13.46; Wed, 28 Jun 2023 04:13:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Fb/Wu62f"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230507AbjF1K51 (ORCPT + 99 others); Wed, 28 Jun 2023 06:57:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230332AbjF1K5A (ORCPT ); Wed, 28 Jun 2023 06:57:00 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24EF410EC for ; Wed, 28 Jun 2023 03:56:58 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-98df69cacd1so397776166b.1 for ; Wed, 28 Jun 2023 03:56:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687949816; x=1690541816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mTQsoS+h53Vzzjs8qIkqE4wzhWloV1Y4NhbaPd70qbM=; b=Fb/Wu62fN9GstdwqxVGC9NlOLfqSqYunhCsHpNEsTngqJ05R6sbGO6EgkSCfC1O1KU Rp5DtAcNNhomPtbP1F/Zlc6CnHdUmNlh43TqMavwb4JcwmLgkdunqhQ0gF/HLPBhtVFb pQ871BCyLXXhg7YbABeh4F6v8gJC29AbEIBjudezHIKkQe8dNPVq5CHfZvMCEecowkkH bjfUdhjAoQgIcZ2FFoHdXJSNDylD2m2FdTquenR3st8z29J2qkgYZsDyTY0Y1o2zTc17 9t9x5vI0OEr6WZZEcF1tU02KQ9kr27Ma1nPLTLfrqipHihWq6LHtMQWFjCEIqfFW4MGA 7RkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687949816; x=1690541816; 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=mTQsoS+h53Vzzjs8qIkqE4wzhWloV1Y4NhbaPd70qbM=; b=jWvhvqGKMvq6Moq0BnkeCzltoqxTcKXcynIVxnVJJUDnihL3ExRnOAPN/WMgaz759G eF6P36NHnRKlqxPPwD31xHSF80EwiI76ffNKKKEBj1SRMFZlPBdsPTuLGJPgtAqi9Otd Cq6fpwftvUHdD3PPX9SBuyENhIFtUqMN0M7J460njF4rXHRpydHZoBScppU4cX5hwLHv 9CQBvv2tRPC1HNQh0CSa+YXrQAXNsWkcfgO8KRBWF7sh3G8PXBIeFZnbdihopuMwhl+c R03fupklS/w+vOOe9wIcdrcKmBTKv9sYqe7muCddadRj2oj6B80NwZ93YqyI9ntf0c5B xjpA== X-Gm-Message-State: AC+VfDzNMg+fmxWFIRmxmNaxAss5q+9YflE4dmz4osEW4h1TMVKM9H8Z 9zObbXshpejbpjrJy5LszOQTGA== X-Received: by 2002:a17:907:7291:b0:98d:d26c:e142 with SMTP id dt17-20020a170907729100b0098dd26ce142mr11584981ejc.46.1687949816608; Wed, 28 Jun 2023 03:56:56 -0700 (PDT) Received: from hackbox.lan ([62.231.110.100]) by smtp.gmail.com with ESMTPSA id e8-20020a1709062c0800b0098921e1b064sm5544678ejh.181.2023.06.28.03.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 03:56:56 -0700 (PDT) From: Abel Vesa To: "Rafael J . Wysocki" , Kevin Hilman , Ulf Hansson , avel Machek , Len Brown , Greg Kroah-Hartman , Bjorn Andersson , Andy Gross , Konrad Dybcio , Mike Turquette , Stephen Boyd , Taniya Das Cc: linux-pm@vger.kernel.org, Linux Kernel Mailing List , linux-arm-msm@vger.kernel.org Subject: [PATCH 0/2] PM: domains: Add control for switching back and forth to HW control Date: Wed, 28 Jun 2023 13:56:50 +0300 Message-Id: <20230628105652.1670316-1-abel.vesa@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is just a resend of [1]. This resend just adds the back story behind the need for such a generic API as a cover letter. Also added my SoB tag to Ulf's patch. Some of the newer Qualcomm platforms support handing of the control of some of the GDSCs (implemented as power domains in Linux) to some device firmware. The idea behind such approach is that the firmware knows best when such a power domain can be powered off or not and leads most of the time to better power consumption. At this point, if such GDSC provides HW control support, the current implementation is switching to HW control right after the GDSC gets powered on and it is left in HW control mode until right before the request for power off is done. This needs to remain as is for now, as we do not know for sure what each firmware expects from its related GDSCs. For example, the venus driver expects the codec GDSCs to remain always in HW control mode, otherwise the firmware would crush. But in some cases, the consumer driver needs to switch back and forth. And the explanation for such case is when a driver needs to interract with the device (e.g. reading status bits) and the firmware doesn't guarantee the GDSC will be enabled when in HW mode. Therefore, the consumer would need to switch back to SW mode, do its thing, and then switch again back to HW mode. This is where the patch from Ulf comes in. It allows consumers that actually need to control the HW/SW mode to do so. The GDSC patch just implemets the set_hwmode op and sets it for each GDSC that provides HW control mode. [1] https://lore.kernel.org/all/20230627104033.3345659-1-abel.vesa@linaro.org/ Abel Vesa (1): clk: qcom: gdsc: Add support for set_hwmode_dev Ulf Hansson (1): PM: domains: Allow devices attached to genpd to be managed by HW drivers/base/power/domain.c | 66 +++++++++++++++++++++++++++++++++++++ drivers/clk/qcom/gdsc.c | 22 +++++++++++++ include/linux/pm_domain.h | 15 +++++++++ 3 files changed, 103 insertions(+) -- 2.34.1