Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp784708iog; Wed, 15 Jun 2022 12:14:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vKGaME9eD+A5CZQ8CVOTNoE14T5JRPL9s34amVv7WQu6hvxDYHqMPt0vAqtIjAyM06aI8I X-Received: by 2002:a05:6402:28b6:b0:433:2b53:157a with SMTP id eg54-20020a05640228b600b004332b53157amr1581978edb.395.1655320490062; Wed, 15 Jun 2022 12:14:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655320490; cv=none; d=google.com; s=arc-20160816; b=hB0MHNM40z9O1xcFKHNIhtqu5M2bv2q8HPFKV6OpamLEgZSxrUHPzhlx/FrIZdtdjx caVT2hHuG74RXXmN3ECJuU8EEISFYpgpVlrhqJnXO6OGJ22VlWBZUjxd9Gm/+DpWjuJf m2LZEj4r7ttV5iD0oUV/+jy05/EiPwoLrNygealoWrPeTmlwn2h4dJzu/ejE+oZRGWVP 9L3bEgjP2S3p4U4p9hOEl9aB5fQIVQ3R7crlX5srs1uJcBKMqbzKC5oZ0tt3nU86CNh6 28Qan40dZ/bxA6rxIUpjiC/GR4+glVn7H/zZylvHSYKxuve+WPMpftBb2AaHX2ikAQeu 542Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=8AzuTqR/VhmKHqBcSBp3616lfq5fmK4NXiS/cbscqQo=; b=bc0QyLolYDc4MHlMjFCQxNoapRPscc3NLeg2um+PS0n88r2CRocqsv2o/4Ibjz22C1 q8ya36siv3nv9SNwM7y6JfC6txHFyoJuYEw0dBXQGOZ5Oun7GBgk796+kw2MG1J0GDBE VKxUMjN08zUu+RSfuX9xuVBwyq5YPL77c3dHucLBjch0U9VE+hKyBiCNZUWGSUZSky7t /nqvMxOqorlcsXMut/vZJcGSL3+bDcGMa56+XlCuvGtOCz9XA+Gt0xAIZu696IiCcPSK jNxSf5tqJ1YafFp0SqqW99UZVvAHI6N7GQVZ8WMmdJU3j2/qHYoeB9wnQNdqFVjRDT2F dokA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FtmPeXne; 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 hs8-20020a1709073e8800b00709f8689818si18186383ejc.627.2022.06.15.12.14.24; Wed, 15 Jun 2022 12:14:50 -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=FtmPeXne; 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 S243742AbiFOSs5 (ORCPT + 99 others); Wed, 15 Jun 2022 14:48:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242735AbiFOSs4 (ORCPT ); Wed, 15 Jun 2022 14:48:56 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5622A443C1 for ; Wed, 15 Jun 2022 11:48:55 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id t25so20248724lfg.7 for ; Wed, 15 Jun 2022 11:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=8AzuTqR/VhmKHqBcSBp3616lfq5fmK4NXiS/cbscqQo=; b=FtmPeXneVF60SDS/p0NbQJ9R/tZ9AFJWKhYXNUMwLOx24m3cNE7XPWo5GEvQrf/RaR WkZH7Dhpd3vMIQoObhBAr7tf0G4PwNzkjkjIRCQAsmydTZmCq3TKFkR6nuiMC0jXivRo 73yyPRFm0x+ee6MPpm0FegiDdzLpcSeV8YrdnNrP3/9BWLbirbD6IrzQUxV7XGgckjpI JYvltv0K8vwN7XoA6UDcGfUMobAti79mF2PnZaTLpIq4g+SS9DT1LSMv94K0JhVzfhpJ gMaLb/qMUqmm/fR50wkrr64P6P5N2heucbZMbNAsqtQOdJ3vv4q/S/BCgP8ITNR74FIA uO+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=8AzuTqR/VhmKHqBcSBp3616lfq5fmK4NXiS/cbscqQo=; b=lvU++hVqBCcypm+47CyXY6AvCc9C399mZyUyatXVI8jY99YRr9GV0Bhf51Ww5qmkyY FHkGVDLuxURgmAupsTg0Dqdyrd99m4u2ODWQUpQEJt7WIT765VV9UP+nHxze09bm7KyT QraCCC//KUHMiLnd025vyXbbdfeEtV/IR8HkDWseGPSClrKlo1PRCOrlN+NSzMfOduHl dGU5D+UuKIXSLxVXkmU9GkLdJM9ENrFdID4s67NmRMoSuyd0ancArZgcv6UXf3Mtr/N6 3XYtIcfFodVf9wvUp489IAYIHQKJ1j8RHbPkTK0bax1d4fACr9ATWshuPGL2jfhCBxsF 8/zw== X-Gm-Message-State: AJIora/yyfuuw3FsnGtiJxtidM2zXAKsPUUcnTky8mf/8MJ5GXrgXPDq xl/8D3/dOmWE16/41FyL8FC7acXdPes/Plr/ X-Received: by 2002:a19:ca0c:0:b0:479:46c:2917 with SMTP id a12-20020a19ca0c000000b00479046c2917mr527488lfg.160.1655318933653; Wed, 15 Jun 2022 11:48:53 -0700 (PDT) Received: from [192.168.1.211] ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id t7-20020a2e9547000000b0024f3d1dae84sm1793516ljh.12.2022.06.15.11.48.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Jun 2022 11:48:53 -0700 (PDT) Message-ID: <07fdc72f-1581-f683-5b60-1c38186512f5@linaro.org> Date: Wed, 15 Jun 2022 21:48:52 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v1 0/5] power: domain: Add driver for a PM domain provider which controls Content-Language: en-GB To: Marcel Ziswiler , "max.oss.09@gmail.com" , "krzysztof.kozlowski@linaro.org" , "geert@linux-m68k.org" Cc: "linux-imx@nxp.com" , "broonie@kernel.org" , Francesco Dolcini , "robh@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "ulf.hansson@linaro.org" , "biju.das.jz@bp.renesas.com" , "bjorn.andersson@linaro.org" , "catalin.marinas@arm.com" , "shawnguo@kernel.org" , "vkoul@kernel.org" , "geert+renesas@glider.be" , "kernel@pengutronix.de" , "khilman@kernel.org" , "s.hauer@pengutronix.de" , Andrejs Cainikovs , "will@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" , "rafael@kernel.org" , "festevam@gmail.com" , "devicetree@vger.kernel.org" , Max Krummenacher References: <20220609150851.23084-1-max.oss.09@gmail.com> <20220613191549.GA4092455-robh@kernel.org> <12e3bb72-af2d-653f-b342-c6b4d6a1f292@linaro.org> <8decc5b6d1f0bc028d60d444d939da4408e756d3.camel@toradex.com> From: Dmitry Baryshkov In-Reply-To: <8decc5b6d1f0bc028d60d444d939da4408e756d3.camel@toradex.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On 15/06/2022 21:13, Marcel Ziswiler wrote: > On Wed, 2022-06-15 at 10:37 -0700, Krzysztof Kozlowski wrote: >> On 15/06/2022 10:31, Marcel Ziswiler wrote: >>> Hi >>> >>> On Wed, 2022-06-15 at 10:15 -0700, Krzysztof Kozlowski wrote: >>>> On 15/06/2022 09:10, Max Krummenacher wrote: >>>>> Hi >>>>> >>>>> On Tue, Jun 14, 2022 at 9:22 AM Geert Uytterhoeven wrote: >>>>>> >>>>>> Hi Rob, >>>>>> >>>>>> On Mon, Jun 13, 2022 at 9:15 PM Rob Herring wrote: >>>>>>> On Thu, Jun 09, 2022 at 05:08:46PM +0200, Max Krummenacher wrote: >>>>>>>> From: Max Krummenacher >>>>>>>> >>>>>>>> its power enable by using a regulator. >>>>>>>> >>>>>>>> The currently implemented PM domain providers are all specific to >>>>>>>> a particular system on chip. >>>>>>> >>>>>>> Yes, power domains tend to be specific to an SoC... 'power-domains' is >>>>>>> supposed to be power islands in a chip. Linux 'PM domains' can be >>>>>>> anything... >>>>> >>>>> I don't see why such power islands should be restricted to a SoC. You can >>>>> build the exact same idea on a PCB or even more modular designs. >>>> >>>> In the SoC these power islands are more-or-less defined. These are real >>>> regions gated by some control knob. >>>> >>>> Calling few devices on a board "power domain" does not make it a power >>>> domain. There is no grouping, there is no control knob. >>>> >>>> Aren't you now re-implementing regulator supplies? How is this different >>>> than existing supplies? >>> >>> I believe the biggest difference between power-domains and regulator-supplies lays in the former being >>> driver >>> agnostic while the later is driver specific. >> >> That's one way to look, but the other way (matching the bindings >> purpose) is to look at hardware. You have physical wire / voltage rail >> supply - use regulator supply. In the terms of the hardware - what is >> that power domain? It's a concept, not a physical object. > > Well, but how can that concept then exist within the SoC but not outside? I don't get it. Isn't it just the > exact same physical power gating thingy whether inside the SoC or on a PCB? > >>> Meaning with power-domains one can just add such arbitrary >>> structure to the device tree without any further driver specific changes/handling required. While with >>> regulator-supplies each and every driver actually needs to have driver specific handling thereof added. Or >>> do I >>> miss anything? >> >> Thanks for clarification but I am not sure if it matches the purpose of >> bindings and DTS. You can change the implementation as well to have >> implicit regulators. No need for new bindings for that. > > Okay, maybe that would also work, of course. So basically add a new binding which allows adding regulators to > arbitrary nodes which then will be generically handled by e.g. runtime PM. Almost something like assigned- > clocks [1] you mean? I guess that could work. Remember that's why Max posted it as an RFC to get such feedback. > Thanks for further refining those ideas. Please do not do this. You have an external device. It has some input voltage rails. Please define -supply properties for each of the voltage rails. Explicitly power them on and off. Use fixed-regulator for your GPIO regulators. Other boards might have other ways to control the power supply. Then define the pm_runtime callbacks doing proper work for you. If you wish to do the magic, consider looking on the pm_clock.h interface (and adding the pm_regulators.h). But this approach can also be frowned upon by the PM maintainers. Nevertheless, this is the driver/core issue. The DT interface should be the same: a set of regulators and a set of -supply properties. -- With best wishes Dmitry