mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 06:57:57 +00:00
52 lines
1.7 KiB
Diff
52 lines
1.7 KiB
Diff
|
From 4a8f7f7661252072494ac16d3edc035193c6ea04 Mon Sep 17 00:00:00 2001
|
||
|
From: Phil Elwell <phil@raspberrypi.com>
|
||
|
Date: Mon, 11 Dec 2023 11:20:28 +0000
|
||
|
Subject: [PATCH 0789/1085] bcm2835-sdhost: Fail gracefully with bad dtb
|
||
|
|
||
|
The logging timestamps depend on the existence of a bcm2835-system-timer
|
||
|
node. If this node doesn't exist, leave the logging disabled rather than
|
||
|
crashing.
|
||
|
|
||
|
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||
|
---
|
||
|
drivers/mmc/host/bcm2835-sdhost.c | 27 +++++++++++++++------------
|
||
|
1 file changed, 15 insertions(+), 12 deletions(-)
|
||
|
|
||
|
--- a/drivers/mmc/host/bcm2835-sdhost.c
|
||
|
+++ b/drivers/mmc/host/bcm2835-sdhost.c
|
||
|
@@ -247,19 +247,22 @@ static void log_init(struct device *dev)
|
||
|
struct device_node *np;
|
||
|
|
||
|
spin_lock_init(&log_lock);
|
||
|
- sdhost_log_buf = dma_alloc_coherent(dev, LOG_SIZE, &sdhost_log_addr,
|
||
|
- GFP_KERNEL);
|
||
|
- if (sdhost_log_buf) {
|
||
|
- np = of_find_compatible_node(NULL, NULL,
|
||
|
- "brcm,bcm2835-system-timer");
|
||
|
- pr_info("sdhost: log_buf @ %p (%llx)\n",
|
||
|
- sdhost_log_buf, (u64)sdhost_log_addr);
|
||
|
- timer_base = of_iomap(np, 0);
|
||
|
- if (!timer_base)
|
||
|
- pr_err("sdhost: failed to remap timer\n");
|
||
|
+
|
||
|
+ np = of_find_compatible_node(NULL, NULL,
|
||
|
+ "brcm,bcm2835-system-timer");
|
||
|
+ timer_base = of_iomap(np, 0);
|
||
|
+
|
||
|
+ if (timer_base) {
|
||
|
+ sdhost_log_buf = dma_alloc_coherent(dev, LOG_SIZE, &sdhost_log_addr,
|
||
|
+ GFP_KERNEL);
|
||
|
+ if (sdhost_log_buf)
|
||
|
+ pr_info("sdhost: log_buf @ %p (%llx)\n",
|
||
|
+ sdhost_log_buf, (u64)sdhost_log_addr);
|
||
|
+ else
|
||
|
+ pr_err("sdhost: failed to allocate log buf\n");
|
||
|
+ } else {
|
||
|
+ pr_err("sdhost: failed to remap timer - wrong dtb?\n");
|
||
|
}
|
||
|
- else
|
||
|
- pr_err("sdhost: failed to allocate log buf\n");
|
||
|
}
|
||
|
|
||
|
static void log_event_impl(const char *event, u32 param1, u32 param2)
|