From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9CAFC07E99 for ; Fri, 9 Jul 2021 14:03:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D189613AB for ; Fri, 9 Jul 2021 14:03:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231976AbhGIOGR (ORCPT ); Fri, 9 Jul 2021 10:06:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231732AbhGIOGQ (ORCPT ); Fri, 9 Jul 2021 10:06:16 -0400 Received: from mail-vs1-xe2d.google.com (mail-vs1-xe2d.google.com [IPv6:2607:f8b0:4864:20::e2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88F9DC0613E5 for ; Fri, 9 Jul 2021 07:03:33 -0700 (PDT) Received: by mail-vs1-xe2d.google.com with SMTP id az11so5641413vsb.1 for ; Fri, 09 Jul 2021 07:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EBkQv3Hb+EzyUp0xx15eV4nVWdwYInxQXj14j/hSkTw=; b=cV0PX7CieMyXh9iNqKRndqDwrdVktE8MpkQGh7gIJGtMwzmg139Lp1mpUyvfOxJwJ9 I9sgKO0Sin7o6j0hGdqAXONJfIj/MmANYUFLh8P1zCMChpnL7cNJA1aaVerT1WIN8dLn ymggkU6DMHnL8ZciNxRaMJ3n2zDGgNTaxPhtRjmbb7kuBsIf6CT0YHlUpFkWmLKeN7uc WFJwo6YHGgAyLe/mr1osIlySOLdQa5Trmz/RkFLYDd9EFDGefzxGMrJxNvM1RxFdAIZG AVrIZksQ7rmo+q6tH7fbS5k5KZXDBHa/vX08tU8exMfpC9kwwT6mOfWu9Z6fZ213MBSr yNbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EBkQv3Hb+EzyUp0xx15eV4nVWdwYInxQXj14j/hSkTw=; b=I1L/GQzIu/FotqyGZ9N+fkk/pav1wiR6lCJAYhJ64/WOZXuJS2Qp3smb+lU187ETxy 4xob5VQAH0p0C8l3+CZDB+kq0u5w0l8Z0fawTouOxnJw9UqT+JKHUfzbuNRslQUj5M77 fdb6P7GwhBl33aobnNbOfT6MWcjhtHzBByGRhx7G1Iy5fRa54KhnnxEye83c5rJmaaxo 31gvP0DMP1GRlNHGXKQMhMX7DJGzL5l9PgASEbZggr2RmzJacNXSK164PmmQ9ZyeZsCk R3EyVMZ64oMbEGu+v5SR8OZTgQO52Hnm268+T1e6NvlFM+sSbEZ6LhIONusXfh313meg VyrQ== X-Gm-Message-State: AOAM530nqG+5bvctL5tBAWhP2cxZZnFqloA18nAk1/KmjauKevisSlQW J0BTKN1yLc3NPfO3ln/Lbr5iHsew/466pes0SEsWJw== X-Google-Smtp-Source: ABdhPJyPpoCp87aEuVQW5m5FI3Cui8FxZacZGxGIMAD4zSwLzIbB62U+qZsOhXQBE5CTcJBuq51KlID1ViB9HjqKgBo= X-Received: by 2002:a67:8c46:: with SMTP id o67mr35531294vsd.34.1625839412692; Fri, 09 Jul 2021 07:03:32 -0700 (PDT) MIME-Version: 1.0 References: <20210709125611.135920-1-ulf.hansson@linaro.org> In-Reply-To: From: Ulf Hansson Date: Fri, 9 Jul 2021 16:02:55 +0200 Message-ID: Subject: Re: [PATCH] PM: domains: Don't attach a device to genpd that corresponds to a provider To: Geert Uytterhoeven Cc: "Rafael J . Wysocki" , Linux PM list , Bjorn Andersson , Stephen Boyd , Saravana Kannan , Dmitry Baryshkov , Kevin Hilman , Geert Uytterhoeven , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 9 Jul 2021 at 15:58, Geert Uytterhoeven wrote: > > Hi Ulf, > > On Fri, Jul 9, 2021 at 3:48 PM Ulf Hansson wrote: > > On Fri, 9 Jul 2021 at 15:35, Geert Uytterhoeven wrote: > > > On Fri, Jul 9, 2021 at 3:23 PM Ulf Hansson wrote: > > > > On Fri, 9 Jul 2021 at 15:07, Geert Uytterhoeven wrote: > > > > > On Fri, Jul 9, 2021 at 2:56 PM Ulf Hansson wrote: > > > > > > According to the common power domain DT bindings, a power domain provider > > > > > > must have a "#power-domain-cells" property in its OF node. Additionally, if > > > > > > a provider has a "power-domains" property, it means that it has a parent > > > > > > domain. > > > > > > > > > > OK. > > > > > > > > > > > It has turned out that some OF nodes that represents a genpd provider may > > > > > > also be compatible with a regular platform device. This leads to, during > > > > > > probe, genpd_dev_pm_attach(), genpd_dev_pm_attach_by_name() and > > > > > > genpd_dev_pm_attach_by_id() tries to attach the corresponding struct device > > > > > > to the genpd provider's parent domain, which is wrong. Instead the genpd > > > > > > > > > > Why is that wrong? > > > > > > > > It may lead to that the struct device that corresponds to a genpd > > > > provider may be attached to the parent domain. In other words, the > > > > parent domain will not only be controlled by a child domain > > > > (corresponding to the provider), but also through the provider's > > > > struct device. As far as I can tell, this has never been the intent > > > > for how things should work in genpd. > > > > > > Ah, you're worried about the case where the subdomain is a child of > > > the parent domain, but the actual subdomain controller (represented > > > by the platform device) isn't? > > > > Well, even if the platform device represents a subdomain controller, > > should it really be attached to the parent domain? > > That's what the presence of the "power-domains" property means, > isn't it? > If the subdomain controller itself is not part of the parent power > domain, there should not be a "power-domains" property. So perhaps > we need a new property ("power-domain-parent"?) to indicate what is > the parent domain for the subdomains in this case? Hmm, but perhaps it's just a matter of expectations of what will happen during attach. On the other hand a new binding for the parent would make it more clear. I wouldn't mind. > > > In any case, it means that the provider needs to manage runtime PM, > > etc for its struct device to not prevent the parent domain from being > > powered off. > > Shouldn't all drivers for devices that can be somewhere in a PM Domain > hierarchy do that anyway? :-) See e.g. commit 3a611e26e958b037 > ("net/smsc911x: Add minimal runtime PM support"). > > If "simple-bus" would do that, we could get rid of "simple-pm-bus"... Right, I totally forgot about that. Thanks for reminding me. As I said in the other thread, let's drop this patch for now. Kind regards Uffe