Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19529882rwd; Wed, 28 Jun 2023 10:28:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+cMBievxJBYp43D1uLI3vRc93vm7GPPBeqbjgCciJUA3+rYPsogsxCBT2mzZDRcDRoYS0 X-Received: by 2002:a05:6a21:7894:b0:125:699a:6d0a with SMTP id bf20-20020a056a21789400b00125699a6d0amr23458591pzc.33.1687973293555; Wed, 28 Jun 2023 10:28:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687973293; cv=none; d=google.com; s=arc-20160816; b=h15Zz101qjs4532RvwWSUZwn8jhiCSJ5kjXI9+KxuPkbrDzvxKUsvZO3vDotn3oNpY edFZY8kjbaYjNXbyfKNhpSAwv2w9k03wRgsBjGrPjAywiici9lYTTSlTtXOaNHRpSN+r ZlLDIMdThc2yAz/f59YZ2+hnDpheOZmonO+/gOmK1tZ5xU+Pydj3p+wcV1WyMZeqdUgy e+9GcFQP3fvs1MyS3apR+JU/KPW9YyyBDgfrw7lGFh3imzpXN8TboaHuWP3vXTwZy1EF 0ULRDEsMsvvm5+sKjL72bwmaNK9ZmhDTSwMQHhPi1zLzBFMUPu0JiYgp+v7tdlHmM7f7 ExiQ== 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; bh=VbUqL3lkPrbDEkfTX0dVSMWRRHNmDzK4Uvz2oqjSIU8=; fh=KAC8+0z2Y95oJWAIkNxhUl/UWnxGlQkT21PtZIPYw+U=; b=MunhYxLHWt/iLWO3NIfeFFkZf374ZV1IG+sNQ9GnDz9jUjXdytKj43snatBUBQjCxK d2gg4U+FKwQuaS4vyIO0M1P8ULxBwHxCGYhK9UnYANG5biblDUw4RBLkDsoltmWE6u0y OyhVzr55T01XFnfhs6+f/S41JT120l1V04Pu8HhP4VkQ2j3IAT5Kd6SxwVowYtE9zr+t 1Y3l1Ywl3htoPgA/nLuv/fm6Enrg8m3XZ3p/nlP95u996FcgUrDxS3jZ4Fq/jDaXUnd1 3sD85iTHYEfL8MpaibXiqyxgdZaoxOPzDgixH2k2ZyZfRY34L853KYucxFhRoaio/Tlc xlqQ== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v22-20020a636116000000b0054294720d55si30864pgb.262.2023.06.28.10.28.00; Wed, 28 Jun 2023 10:28:13 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232049AbjF1RP4 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 28 Jun 2023 13:15:56 -0400 Received: from mail-ej1-f54.google.com ([209.85.218.54]:40082 "EHLO mail-ej1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230378AbjF1RPz (ORCPT ); Wed, 28 Jun 2023 13:15:55 -0400 Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-98e1fc9d130so1380366b.0; Wed, 28 Jun 2023 10:15:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687972553; x=1690564553; 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=/LwO02mTObe+XE/ZbgwuNMH8tuDZ5edg4iqXBtgQBUk=; b=kKJAovd8nDzpuJeNEu5eeMukFFz8qURc8zZVc8LTOuB1ldZ+dJCitRwMdxD9HsweZj rosi5KfXb+I8aoIaKsh0MksjapsyQVDjU7rECgirmmnuwCvGAdvMtlYa68OTnaD7wly/ eb02hVEs5AoYfY+uNdgLpYTiznBulnPpmJVyjNcerrb6TRCiiFOPcWTBsyQonzqLlmAQ BavAH6474ohDGKUBpmnq4yN6/aJVs3wq4OfNHskktL4l6cMM53V4lK9Dxt7p8HqPPVfQ irLEGItqKrVp2lkegKCA4DB+V9Hu8m4zImfZkhJcq2n4v7ecVdPlJfLh5b1O9ULs9tfI EyZA== X-Gm-Message-State: AC+VfDzT6P4vekd0Dvki5rgM0B03eIDbEPGA5/7GR3jLG9FEfsLOPHuw d3kDz4XGbWuYTNagoX+Jvx0+7RLT3E6WxpRKJTc= X-Received: by 2002:a17:906:209e:b0:98e:886:e6bc with SMTP id 30-20020a170906209e00b0098e0886e6bcmr9714752ejq.6.1687972553371; Wed, 28 Jun 2023 10:15:53 -0700 (PDT) MIME-Version: 1.0 References: <20230628105652.1670316-1-abel.vesa@linaro.org> In-Reply-To: <20230628105652.1670316-1-abel.vesa@linaro.org> From: "Rafael J. Wysocki" Date: Wed, 28 Jun 2023 19:15:42 +0200 Message-ID: Subject: Re: [PATCH 0/2] PM: domains: Add control for switching back and forth to HW control To: Abel Vesa Cc: "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 , 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: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 28, 2023 at 12:57 PM Abel Vesa wrote: > > 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(+) > > -- I can queue up this series if I get an ACK for the second patch.