Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19867429rwd; Wed, 28 Jun 2023 15:52:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4octPvUGZXDDW6E/Fj3mcZylfFKuMMZaPlEx7y0WZiTQRuvkzhfxRmla8XjQFhhsPHrplY X-Received: by 2002:a05:6512:3f05:b0:4fb:752c:3240 with SMTP id y5-20020a0565123f0500b004fb752c3240mr7196294lfa.68.1687992728014; Wed, 28 Jun 2023 15:52:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687992727; cv=none; d=google.com; s=arc-20160816; b=vOQ3InopoAdLETFsk7iEI0V+nBxXZxDvwGqkBjTMYwsSA4EAAOdWi3sKVx9h5tJLYG 7pUqVthKOrC2rZrbU7S8pm71O2sRLc82ItzOUe/Etp2pw0WbNmqrq9ZFYAMal7sgF5q7 9D9WeW2vptx+JsWNOB5ZcfK+oEIupyvWGoefUFQ+3v2Ca2VN89QskhKGiXJbslj38R5w zeNMLaG3jyV1mYbQWcGT3+LLYDx26XFf3dNTUFrSEL+X0QTBoHhuNlfJrxdWND5iJb2T eOmwvOfjG2A8BD5Q8kRtC1XCpX7P5j3nmYx6cuigZibr8u9JuUOuj3vSMjket+NzDHYn +ytg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=hnGMQOEnuXwr/opUEDGr/9OsjO1I6gHLazySPyM8Vng=; fh=UakhD7uATsaRhk7eaz9hwsmWCS+NEYRxNrRIOjaaOSs=; b=D2eLjitChfrK+CFTCAVJg5LdAS90ZlOpuhHS9LpGE4YSntJzZ07nFZ8dLwUofuJuND IOIjQLUfcHWyPvVYflkqHN7xP9bHSFddxVSYY0NAbT+3gkvx1zRWhWy1XDofNp9ZTB3B hehXR9We0dQPw/dgIVuZYmSxzlSD+SrESZ81DvC++zqCYFwayDPsO8pTq4DE/umXpqj7 MM8lp/fhPVyXeQfy50RubXYTN1nYlp/WLdbl7mE/4C7SmcrW8Wfx/7wXacN/sx/Bc2Ce IWsa/TAF1n/IYyKNlLqO8FHGEwfvJawtyhzvPM95sH3SalFls2JgjZgkl2X7Rs3UDUug YMcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CUQC9Y0e; 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 g7-20020aa7c587000000b0051d96d158f8si4410817edq.581.2023.06.28.15.51.43; Wed, 28 Jun 2023 15:52:07 -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=CUQC9Y0e; 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 S232100AbjF1V5Z (ORCPT + 99 others); Wed, 28 Jun 2023 17:57:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232190AbjF1V44 (ORCPT ); Wed, 28 Jun 2023 17:56:56 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30BC42D66 for ; Wed, 28 Jun 2023 14:56:32 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id 3f1490d57ef6-c13280dfb09so10980276.2 for ; Wed, 28 Jun 2023 14:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687989391; x=1690581391; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hnGMQOEnuXwr/opUEDGr/9OsjO1I6gHLazySPyM8Vng=; b=CUQC9Y0eQtr0n5pjuu2Txm57WGoabBOUVRjQ5EHElC3JMNgpioNjrtlcoP5zbhWO1O Rf/R60eeZb+7LKZt51pv+J/dMGFxdPoVwNgWW7x1+Ujl+EdwYo1VXnQsB/B5/SFvEfwq AonYCd9uflcMdqxozOZbma0uz55i25/BhftkpLEeuCb1IF6AFoMwcrOIsv5+w1I57IO9 R8XtcQogCe0Z8jcrJnJTy2YOjXcfIWgqZWmr+UiPd+uXGX4QlVT/DOO5zTQt1IDGVmzY i4TUL80wSMN4CpMrpnWxQDD/SlK6xBYsDK8+F1mKPfTGZfMMoskacTFx5N79B0551sox JceQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687989391; x=1690581391; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hnGMQOEnuXwr/opUEDGr/9OsjO1I6gHLazySPyM8Vng=; b=aTdSCdWqdac3xJ59JePuIhMmyaAo6isjapA+jA0ko+8bN8S/VBeP9+fINmipeL2uG1 nIPInwKC1IN/nrbFu+hVyEvxrFg0YYY/GXd+g7DjSWqgzcvrvNHld3aXevSdazeYsxbc kW0dwoYDEtJpHv9K3634M04rpIF/5Za1rxW+bJ1870viM0z7PpjBWM+jLNC5sWkOcEHR xdOSg3S7iwrAZ7vvmGhLDMw/wxgtYpTJwootqjiz8rAf2O3yqPDUQ2XJfW49caUceNNZ csB8QcnjTdLN9XBVJwR7+B50hBMYNZ6+5LIRP6onvD1cNc5yYjEiemR/tRsqcmbN1VSq sDTw== X-Gm-Message-State: AC+VfDw0cI2Y0L00K0bBJhmnkG9JoSKu/zsdn3X9Xv1YEwhbumck/yoN eSUbDwfoQFosj/R9aKVVUUrTv0is+QJZdTdISk8w7g== X-Received: by 2002:a25:a4aa:0:b0:c00:e6c4:1812 with SMTP id g39-20020a25a4aa000000b00c00e6c41812mr19609040ybi.63.1687989391111; Wed, 28 Jun 2023 14:56:31 -0700 (PDT) MIME-Version: 1.0 References: <20230628105652.1670316-1-abel.vesa@linaro.org> In-Reply-To: From: Ulf Hansson Date: Wed, 28 Jun 2023 23:55:54 +0200 Message-ID: Subject: Re: [PATCH 0/2] PM: domains: Add control for switching back and forth to HW control To: "Rafael J. Wysocki" Cc: Abel Vesa , Kevin Hilman , avel Machek , Len Brown , Greg Kroah-Hartman , Bjorn Andersson , Andy Gross , Konrad Dybcio , Mike Turquette , Stephen Boyd , Taniya Das , linux-pm@vger.kernel.org, Linux Kernel Mailing List , linux-arm-msm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=unavailable 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 On Wed, 28 Jun 2023 at 19:15, Rafael J. Wysocki wrote: > > On Wed, Jun 28, 2023 at 12:57=E2=80=AFPM Abel Vesa = wrote: > > > > This is just a resend of [1]. This resend just adds the back story behi= nd > > the need for such a generic API as a cover letter. Also added my SoB ta= g > > 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 devic= e > > 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 th= e > > 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 w= e > > 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@lina= ro.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(+) > > > > -- > > I can queue up this series if I get an ACK for the second patch. Thanks, but please hold on until you get additional confirmation from me. I would like the consumer APIs that are being added in patch1 to have a user. At least I want to see a plan for upstreaming one user of it, before I think we should move forward. FYI, there are discussions around this offlist too. Kind regards Uffe