linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "open list:TI ETHERNET SWITCH DRIVER (CPSW)"
	<linux-omap@vger.kernel.org>,
	"Benoît Cousson" <bcousson@baylibre.com>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>, "Dave Gerlach" <d-gerlach@ti.com>,
	"Roger Quadros" <rogerq@ti.com>, "Suman Anna" <s-anna@ti.com>,
	"Tero Kristo" <t-kristo@ti.com>,
	"Matti Vaittinen" <matti.vaittinen@fi.rohmeurope.com>
Subject: Re: [PATCH 13/18] ARM: dts: Use simple-pm-bus for genpd for am3 l4_wkup
Date: Thu, 14 Jan 2021 09:20:39 +0200	[thread overview]
Message-ID: <X//wx/oSTpXKpY75@atomide.com> (raw)
In-Reply-To: <X/8tz/2v4bnbF0TZ@atomide.com>

* Tony Lindgren <tony@atomide.com> [210113 17:30]:
> * Tony Lindgren <tony@atomide.com> [210113 16:48]:
> > * Geert Uytterhoeven <geert@linux-m68k.org> [210113 16:42]:
> > > On Wed, Jan 13, 2021 at 5:23 PM Tony Lindgren <tony@atomide.com> 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

  reply	other threads:[~2021-01-14  7:21 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 11:22 [PATCH 00/18] Drop remaining pdata for am335x and use genpd Tony Lindgren
2020-10-26 11:22 ` [PATCH 01/18] ARM: dts: am33xx: add remaining PRM instances Tony Lindgren
2020-10-26 11:22 ` [PATCH 02/18] ARM: dts: Configure also interconnect clocks for am3 system timers Tony Lindgren
2020-10-26 11:22 ` [PATCH 03/18] ARM: OMAP2+: Drop legacy platform data for am3 control module Tony Lindgren
2020-10-26 11:22 ` [PATCH 04/18] ARM: dts: Configure RTC powerdomain for am3 Tony Lindgren
2020-10-26 11:22 ` [PATCH 05/18] ARM: dts: Configure interconnect target module for am3 wkup_m3 Tony Lindgren
2020-10-26 11:22 ` [PATCH 06/18] ARM: OMAP2+: Drop legacy platform data " Tony Lindgren
2020-10-26 11:22 ` [PATCH 07/18] ARM: OMAP2+: Drop legacy platform data for am3 and am4 gpmc Tony Lindgren
2020-10-26 11:22 ` [PATCH 08/18] ARM: OMAP2+: Drop legacy platform data for am3 debugss Tony Lindgren
2020-10-26 11:22 ` [PATCH 09/18] ARM: OMAP2+: Drop legacy platform data for am3 emif Tony Lindgren
2020-10-26 11:22 ` [PATCH 10/18] ARM: OMAP2+: Drop legacy platform data for am3 ocmcram Tony Lindgren
2020-10-26 11:22 ` [PATCH 11/18] ARM: OMAP2+: Drop legacy platform data for am3 instr Tony Lindgren
2020-10-26 11:22 ` [PATCH 12/18] ARM: OMAP2+: Drop legacy platform data for am3 mpuss Tony Lindgren
2020-10-26 11:22 ` [PATCH 13/18] ARM: dts: Use simple-pm-bus for genpd for am3 l4_wkup Tony Lindgren
     [not found]   ` <CAMuHMdWribr=eg1LkKce=Hamm+JwSz5UFEXLKUmKkqqz1RpL_w@mail.gmail.com>
2021-01-13 16:23     ` Tony Lindgren
2021-01-13 16:41       ` Geert Uytterhoeven
2021-01-13 16:47         ` Tony Lindgren
2021-01-13 17:28           ` Tony Lindgren
2021-01-14  7:20             ` Tony Lindgren [this message]
2021-01-14  7:58               ` Vaittinen, Matti
2021-01-14  8:08                 ` Tony Lindgren
2021-01-14  8:32                   ` Matti Vaittinen
2021-01-14  8:52                   ` Geert Uytterhoeven
2021-01-15  8:12                     ` Tony Lindgren
2020-10-26 11:22 ` [PATCH 14/18] ARM: dts: Use simple-pm-bus for genpd for am3 l4_fast Tony Lindgren
2020-10-26 11:22 ` [PATCH 15/18] ARM: dts: Use simple-pm-bus for genpd for am3 l4_per Tony Lindgren
2020-10-26 11:22 ` [PATCH 16/18] ARM: dts: Use simple-pm-bus for genpd for am3 l3 Tony Lindgren
2020-10-26 11:22 ` [PATCH 17/18] ARM: OMAP2+: Drop legacy remaining legacy platform data for am3 Tony Lindgren
2020-10-26 11:22 ` [PATCH 18/18] ARM: OMAP2+: Build hwmod related code as needed Tony Lindgren
2020-10-26 13:10 ` [PATCH 00/18] Drop remaining pdata for am335x and use genpd Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=X//wx/oSTpXKpY75@atomide.com \
    --to=tony@atomide.com \
    --cc=bcousson@baylibre.com \
    --cc=d-gerlach@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=rogerq@ti.com \
    --cc=s-anna@ti.com \
    --cc=t-kristo@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).