Date: Thu, 21 Sep 2023 21:16:15 GMT From: Mike Karels <karels@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 2476a7603190 - stable/14 - clk_fixed: reduce and clarify messages due to missing clk-frequency Message-ID: <202309212116.38LLGFlp074376@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=2476a76031908016dd2513862d46ad8dd2bab462 commit 2476a76031908016dd2513862d46ad8dd2bab462 Author: Mike Karels <karels@FreeBSD.org> AuthorDate: 2023-08-25 20:11:46 +0000 Commit: Mike Karels <karels@FreeBSD.org> CommitDate: 2023-09-21 21:14:47 +0000 clk_fixed: reduce and clarify messages due to missing clk-frequency The current dts for Raspberry 3B+ and 4B have 2 disabled fixed-clock nodes which have no clock-frequency value. Such nodes are non-standard. This results in about 150 messages during autoconfiguration: clk_fixed2: <Fixed clock> disabled on ofwbus0 clk_fixed2: Cannot FDT parameters. device_attach: clk_fixed2 attach returned 6 Defensively check for clock-frequency in the probe routine, and if none, return an error with a more direct error message (1 line per occurrence, 50 lines total): clk_fixed2: clock-fixed has no clock-frequency Based on a patch by manu. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D41594 (cherry picked from commit b4ef09b9eb117d622bb274448e5cffcae0ba3488) --- sys/dev/extres/clk/clk_fixed.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/extres/clk/clk_fixed.c b/sys/dev/extres/clk/clk_fixed.c index f4f1d462233a..e5ca6b31d000 100644 --- a/sys/dev/extres/clk/clk_fixed.c +++ b/sys/dev/extres/clk/clk_fixed.c @@ -157,6 +157,11 @@ clk_fixed_probe(device_t dev) clk_type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; switch (clk_type) { case CLK_TYPE_FIXED: + if (OF_hasprop(ofw_bus_get_node(dev), "clock-frequency") == 0) { + device_printf(dev, + "clock-fixed has no clock-frequency\n"); + return (ENXIO); + } device_set_desc(dev, "Fixed clock"); return (BUS_PROBE_DEFAULT); case CLK_TYPE_FIXED_FACTOR:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202309212116.38LLGFlp074376>