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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 A9D68C433DB for ; Thu, 14 Jan 2021 07:21:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 753B8239EB for ; Thu, 14 Jan 2021 07:21:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727211AbhANHVZ (ORCPT ); Thu, 14 Jan 2021 02:21:25 -0500 Received: from muru.com ([72.249.23.125]:44758 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727174AbhANHVY (ORCPT ); Thu, 14 Jan 2021 02:21:24 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 366D7811B; Thu, 14 Jan 2021 07:20:43 +0000 (UTC) Date: Thu, 14 Jan 2021 09:20:39 +0200 From: Tony Lindgren To: Geert Uytterhoeven Cc: "open list:TI ETHERNET SWITCH DRIVER (CPSW)" , =?utf-8?Q?Beno=C3=AEt?= Cousson , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Dave Gerlach , Roger Quadros , Suman Anna , Tero Kristo , Matti Vaittinen Subject: Re: [PATCH 13/18] ARM: dts: Use simple-pm-bus for genpd for am3 l4_wkup Message-ID: References: <20201026112222.56894-1-tony@atomide.com> <20201026112222.56894-14-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org * Tony Lindgren [210113 17:30]: > * Tony Lindgren [210113 16:48]: > > * Geert Uytterhoeven [210113 16:42]: > > > On Wed, Jan 13, 2021 at 5:23 PM Tony Lindgren wrote: > > > > Strange, bbb has been working for me with NFSroot, that's with > > > > omap2plus_defconfig. Care to send your .config so I can give it a > > > > try tomorrow? > > > > > > Sent by private email. > > > > OK thanks. > > > > > Just tried omap2plus_defconfig, and it also hangs during boot. > > Hmm and I just tried and bbb still boots NFSroot for me at commit > 5a230524f879 ("ARM: dts: Use simple-pm-bus for genpd for am3 l4_wkup"). > > > Hmm OK. Will give it a try tomorrow. Not sure why your bbb would produce all the deferred probe while mine won't. However, I've noticed that we need the following patch on omap4/5 and dra7 when playing with updating them to use genpd. Maybe this also fixes your boot issue if you can give it a try? Regards, Tony 8< ------------------- diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -642,6 +642,51 @@ static int sysc_parse_and_check_child_range(struct sysc *ddata) return 0; } +/* Interconnect instances to probe before l4_per instances */ +static struct resource early_bus_ranges[] = { + /* am3/4 l4_wkup */ + { .start = 0x44c00000, .end = 0x44c00000 + 0x300000, }, + /* omap4/5 and dra7 l4_cfg */ + { .start = 0x4a000000, .end = 0x4a000000 + 0x300000, }, + /* omap4 l4_wkup */ + { .start = 0x4a300000, .end = 0x4a300000 + 0x30000, }, + /* omap5 and dra7 l4_wkup without dra7 dcan segment */ + { .start = 0x4ae00000, .end = 0x4ae00000 + 0x30000, }, +}; + +static atomic_t sysc_defer = ATOMIC_INIT(10); + +/** + * sysc_defer_non_critical - defer non_critical interconnect probing + * @ddata: device driver data + * + * We want to probe l4_cfg and l4_wkup interconnect instances before any + * l4_per instances as l4_per instances depend on resources on l4_cfg and + * l4_wkup interconnects. + */ +static int sysc_defer_non_critical(struct sysc *ddata) +{ + struct resource *res; + int i; + + if (!atomic_read(&sysc_defer)) + return 0; + + for (i = 0; i < ARRAY_SIZE(early_bus_ranges); i++) { + res = &early_bus_ranges[i]; + if (ddata->module_pa >= res->start && + ddata->module_pa <= res->end) { + atomic_set(&sysc_defer, 0); + + return 0; + } + } + + atomic_dec_if_positive(&sysc_defer); + + return -EPROBE_DEFER; +} + static struct device_node *stdout_path; static void sysc_init_stdout_path(struct sysc *ddata) @@ -870,6 +915,10 @@ static int sysc_map_and_check_registers(struct sysc *ddata) if (error) return error; + error = sysc_defer_non_critical(ddata); + if (error) + return error; + sysc_check_children(ddata); error = sysc_parse_registers(ddata); -- 2.30.0