mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Tony Lindgren <tony@atomide.com>, Sasha Levin <sashal@kernel.org>,
	linux-omap@vger.kernel.org
Subject: [PATCH AUTOSEL 5.4 01/34] bus: ti-sysc: Probe for l4_wkup and l4_cfg interconnect devices first
Date: Sun,  2 May 2021 10:04:01 -0400	[thread overview]
Message-ID: <20210502140434.2719553-1-sashal@kernel.org> (raw)

From: Tony Lindgren <tony@atomide.com>

[ Upstream commit 4700a00755fb5a4bb5109128297d6fd2d1272ee6 ]

We want to probe l4_wkup and l4_cfg interconnect devices first to avoid
issues with missing resources. Otherwise we attempt to probe l4_per
devices first causing pointless deferred probe and also annoyingh
renumbering of the MMC devices for example.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/bus/ti-sysc.c | 49 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index f9ff6d433dfe..d59e1ca9990b 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -602,6 +602,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)
@@ -826,6 +871,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.2


             reply	other threads:[~2021-05-02 14:06 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-02 14:04 Sasha Levin [this message]
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 02/34] staging: wimax/i2400m: fix byte-order issue Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 03/34] spi: ath79: always call chipselect function Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 04/34] spi: ath79: remove spi-master setup and cleanup assignment Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 05/34] crypto: api - check for ERR pointers in crypto_destroy_tfm() Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 06/34] crypto: qat - fix unmap invalid dma address Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 07/34] usb: gadget: uvc: add bInterval checking for HS mode Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 08/34] usb: webcam: Invalid size of Processing Unit Descriptor Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 09/34] genirq/matrix: Prevent allocation counter corruption Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 10/34] usb: gadget: f_uac2: validate input parameters Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 11/34] usb: gadget: f_uac1: " Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 12/34] usb: dwc3: gadget: Ignore EP queue requests during bus reset Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 13/34] usb: xhci: Fix port minor revision Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 14/34] PCI: PM: Do not read power state in pci_enable_device_flags() Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 15/34] x86/build: Propagate $(CLANG_FLAGS) to $(REALMODE_FLAGS) Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 16/34] tee: optee: do not check memref size on return from Secure World Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 17/34] perf/arm_pmu_platform: Fix error handling Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 18/34] usb: xhci-mtk: support quirk to disable usb2 lpm Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 19/34] xhci: check control context is valid before dereferencing it Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 20/34] xhci: fix potential array out of bounds with several interrupters Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 21/34] spi: dln2: Fix reference leak to master Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 22/34] spi: omap-100k: " Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 23/34] spi: qup: fix PM reference leak in spi_qup_remove() Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 24/34] usb: musb: fix PM reference leak in musb_irq_work() Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 25/34] usb: core: hub: Fix PM reference leak in usb_port_resume() Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 26/34] platform/x86: thinkpad_acpi: Correct thermal sensor allocation Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 27/34] tty: n_gsm: check error while registering tty devices Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 28/34] intel_th: Consistency and off-by-one fix Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 29/34] phy: phy-twl4030-usb: Fix possible use-after-free in twl4030_usb_remove() Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 30/34] crypto: stm32/hash - Fix PM reference leak on stm32-hash.c Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 31/34] crypto: stm32/cryp - Fix PM reference leak on stm32-cryp.c Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 32/34] crypto: omap-aes - Fix PM reference leak on omap-aes.c Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 33/34] platform/x86: intel_pmc_core: Don't use global pmcdev in quirks Sasha Levin
2021-05-02 14:04 ` [PATCH AUTOSEL 5.4 34/34] btrfs: convert logic BUG_ON()'s in replace_path to ASSERT()'s Sasha Levin

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=20210502140434.2719553-1-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tony@atomide.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

all inboxes | Powered by JetHome®