Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp220417rwb; Wed, 28 Sep 2022 01:34:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7EiH+icH3MHxIkCWTITOpyRTNnCE53T1GQl5gJWsk/g0yBipTqMVMvsXjdTRomnI6KywpZ X-Received: by 2002:a17:902:d485:b0:179:e4a2:18c2 with SMTP id c5-20020a170902d48500b00179e4a218c2mr8643303plg.160.1664354043963; Wed, 28 Sep 2022 01:34:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664354043; cv=none; d=google.com; s=arc-20160816; b=thXmxQkDdv+K6lXPwthSTeEZKHmCTkwqeWpQ3i+IqzYn4MLeazV0YvzrUr/kyxZ+Do l4+AG5/wS/vQg0KWQcv4ZqOo3Ff5rpCwl19CHObZ0qrt8XS18r2WXBatHg7+u+bu7MaU y/uzY9YJIMKqc0X9b0rT3xOc/vpb9XrWudhkBsL9Y9+7lY/1obljZ6vIldDGJESvEJIk lJpDvekcftU/bqHfe+t5qi0vhD9vx7hKSEKM9zYDPEoZ6c3315lOc8435sJRaUDHroW5 ySPbESkjEpMKU8eGytl4ch76b/HJaJAmazpoxqbJjOZI3RQrW2swohRs4bJpnXOyoUOX UumQ== 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:dkim-signature; bh=lZABSm1MI5ZlgjTgFMO1+1NygwzeGaWl5MgvQA5quIY=; b=ZzpoWoCf+msYkop58Fl9/wC18IQ3XLeCWCnvxmvzCXfv8hpO6DM/DmWK9icXZN/BNL /mnt302YCebWIYkGGuOEugMDflH1oYapHkVJMV3Z3y8tV3GNbpv6oo+EZ0dewPgfpjqU FcYiqqLusoNVpFHv2OssTYAR1MbUC/b0UewCA9LBJNjQkBR1aIXFoO1pLwUwwR59qEm6 wI3XliF4M9nXDsNSqDwkahDZTPVql/OlX7bCm7GRWOtYJKNXmgdA68R6y2CmKLil03Ff QYDBX1WZEyGGll970n5MYgT77xbKQL5hDgxuuura1teMNYPPyudELs6+YqanAraPziIQ W4Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="EbPTGC/2"; 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 t19-20020a632253000000b00438f77814b2si4980427pgm.124.2022.09.28.01.33.52; Wed, 28 Sep 2022 01:34:03 -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="EbPTGC/2"; 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 S233670AbiI1IAc (ORCPT + 99 others); Wed, 28 Sep 2022 04:00:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233806AbiI1IA1 (ORCPT ); Wed, 28 Sep 2022 04:00:27 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1C2742AFB for ; Wed, 28 Sep 2022 01:00:24 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id jm5so11114367plb.13 for ; Wed, 28 Sep 2022 01:00:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=lZABSm1MI5ZlgjTgFMO1+1NygwzeGaWl5MgvQA5quIY=; b=EbPTGC/2CFOGZdWxCZerJBIVQYHm8YqogP+f28KIdCJMXvNJKO91f7SN0E3tHB5UZK hGsTY+WAlShyt4kXWnofCNb+Mh1ZAgVSklBPMZ2x8IES5nIMGhvN2oBiBTfiMTblmzp5 Jr7LRh0ZRy8rs7uR4BzYmV1j0XU8N8E/X2s1EnsgQQmF06MdAtP+3ItwD2BZIFVmya31 kEgfsf1CLGmpyIgzy/clcIIaFTQZu0NAxbNdhQLKuYzWgpsOpmBm61mstf44Hr7d/eNE pbA0Sz/W2c1J3RIs7rn4uKdOS8n8jDgM+gsn/TEafOYR70qoRcEoj3et5hANEvMbLn0t VKXg== 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=lZABSm1MI5ZlgjTgFMO1+1NygwzeGaWl5MgvQA5quIY=; b=R6ycgfFMnTe8S66Sg8EeXsSe/6Fo0rzWPnK/4Fx62/xwoDA+33CLCDgUsku8YlQqaf iurUEOXNbh1b/TBbceAWt4QNCZKkEaHIt/LzpubeZYr1Kla6HfkcGAKRvPV6Z/9DjbgV TFfWAJ3sSCqvzw9Joj2oJPJRPfPznwFjQ7hiGEn41X5R91HZ6Bs5PUEiDVe2V3Q5mj4h R/P5j8dDzODeZM/3bq7QU+KUQNYkD7cg6PDAv7xAEgAv+YTOXCuFr28OqG9kVx8jvoGX 6FF11bgiSn0PAybvDTHXRUydPTpDIjzdVyQBMn+0rltPgIht7S1ElKyNr/58Tr9jPyWM kO3Q== X-Gm-Message-State: ACrzQf2+FYhRVDUa+6CRihO6C9efQz+KvqWs6BoDPbIi2xEX3WoMLEFA 5eRi2mufrG+Xeh64G2htpue0VyLjaTDZIvREIOL5QQ== X-Received: by 2002:a17:90a:aa96:b0:205:bb67:a85f with SMTP id l22-20020a17090aaa9600b00205bb67a85fmr9025181pjq.202.1664352024285; Wed, 28 Sep 2022 01:00:24 -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: Ulf Hansson Date: Wed, 28 Sep 2022 09:59:46 +0200 Message-ID: Subject: Re: [PATCH v1 0/5] power: domain: Add driver for a PM domain provider which controls To: Krzysztof Kozlowski , Geert Uytterhoeven 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 Content-Type: text/plain; charset="UTF-8" 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 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 Tue, 27 Sept 2022 at 16:27, Krzysztof Kozlowski wrote: > > 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. Whether it scales or not, that's how the power-domain bindings for consumers look like. It's the similar situation for clocks, regulators and other resources too. My point is, for the discussion around $subject patch, it doesn't really matter what option we pick. The DT docs for each peripheral need to be updated anyway. > > >> > >> 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. Yes. DT describes the platform too, not only the SoC and its IP blocks. Moreover, as the power domain bindings were added back in kernel v3.18, that's what we have to describe these kinds of platforms. [...] Kind regards Uffe