Author: manu
Date: Sat Jan 20 14:47:27 2018
New Revision: 328198
URL: https://svnweb.freebsd.org/changeset/base/328198

Log:
  clk: Get new parent freq after set_freq
  
  During set_freq a clknode might have reparent (using a better parent that
  have a higher frequency for example), before refreshing the cache, re-get
  the parent frequency.
  
  Reviewed by:  mmel

Modified:
  head/sys/dev/extres/clk/clk.c

Modified: head/sys/dev/extres/clk/clk.c
==============================================================================
--- head/sys/dev/extres/clk/clk.c       Sat Jan 20 14:05:55 2018        
(r328197)
+++ head/sys/dev/extres/clk/clk.c       Sat Jan 20 14:47:27 2018        
(r328198)
@@ -916,6 +916,14 @@ clknode_set_freq(struct clknode *clknode, uint64_t fre
                /* Success - invalidate frequency cache for all children. */
                if ((flags & CLK_SET_DRYRUN) == 0) {
                        clknode->freq = freq;
+                       /* Clock might have reparent during set_freq */
+                       if (clknode->parent_cnt > 0) {
+                               rv = clknode_get_freq(clknode->parent,
+                                   &parent_freq);
+                               if (rv != 0) {
+                                       return (rv);
+                               }
+                       }
                        clknode_refresh_cache(clknode, parent_freq);
                }
        } else if (clknode->parent != NULL) {
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to