Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1022064rwb; Tue, 27 Sep 2022 07:30:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4kICcwZIMvB+qZDoRhwdWO6G6A9XKy4+sCwnJ3Dg/yaUxNWSktkdY7nPwgmYI4p2M6iJp5 X-Received: by 2002:a17:907:2d9e:b0:782:69f2:a0ec with SMTP id gt30-20020a1709072d9e00b0078269f2a0ecmr21166023ejc.680.1664289025314; Tue, 27 Sep 2022 07:30:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664289025; cv=none; d=google.com; s=arc-20160816; b=PIgCisMatwdmWvw4xxhtOXoETXCPJVL/yM+cOgIvvkBtZqfBE6DKkAdyF2jeQB180F uTKqHQPW1RhdJIBAk3aMNHlemLGs3CqKzFK3KYWKVpexy7K6f3/8wX3Nvyrx/xNOXYzE oCDj2v6/L9he54aAtE7Tzr1n3qUAYIsIxf5zEt1BfzQorqMCkP82d2g37zWNabJ7Zvk/ 4frPpHOF4+Mx0nrc/RYaUAPng8Vl+dEI6QrlB94oXHXwQrJgTosSmFm4AWyHE/pwdsnQ /H8WuJ5IvuEyc161lDQWqvN1WIgAZ0WFkhe3dUGRWFQLG2Z0zeBCJ6ZSsYomajn3KUu/ La+Q== 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=Oxh+GrGgW5Md/ssq5B/P1uixYEHvWSD7HAtKuTrp8ws=; b=WZLhoaxFB8T51IHTJ8GYF9xvS8rbGoIKhQzgv+KtBo9I7PI2KiEXBMnsyFY0hDeSlm lO5ZGfzTsujj2Vm59d7unHRJDxRdNfhmcTY/cV7Hx9DwX5P5WIu+GrWBESgFNXnrxo4E 45SZj6pXfAbCc2LgltdbHOU02Zm/pEKSrO0LZq0GUpiOP6zoyWS3fadOmrVQRjEwSOG1 2Pke2Iw+iU50ldSNPwhQ0C4QR7otB5owOH+Aj0Il23wobt/tA4ntYQg37w8VJQwQPsdQ ugJ0YyZ1wBxsSuy3bisbGSNlFC2Zn9i5KJBWINq81xLv/Qeld57UC2HLcHG4HMdeImSF 7obg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kwWYQBcJ; 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 17-20020a170906211100b007833cbbb747si1280948ejt.578.2022.09.27.07.29.58; Tue, 27 Sep 2022 07:30:25 -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=kwWYQBcJ; 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 S231464AbiI0O1H (ORCPT + 99 others); Tue, 27 Sep 2022 10:27:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231687AbiI0O1F (ORCPT ); Tue, 27 Sep 2022 10:27:05 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEAF6E62E9 for ; Tue, 27 Sep 2022 07:27:03 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id z25so16016758lfr.2 for ; Tue, 27 Sep 2022 07:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=Oxh+GrGgW5Md/ssq5B/P1uixYEHvWSD7HAtKuTrp8ws=; b=kwWYQBcJQDPMoCbe5L0ONOgX7dAaz/hzZIE73gFP53KUL8HJlLM5ns5ztbYPjP2MY6 1EG0A8RBurq0SvWYG8cmIXOpjy53hFEZvurDE7P07tPBd3are6N9PdUmGyzf7hClCNy/ rPj6wm9tK6HEFxEVbHMhQuS/wmSe4P/wyT9RtQis23sORgLfKVxpRGGU0FD3+Wwj6EUi tCQdFw039Fve2WC2G6OGgl0zackViCXno781D9n75HdkgufEY+l0IVpK/CIG5Lhv4/mP VabJx2dbsrHfR11+DYdX1tlY4ytdYUTHXzcUW3yKVCTVXzRWl/0omoWC8Kk03PIXTfnV SHfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=Oxh+GrGgW5Md/ssq5B/P1uixYEHvWSD7HAtKuTrp8ws=; b=ok5c5fNAtPte7zB3bIUfzJBAxA3H/LZG8o6jFEssjIRZ/9Tfcb3zHhXmcyXx8UKD6c cCrO3+q7bIr/D3ZBcgw1JNF3W/nrB48mlcijhI3UGFpXshI5prax67lAKAusxXle7eBw AumHwhnFRloFtVUGBRnVtWGDef/yCyunKQcO/Hn0bxq0CffvdmTJD7aaNVPevZlz6IUg tv5KNsKMQJz+/BZctzlaCoxuhBqNDl0Fu8khDh/0CnVlEaFOwj0aq00QjFCWtD8/aLIz 3Do4543LYtHEi6nTuHEcVNJVriM/8iJRkR2ft8jWd3nvTtsYorbgnm2F3d5AV14/JkUR j0jQ== X-Gm-Message-State: ACrzQf1KCnxWqXTZSP73rzXEeK09zP+hMXOKRYEIst82i7DfjwkKGvg2 NeqQ1xfZ/vyD20BZJ6F29oLr7w== X-Received: by 2002:ac2:5584:0:b0:497:815c:d854 with SMTP id v4-20020ac25584000000b00497815cd854mr11214397lfg.532.1664288821907; Tue, 27 Sep 2022 07:27:01 -0700 (PDT) Received: from [192.168.0.21] (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id f25-20020a2e3819000000b0026c47426cd0sm170134lja.140.2022.09.27.07.26.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Sep 2022 07:26:59 -0700 (PDT) Message-ID: Date: Tue, 27 Sep 2022 16:26:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH v1 0/5] power: domain: Add driver for a PM domain provider which controls Content-Language: en-US To: Geert Uytterhoeven , Ulf Hansson Cc: Francesco Dolcini , Mark Brown , Krzysztof Kozlowski , Robin Murphy , Max Krummenacher , Linus Walleij , Max Krummenacher , Linux PM list , "Rafael J . Wysocki" , Kevin Hilman , Andrejs Cainikovs , Biju Das , Bjorn Andersson , Catalin Marinas , Dmitry Baryshkov , Fabio Estevam , Geert Uytterhoeven , Marcel Ziswiler , NXP Linux Team , Pengutronix Kernel Team , Rob Herring , Sascha Hauer , Shawn Guo , Vinod Koul , Will Deacon , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux ARM , Linux Kernel Mailing List References: <20220609150851.23084-1-max.oss.09@gmail.com> <20220726160337.GA41736@francesco-nb.int.toradex.com> <20220728112146.GA97654@francesco-nb.int.toradex.com> <20220909142247.GA238001@francesco-nb.int.toradex.com> <70ee4f8e-7529-307e-656c-2a65d0187af6@linaro.org> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 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 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 27/09/2022 14:49, Geert Uytterhoeven wrote: > Hi Ulf, > > On Tue, Sep 27, 2022 at 11:49 AM Ulf Hansson wrote: >>>>>>> The main concern that was raised on this topic was that we have to >>>>>>> somehow link the power-domain to the specific peripherals (the power >>>>>>> domain consumer) in the device tree. >>>>>> >>>>>> Yes, that is needed. Although, I don't see how that is a concern? >>>>>> >>>>>> We already have the valid bindings to use for this, see more below. >>>>>> >>>>>>> >>>>>>> Adding the power-domain property there will trigger validation errors >>>>>>> unless we do explicitly add the power-domains to the schema for each >>>>>>> peripheral we need this. To me this does not really work, but maybe I'm >>>>>>> not understanding something. >>>>>>> >>>>>>> This is what Rob wrote on the topic [1]: >>>>>>> > No. For 'power-domains' bindings have to define how many there are and >>>>>>> > what each one is. >>>>>>> >>>>>>> Just as an example from patch [2]: >>>>>>> >>>>>>> can1: can@0 { >>>>>>> compatible = "microchip,mcp251xfd"; >>>>>>> power-domains = <&pd_sleep_moci>; >>>>>>> }; >>>>>>> >>>>>>> leads to: >>>>>>> >>>>>>> imx8mm-verdin-nonwifi-dahlia.dtb: can@0: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+' >>>>>>> From schema: .../bindings/net/can/microchip,mcp251xfd.yaml >>>>>> >>>>>> I think it should be fine to just add the below line to the DT >>>>>> bindings, for each peripheral device to fix the above problem. >>>>>> >>>>>> power-domains: true >>>>> >>>>> Again, as Rob said, no, because it must be strictly defined. So for >>>>> example: "maxItems: 1" for simple cases. But what if device is then part >>>>> of two power domains? >>>>> >>>>>> >>>>>> That should be okay, right? >>>>> >>>>> Adding it to each peripheral scales poorly. Especially that literally >>>>> any device can be part of such power domain. >>>> >>>> Right. >>>> >>>>> >>>>> If we are going with power domain approach, then it should be applicable >>>>> basically to every device or to every device of some class (e.g. I2C, >>>>> SPI). This means it should be added to respective core schema in >>>>> dtschema repo, in a way it does not interfere with other power-domains >>>>> properties (existing ones). >>>> >>>> Isn't that already taken care of [1]? >>> >>> No, because it does not define the items (what are the power domains and >>> how many). This binding expects that any device has maxItems restricting it. >> >> Right, apologize for my ignorance. >> >>> >>>> >>>> If there is more than one power domain per device, perhaps we may need >>>> to extend it with a more strict binding? But, that doesn't seem to be >>>> the case here - and if it turns out to be needed later on, we can >>>> always extend the bindings, no? >>>> >>>> Note also that we already have DT bindings specifying "power-domains: >>>> true" to deal with the above. Isn't that what we want? >>> >>> You mentioned it before and both me and Rob already responded - no, >>> because it does not restrict the number of items. >> >> Okay, so maxItems need to be specified for each peripheral. It's not a >> big deal, right? It's a bit of effort to add it manually to each device binding. It just does not scale well. >> >> Of course, it would be even easier if the core schema would use a >> default "maxItems: 1" for power domain consumers, which of course must >> be possible to be overridden for those consumers that need something >> else. But perhaps it's not that simple. :-) I think this would be the way to do it properly. > > It's not that simple: being part of a PM Domain is not a property of the > device being described, but a property of the integration into the SoC. I agree. This concept of power domains for every device does not look like really describing the hardware. The hardware itself, e.g. some camera sensor or I2C device, might have power supply and reset pin. It does not have something like power-domain. Although one could also argue that it is the same case with SoC blocks - being part of power domain is a property of a SoC and its power domain controller. > All synchronous hardware needs power (single/multiple), clock(s), and > reset(s). But the granularity of control over power(s), clocks, and resets > depends on the integration. So the related properties can appear > anywhere. Best regards, Krzysztof