Files
openwrt-master/target/linux/bcm27xx/patches-6.6/950-1286-clk-clk-rp1-Don-t-crash-on-duplicate-clocks.patch
domenico c06fb25d1f
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Initial commit
2025-06-24 14:35:53 +02:00

31 lines
1.1 KiB
Diff

From d290bef1f99e24cd590c64db149d007c6a631b65 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Mon, 16 Sep 2024 11:48:08 +0100
Subject: [PATCH 1286/1350] clk: clk-rp1: Don't crash on duplicate clocks
When using DTBs that don't match the kernel version, it's possible for
clock registration to fail. Handle that failure, in the hope that the
system can continue to boot, with a suitable error message.
Link: https://github.com/raspberrypi/linux/issues/6321
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
drivers/clk/clk-rp1.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/clk/clk-rp1.c
+++ b/drivers/clk/clk-rp1.c
@@ -2454,6 +2454,11 @@ static int rp1_clk_probe(struct platform
desc = &clk_desc_array[i];
if (desc->clk_register && desc->data) {
hws[i] = desc->clk_register(clockman, desc->data);
+ if (IS_ERR_OR_NULL(hws[i])) {
+ pr_err("Failed to register RP1 clock '%s' (%ld) - wrong dtbs?\n", *(char **)desc->data, PTR_ERR(hws[i]));
+ hws[i] = NULL;
+ continue;
+ }
if (!strcmp(clk_hw_get_name(hws[i]), "clk_i2s")) {
clk_i2s = hws[i];
clk_xosc = clk_hw_get_parent_by_index(clk_i2s, 0);