Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1309502iog; Thu, 30 Jun 2022 23:21:15 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tI/jCVrRPqTGa+3DAQQ58AmXk16oiQaobq5Qq7TaOO9K/y3mGxbFU8ThQmqkgtEQ2XTH49 X-Received: by 2002:a17:907:7781:b0:6fe:4398:47b3 with SMTP id ky1-20020a170907778100b006fe439847b3mr12659289ejc.513.1656656475545; Thu, 30 Jun 2022 23:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656656475; cv=none; d=google.com; s=arc-20160816; b=HE8tQEdlQ/GZtrDAkjBBnEnUYuCU0L5/ctb9eOJTPbO+ZIBeo7Bw9X3Cfw+keBQGz3 TLBAUEhh4rc+5FXssa5BzFShcKmqfTyE/j/maKF3kEPY36BnJzNwIuyP+qPZa8rBxEYt C7xoclYI9b6/vNx4YJ6s6s/tU5+UvsKvalyq8bRNy2ci342EZS1cnizz3FDSqkZDl3jJ 3yKtBTY+iRJF24L+EaUjqkXzFNuP15b2eqMwvgscLoqsJhF2P0qNTNSXYDOPZsEXAfYh wA+EwSpEbaBOwUc0CdhfDbAcc26cBwfgdTWrDSaj94mMKE5OyNPEpsniNTn6eU5fTJ/Q O2PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=8IIYBP2aBaJefbIQuP0UrFukjgkfC0z1soBUBCYqnqI=; b=s91jwKa69EGQaPgilibAw0+jkkIdG5qBnmEeAWTnTwF0g6PuPNIjEWopYMup40gi+p MRQNDx+ItuCK0vXQL0dkKWfQmLTbHCUSalqHcvNIymH0pqHZW+sfiVSQUvn2FvDret12 47Bk5tncqAXA4TcTklpsYjxuuvImN2GNtZ9AmQEMa0CesdGtpBltEnSNE8FFi/aPH0Z9 iOkw9XNzLO6GvX5KmqE4R2wQE/+Z/W49F2p3pmzf+s5u6C+2nEKd5w8yJorsAJzZia1y TA+BxK8ZqZ1y9+u7k4lwPsqA8PfI96AKlS0zONvQhsR3rNTOiwRYb6V9y6Ef4oqwxhCL 1Wbw== 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 sh33-20020a1709076ea100b00726b8c954b6si895410ejc.846.2022.06.30.23.20.50; Thu, 30 Jun 2022 23:21:15 -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 S234121AbiGAGMl (ORCPT + 99 others); Fri, 1 Jul 2022 02:12:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233375AbiGAGMi (ORCPT ); Fri, 1 Jul 2022 02:12:38 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8B2F61A83D; Thu, 30 Jun 2022 23:12:37 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id A72FA80B0; Fri, 1 Jul 2022 06:07:18 +0000 (UTC) Date: Fri, 1 Jul 2022 09:12:35 +0300 From: Tony Lindgren To: Saravana Kannan Cc: Rob Herring , Geert Uytterhoeven , Greg Kroah-Hartman , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Len Brown , Pavel Machek , Joerg Roedel , Will Deacon , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Linus Walleij , Hideaki YOSHIFUJI , David Ahern , Android Kernel Team , "linux-kernel@vger.kernel.org" , "open list:THERMAL" , Linux IOMMU , netdev , "open list:GPIO SUBSYSTEM" , Alexander Stein Subject: Re: [PATCH v2 1/9] PM: domains: Delete usage of driver_deferred_probe_check_state() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,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 * Tony Lindgren [220701 08:33]: > * Saravana Kannan [220630 23:25]: > > On Thu, Jun 30, 2022 at 4:26 PM Rob Herring wrote: > > > > > > On Thu, Jun 30, 2022 at 5:11 PM Saravana Kannan wrote: > > > > > > > > On Mon, Jun 27, 2022 at 2:10 AM Tony Lindgren wrote: > > > > > > > > > > * Saravana Kannan [220623 08:17]: > > > > > > On Thu, Jun 23, 2022 at 12:01 AM Tony Lindgren wrote: > > > > > > > > > > > > > > * Saravana Kannan [220622 19:05]: > > > > > > > > On Tue, Jun 21, 2022 at 9:59 PM Tony Lindgren wrote: > > > > > > > > > This issue is no directly related fw_devlink. It is a side effect of > > > > > > > > > removing driver_deferred_probe_check_state(). We no longer return > > > > > > > > > -EPROBE_DEFER at the end of driver_deferred_probe_check_state(). > > > > > > > > > > > > > > > > Yes, I understand the issue. But driver_deferred_probe_check_state() > > > > > > > > was deleted because fw_devlink=on should have short circuited the > > > > > > > > probe attempt with an -EPROBE_DEFER before reaching the bus/driver > > > > > > > > probe function and hitting this -ENOENT failure. That's why I was > > > > > > > > asking the other questions. > > > > > > > > > > > > > > OK. So where is the -EPROBE_DEFER supposed to happen without > > > > > > > driver_deferred_probe_check_state() then? > > > > > > > > > > > > device_links_check_suppliers() call inside really_probe() would short > > > > > > circuit and return an -EPROBE_DEFER if the device links are created as > > > > > > expected. > > > > > > > > > > OK > > > > > > > > > > > > Hmm so I'm not seeing any supplier for the top level ocp device in > > > > > > > the booting case without your patches. I see the suppliers for the > > > > > > > ocp child device instances only. > > > > > > > > > > > > Hmmm... this is strange (that the device link isn't there), but this > > > > > > is what I suspected. > > > > > > > > > > Yup, maybe it's because of the supplier being a device in the child > > > > > interconnect for the ocp. > > > > > > > > Ugh... yeah, this is why the normal (not SYNC_STATE_ONLY) device link > > > > isn't being created. > > > > > > > > So the aggregated view is something like (I had to set tabs = 4 space > > > > to fit it within 80 cols): > > > > > > > > ocp: ocp { <========================= Consumer > > > > compatible = "simple-pm-bus"; > > > > power-domains = <&prm_per>; <=========== Supplier ref > > > > > > > > l4_wkup: interconnect@44c00000 { > > > > compatible = "ti,am33xx-l4-wkup", "simple-pm-bus"; > > > > > > > > segment@200000 { /* 0x44e00000 */ > > > > compatible = "simple-pm-bus"; > > > > > > > > target-module@0 { /* 0x44e00000, ap 8 58.0 */ > > > > compatible = "ti,sysc-omap4", "ti,sysc"; > > > > > > > > prcm: prcm@0 { > > > > compatible = "ti,am3-prcm", "simple-bus"; > > > > > > > > prm_per: prm@c00 { <========= Actual Supplier > > > > compatible = "ti,am3-prm-inst", "ti,omap-prm-inst"; > > > > }; > > > > }; > > > > }; > > > > }; > > > > }; > > > > }; > > > > > > > > The power-domain supplier is the great-great-great-grand-child of the > > > > consumer. It's not clear to me how this is valid. What does it even > > > > mean? > > > > > > > > Rob, is this considered a valid DT? > > > > > > Valid DT for broken h/w. > > > > I'm not sure even in that case it's valid. When the parent device is > > in reset (when the SoC is coming out of reset), there's no way the > > descendant is functional. And if the descendant is not functional, how > > is the parent device powered up? This just feels like an incorrect > > representation of the real h/w. > > It should be correct representation based on scanning the interconnects > and looking at the documentation. Some interconnect parts are wired > always-on and some interconnect instances may be dual-mapped. > > We have a quirk to probe prm/prcm first with pdata_quirks_init_clocks(). > Maybe that also now fails in addition to the top level interconnect > probing no longer producing -EPROBE_DEFER. > > > > So the domain must be default on and then simple-pm-bus is going to > > > hold a reference to the domain preventing it from ever getting powered > > > off and things seem to work. Except what happens during suspend? > > > > But how can simple-pm-bus even get a reference? The PM domain can't > > get added until we are well into the probe of the simple-pm-bus and > > AFAICT the genpd attach is done before the driver probe is even > > called. > > The prm/prcm gets of_platform_populate() called on it early. The hackish patch below makes things boot for me, not convinced this is the preferred fix compared to earlier deferred probe handling though. Going back to the init level tinkering seems like a step back to me. Regards, Tony 8< ---------------- diff --git a/drivers/soc/ti/omap_prm.c b/drivers/soc/ti/omap_prm.c --- a/drivers/soc/ti/omap_prm.c +++ b/drivers/soc/ti/omap_prm.c @@ -991,4 +991,9 @@ static struct platform_driver omap_prm_driver = { .of_match_table = omap_prm_id_table, }, }; -builtin_platform_driver(omap_prm_driver); + +static int __init omap_prm_init(void) +{ + return platform_driver_register(&omap_prm_driver); +} +subsys_initcall(omap_prm_init); -- 2.36.1