git: b4ef09b9eb11 - main - clk_fixed: reduce and clarify messages due to missing clk-frequency
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 25 Aug 2023 20:12:53 UTC
The branch main has been updated by karels:
URL: https://cgit.FreeBSD.org/src/commit/?id=b4ef09b9eb117d622bb274448e5cffcae0ba3488
commit b4ef09b9eb117d622bb274448e5cffcae0ba3488
Author: Mike Karels <karels@FreeBSD.org>
AuthorDate: 2023-08-25 20:11:46 +0000
Commit: Mike Karels <karels@FreeBSD.org>
CommitDate: 2023-08-25 20:11:46 +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.
MFC after: 1 week
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41594
---
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: