From c0c5cf7b31ff943dc4f0d473f9b03efb1c6d6fba Mon Sep 17 00:00:00 2001 From: Michal Meloun Date: Sun, 12 Jul 2020 07:59:15 +0000 Subject: [PATCH] Reverse the processing order of assigned clocks property. Linux processes these clocks in reverse order and some DT relies on this fact. For example, the frequency setting for a given PLL is the last in the list, preceded by the frequency setting of its following divider or so... MFC after: 1 week --- sys/dev/extres/clk/clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/extres/clk/clk.c b/sys/dev/extres/clk/clk.c index acb4a2cfecb0..5715315d309b 100644 --- a/sys/dev/extres/clk/clk.c +++ b/sys/dev/extres/clk/clk.c @@ -1407,7 +1407,7 @@ clk_set_assigned(device_t dev, phandle_t node) if (ofw_bus_parse_xref_list_get_length(node, "assigned-clock-parents", "#clock-cells", &nparents) != 0) nparents = -1; - for (i = 0; i < nclocks; i++) { + for (i = nclocks - 1; i >= 0; i--) { /* First get the clock we are supposed to modify */ rv = clk_get_by_ofw_index_prop(dev, 0, "assigned-clocks", i, &clk);