Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp891354rwb; Tue, 27 Sep 2022 06:04:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5faarM/+k1XdBCCNorY3T+AMqTjveHMtfefDDRywXugJzHmDSaBZ6QULECgpF88nKSCYh2 X-Received: by 2002:a17:906:fe09:b0:73d:90ae:f801 with SMTP id wy9-20020a170906fe0900b0073d90aef801mr20980560ejb.699.1664283867264; Tue, 27 Sep 2022 06:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664283867; cv=none; d=google.com; s=arc-20160816; b=VGRZiGhpjQdXvBuL/QoXZlA2ALENKwo7xxByqats7sn7Mp4AExu/mPZXiSbuMz1awp 7GkQMdu+/zVzveBMO7ZSOaRS8PtPj2BhdHNfFzlbsNEq0m5kedtlGvYyymvZjCyE5fpF koTozzz1yzlbDTLwx7nDLSOUwB4M1UfJ936eKMS7XImpjmY1g9gK1ZJl88S+Icwnr1ba fZ3bwYVto3rUwHys4shrt9v5FafKElaxF3i2kbaSuIaESOUejQExpgQ4cru2qHq+YpJZ +ErzbpFU7kLLVv/K13xv00Y72lrUkTcQLQrgHlkwon0diVaH6KIa5nYVMSPRV7zwsJ4S jQ5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=kxKNS5DDyDVwQYf8SSh+Z282XSXl8OO2BaUjOfJxTOs=; b=y1KHP0u7P91eHQ1wngWRPnchaxs+y9tCiThMD9wWdAhUlMjBObPdDa4hiNLldLinqS 3pseRySD+ydisfuZrNJkRTSDsvJkBU5u6HFn2GKtKu7z0if/jfozzz2z4ESlydO/Oevw 4mKuNkMXAff8qMQJ8LLmzd6k92jbut5oA4KW2YXmVxYxDHzPToEqeR59uLhQ0vFpKu3A 9UjLzhNI2PTtSGqYFeV4wmlJTv3gluy5XrzIGy1gF4MivF+jvXzGaSsU5U8lWAEuOw/1 u5wfD0GFmrZdLlzEc43z8sP2sq+4UxfIEx8NXnNLyEJJeFwjZC0kxfn1Fo+QVOrurW3k o0Dg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di19-20020a170906731300b00782c1d273cbsi1593321ejc.392.2022.09.27.06.03.47; Tue, 27 Sep 2022 06:04:27 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231881AbiI0Mt0 (ORCPT + 99 others); Tue, 27 Sep 2022 08:49:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231445AbiI0MtT (ORCPT ); Tue, 27 Sep 2022 08:49:19 -0400 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4CC4167066; Tue, 27 Sep 2022 05:49:17 -0700 (PDT) Received: by mail-qk1-f175.google.com with SMTP id x18so5911004qkn.6; Tue, 27 Sep 2022 05:49:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=kxKNS5DDyDVwQYf8SSh+Z282XSXl8OO2BaUjOfJxTOs=; b=xb6AyPT0DL1frZJ//0cOhbZdCmM8J0lIRf1W6Pmx9QR/wzkQOLYzooofyE033sdQT4 BVhg9ssWXT74uSFLT0DM+441DkrbYQJIigzv9desA8Poa3mDemECt//lO0IJGHgpA0Cq V57BkUfYvtC8vIfogrIvouNHfZch3XwNYKM5jRoq1EYvbSGe9PPcfCYehdRQnZIfQViH J/xMC2dAHAapwcBxP9KrV/0CKaXCkpsLIeVMGMiGT9+ex7qXXVogKizDA5HZryJPa0sq i8/A03XLyzBvMIwMGW2CBuH9I0IgPEjUUoKUK3G1bZNDGypbgsh7M8guQdinP969h/J9 SZ6Q== X-Gm-Message-State: ACrzQf3rQ0d/VHEdO7GWNciJu+Az6WGZGnJeAkUJFId1thvI8UEsOBmi /UPL+gM79Ns3/SPmDvi2lNIoEH5hWr5JUQ== X-Received: by 2002:a37:852:0:b0:6cf:7510:3c91 with SMTP id 79-20020a370852000000b006cf75103c91mr14259370qki.657.1664282956686; Tue, 27 Sep 2022 05:49:16 -0700 (PDT) Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com. [209.85.219.177]) by smtp.gmail.com with ESMTPSA id c25-20020a05620a269900b006cea2984c9bsm939654qkp.100.2022.09.27.05.49.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Sep 2022 05:49:16 -0700 (PDT) Received: by mail-yb1-f177.google.com with SMTP id 4so3923511ybe.2; Tue, 27 Sep 2022 05:49:15 -0700 (PDT) X-Received: by 2002:a25:8e84:0:b0:696:466c:baa with SMTP id q4-20020a258e84000000b00696466c0baamr24148017ybl.604.1664282955514; Tue, 27 Sep 2022 05:49:15 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 27 Sep 2022 14:49:02 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 0/5] power: domain: Add driver for a PM domain provider which controls To: Ulf Hansson Cc: Krzysztof Kozlowski , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no 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 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? > > 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. :-) 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. 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. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds