Commit 096f2a0
clk: Update req_rate on __clk_recalc_rates()
Commit cb1b1dd ("clk: Set req_rate on reparenting") introduced a
new function, clk_core_update_orphan_child_rates(), that updates the
req_rate field on reparenting.
It turns out that that function will interfere with the clock notifying
done by __clk_recalc_rates(). This ends up reporting the new rate in
both the old_rate and new_rate fields of struct clk_notifier_data.
Since clk_core_update_orphan_child_rates() is basically
__clk_recalc_rates() without the notifiers, and with the req_rate field
update, we can drop clk_core_update_orphan_child_rates() entirely, and
make __clk_recalc_rates() update req_rate.
However, __clk_recalc_rates() is being called in several code paths:
when retrieving a rate (most likely through clk_get_rate()), when changing
parents (through clk_set_rate() or clk_hw_reparent()), or when updating
the orphan status (through clk_core_reparent_orphans_nolock(), called at
registration).
Updating req_rate on reparenting or initialisation makes sense, but we
shouldn't do it on clk_get_rate(). Thus an extra flag has been added to
update or not req_rate depending on the context.
Fixes: cb1b1dd ("clk: Set req_rate on reparenting")
Link: https://lore.kernel.org/linux-clk/[email protected]/
Link: https://lore.kernel.org/linux-clk/[email protected]/
Reported-by: Marek Szyprowski <[email protected]>
Reported-by: Mark Brown <[email protected]>
Suggested-by: Stephen Boyd <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Tested-by: Marek Szyprowski <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>1 parent 433fb8a commit 096f2a0
1 file changed
+11
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1760 | 1760 | | |
1761 | 1761 | | |
1762 | 1762 | | |
| 1763 | + | |
1763 | 1764 | | |
1764 | 1765 | | |
1765 | 1766 | | |
| |||
1769 | 1770 | | |
1770 | 1771 | | |
1771 | 1772 | | |
1772 | | - | |
| 1773 | + | |
| 1774 | + | |
1773 | 1775 | | |
1774 | 1776 | | |
1775 | 1777 | | |
| |||
1783 | 1785 | | |
1784 | 1786 | | |
1785 | 1787 | | |
| 1788 | + | |
| 1789 | + | |
1786 | 1790 | | |
1787 | 1791 | | |
1788 | 1792 | | |
| |||
1792 | 1796 | | |
1793 | 1797 | | |
1794 | 1798 | | |
1795 | | - | |
| 1799 | + | |
1796 | 1800 | | |
1797 | 1801 | | |
1798 | 1802 | | |
1799 | 1803 | | |
1800 | 1804 | | |
1801 | | - | |
| 1805 | + | |
1802 | 1806 | | |
1803 | 1807 | | |
1804 | 1808 | | |
| |||
1901 | 1905 | | |
1902 | 1906 | | |
1903 | 1907 | | |
1904 | | - | |
1905 | | - | |
1906 | | - | |
1907 | | - | |
1908 | | - | |
1909 | | - | |
1910 | | - | |
1911 | | - | |
1912 | | - | |
1913 | | - | |
1914 | | - | |
1915 | | - | |
1916 | | - | |
1917 | | - | |
1918 | | - | |
1919 | | - | |
1920 | | - | |
1921 | 1908 | | |
1922 | 1909 | | |
1923 | 1910 | | |
| |||
1987 | 1974 | | |
1988 | 1975 | | |
1989 | 1976 | | |
1990 | | - | |
1991 | | - | |
1992 | 1977 | | |
1993 | 1978 | | |
1994 | 1979 | | |
| |||
2034 | 2019 | | |
2035 | 2020 | | |
2036 | 2021 | | |
2037 | | - | |
2038 | 2022 | | |
2039 | 2023 | | |
2040 | 2024 | | |
| |||
2658 | 2642 | | |
2659 | 2643 | | |
2660 | 2644 | | |
2661 | | - | |
2662 | 2645 | | |
2663 | | - | |
| 2646 | + | |
2664 | 2647 | | |
2665 | 2648 | | |
2666 | 2649 | | |
| |||
2744 | 2727 | | |
2745 | 2728 | | |
2746 | 2729 | | |
2747 | | - | |
| 2730 | + | |
2748 | 2731 | | |
2749 | | - | |
| 2732 | + | |
2750 | 2733 | | |
2751 | 2734 | | |
2752 | 2735 | | |
| |||
3643 | 3626 | | |
3644 | 3627 | | |
3645 | 3628 | | |
3646 | | - | |
| 3629 | + | |
3647 | 3630 | | |
3648 | 3631 | | |
3649 | 3632 | | |
| |||
0 commit comments