mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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
This commit is contained in:
parent
ad2c142415
commit
2b541904af
1 changed files with 8 additions and 0 deletions
|
|
@ -916,6 +916,14 @@ clknode_set_freq(struct clknode *clknode, uint64_t freq, int flags,
|
|||
/* 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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue