git: 1a0824ec9438 - stable/13 - clk_fixed: reduce and clarify messages due to missing clk-frequency
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 01 Sep 2023 18:23:15 UTC
The branch stable/13 has been updated by karels:
URL: https://cgit.FreeBSD.org/src/commit/?id=1a0824ec9438ead5e61e1fa64785efc9465fab5e
commit 1a0824ec9438ead5e61e1fa64785efc9465fab5e
Author: Mike Karels <karels@FreeBSD.org>
AuthorDate: 2023-08-25 20:11:46 +0000
Commit: Mike Karels <karels@FreeBSD.org>
CommitDate: 2023-09-01 18:22:49 +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 7c71f04eac0d..6a26effb73a2 100644
--- a/sys/dev/extres/clk/clk_fixed.c
+++ b/sys/dev/extres/clk/clk_fixed.c
@@ -153,6 +153,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: