1. 09 Jun, 2023 40 commits
    • Maxime Ripard's avatar
      clk: tegra: super: Switch to determine_rate · 493ffb04
      Maxime Ripard authored
      The Tegra super clocks implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      
      Cc: Jonathan Hunter <jonathanh@nvidia.com>
      Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
      Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: linux-tegra@vger.kernel.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-65-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      493ffb04
    • Maxime Ripard's avatar
      clk: tegra: periph: Switch to determine_rate · 4d78bd80
      Maxime Ripard authored
      The Tegra periph clocks implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      
      Cc: Jonathan Hunter <jonathanh@nvidia.com>
      Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
      Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: linux-tegra@vger.kernel.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-64-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      4d78bd80
    • Maxime Ripard's avatar
      clk: stm32: composite: Switch to determine_rate · 06ed0fc0
      Maxime Ripard authored
      The STM32 composite clocks implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      
      Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-stm32@st-md-mailman.stormreply.com
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-63-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      06ed0fc0
    • Maxime Ripard's avatar
      clk: st: flexgen: Switch to determine_rate · 36f8a30c
      Maxime Ripard authored
      The ST Flexgen clocks implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-62-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      36f8a30c
    • Maxime Ripard's avatar
      clk: sprd: composite: Switch to determine_rate · 302d2f83
      Maxime Ripard authored
      The Spreadtrum composite clocks implements a mux with a set_parent
      hook, but doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      
      Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
      Cc: Chunyan Zhang <zhang.lyra@gmail.com>
      Cc: Orson Zhai <orsonzhai@gmail.com>
      Acked-by: default avatarChunyan Zhang <zhang.lyra@gmail.com>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-61-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      302d2f83
    • Maxime Ripard's avatar
      clk: ingenic: tcu: Switch to determine_rate · 65c1f037
      Maxime Ripard authored
      The Ingenic TCU clocks implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      
      Cc: Paul Cercueil <paul@crapouillou.net>
      Cc: linux-mips@vger.kernel.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-60-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      65c1f037
    • Maxime Ripard's avatar
      clk: ingenic: cgu: Switch to determine_rate · fa0dadde
      Maxime Ripard authored
      The Ingenic CGU clocks implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      
      Cc: Paul Cercueil <paul@crapouillou.net>
      Cc: linux-mips@vger.kernel.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-59-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      fa0dadde
    • Maxime Ripard's avatar
      clk: imx: scu: Switch to determine_rate · 15d3f365
      Maxime Ripard authored
      The iMX SCU clocks implements a mux with a set_parent hook, but doesn't
      provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. The round_rate()
      implementation being shared with other clocks, it's not removed.
      
      And if it was an oversight, the clock behaviour can be adjusted later
      on.
      
      Cc: Abel Vesa <abelvesa@kernel.org>
      Cc: Fabio Estevam <festevam@gmail.com>
      Cc: Peng Fan <peng.fan@nxp.com>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: NXP Linux Team <linux-imx@nxp.com>
      Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-58-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      15d3f365
    • Maxime Ripard's avatar
      clk: da8xx: clk48: Switch to determine_rate · 785e4a29
      Maxime Ripard authored
      The TI DA8xx USB0 clk48 clocks implements a mux with a set_parent
      hook, but doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      
      Cc: David Lechner <david@lechnology.com>
      Cc: Sekhar Nori <nsekhar@ti.com>
      Acked-by: default avatarDavid Lechner <david@lechnology.com>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-57-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      785e4a29
    • Maxime Ripard's avatar
      clk: si5351: clkout: Switch to determine_rate · c8bfcfcb
      Maxime Ripard authored
      The SI5351 clkout clocks implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-56-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      c8bfcfcb
    • Maxime Ripard's avatar
      clk: si5351: msynth: Switch to determine_rate · 4ab2bf81
      Maxime Ripard authored
      The SI5351 msynth clocks implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-55-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      4ab2bf81
    • Maxime Ripard's avatar
      clk: si5351: pll: Switch to determine_rate · 08add3c1
      Maxime Ripard authored
      The SI5351 PLL clocks implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-54-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      08add3c1
    • Maxime Ripard's avatar
      clk: si5341: Switch to determine_rate · 61c34af5
      Maxime Ripard authored
      The SI5341 output clocks implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-53-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      61c34af5
    • Maxime Ripard's avatar
      clk: cdce706: clkout: Switch to determine_rate · 924418cb
      Maxime Ripard authored
      The cdce706 clkout clocks implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-52-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      924418cb
    • Maxime Ripard's avatar
      clk: cdce706: divider: Switch to determine_rate · 81fdf73a
      Maxime Ripard authored
      The cdce706 divider clocks implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-51-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      81fdf73a
    • Maxime Ripard's avatar
      clk: axi-clkgen: Switch to determine_rate · 6222b494
      Maxime Ripard authored
      The AXI clkgen clocks implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-50-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      6222b494
    • Maxime Ripard's avatar
      clk: at91: smd: Switch to determine_rate · 6a25bd4d
      Maxime Ripard authored
      The Atmel SAM9x5 SMD clocks implements a mux with a set_parent
      hook, but doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Cc: Claudiu Beznea <claudiu.beznea@microchip.com>
      Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-49-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      6a25bd4d
    • Maxime Ripard's avatar
      clk: actions: composite: fact: Switch to determine_rate · 939b61f6
      Maxime Ripard authored
      The Actions composite factor clocks implements a mux with a set_parent
      hook, but doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      
      Cc: "Andreas Färber" <afaerber@suse.de>
      Cc: Manivannan Sadhasivam <mani@kernel.org>
      Cc: linux-actions@lists.infradead.org
      Cc: linux-arm-kernel@lists.infradead.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-48-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      939b61f6
    • Maxime Ripard's avatar
      clk: actions: composite: div: Switch to determine_rate · 44077406
      Maxime Ripard authored
      The Actions composite divider clocks implements a mux with a set_parent
      hook, but doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The driver does implement round_rate() though, which means that we can
      change the rate of the clock, but we will never get to change the
      parent.
      
      However, It's hard to tell whether it's been done on purpose or not.
      
      Since we'll start mandating a determine_rate() implementation, let's
      convert the round_rate() implementation to a determine_rate(), which
      will also make the current behavior explicit. And if it was an
      oversight, the clock behaviour can be adjusted later on.
      
      Cc: "Andreas Färber" <afaerber@suse.de>
      Cc: Manivannan Sadhasivam <mani@kernel.org>
      Cc: linux-actions@lists.infradead.org
      Cc: linux-arm-kernel@lists.infradead.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-47-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      44077406
    • Maxime Ripard's avatar
      ASoC: tlv320aic32x4: Add a determine_rate hook · 218b95ba
      Maxime Ripard authored
      The tlv320aic32x4 clkin clock implements a mux with a set_parent hook,
      but doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      Similarly, it doesn't look like the device tree using that clock driver
      uses any of the assigned-clock properties on that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The latter case would be equivalent to setting the determine_rate
      implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
      determine_rate implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      And if it was an oversight, then we are at least explicit about our
      behavior now and it can be further refined down the line.
      
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: alsa-devel@alsa-project.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-46-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      218b95ba
    • Maxime Ripard's avatar
      rtc: sun6i: Add a determine_rate hook · bd0a601f
      Maxime Ripard authored
      The Allwinner sun6i RTC clock implements a mux with a set_parent hook,
      but doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      Similarly, it doesn't look like the device tree using that clock driver
      uses any of the assigned-clock properties on that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The latter case would be equivalent to setting the determine_rate
      implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
      determine_rate implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      And if it was an oversight, then we are at least explicit about our
      behavior now and it can be further refined down the line.
      
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Cc: Chen-Yu Tsai <wens@csie.org>
      Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
      Cc: Samuel Holland <samuel@sholland.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-rtc@vger.kernel.org
      Cc: linux-sunxi@lists.linux.dev
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-45-971d5077e7d2@cerno.techAcked-by: default avatarJernej Skrabec <jernej.skrabec@gmail.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      bd0a601f
    • Maxime Ripard's avatar
      phy: ti: j721e-wiz: Add a determine_rate hook · 2230aa25
      Maxime Ripard authored
      The TI J721e Wiz clock implements a mux with a set_parent
      hook, but doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The latter case would be equivalent to setting the flag
      CLK_SET_RATE_NO_REPARENT, together with setting our determine_rate hook
      to __clk_mux_determine_rate(). Indeed, if no determine_rate
      implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      And if it was an oversight, then we are at least explicit about our
      behavior now and it can be further refined down the line.
      
      Since the CLK_SET_RATE_NO_REPARENT flag was already set though, it seems
      unlikely.
      
      Cc: Kishon Vijay Abraham I <kishon@kernel.org>
      Cc: Vinod Koul <vkoul@kernel.org>
      Cc: linux-phy@lists.infradead.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-44-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      2230aa25
    • Maxime Ripard's avatar
      phy: ti: am654-serdes: Add a determine_rate hook · 36c1dfea
      Maxime Ripard authored
      The TI AM654 SerDes clock implements a mux with a set_parent
      hook, but doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The latter case would be equivalent to setting the flag
      CLK_SET_RATE_NO_REPARENT, together with setting our determine_rate hook
      to __clk_mux_determine_rate(). Indeed, if no determine_rate
      implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      And if it was an oversight, then we are at least explicit about our
      behavior now and it can be further refined down the line.
      
      Since the CLK_SET_RATE_NO_REPARENT flag was already set though, it seems
      unlikely.
      
      Cc: Kishon Vijay Abraham I <kishon@kernel.org>
      Cc: Vinod Koul <vkoul@kernel.org>
      Cc: linux-phy@lists.infradead.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-43-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      36c1dfea
    • Maxime Ripard's avatar
      phy: cadence: torrent: Add a determine_rate hook · 7aee650e
      Maxime Ripard authored
      The Cadence Torrent refclk clock implements a mux with a set_parent
      hook, but doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The latter case would be equivalent to setting the flag
      CLK_SET_RATE_NO_REPARENT, together with setting our determine_rate hook
      to __clk_mux_determine_rate(). Indeed, if no determine_rate
      implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      And if it was an oversight, then we are at least explicit about our
      behavior now and it can be further refined down the line.
      
      Since the CLK_SET_RATE_NO_REPARENT flag was already set though, it seems
      unlikely.
      
      Cc: Kishon Vijay Abraham I <kishon@kernel.org>
      Cc: Vinod Koul <vkoul@kernel.org>
      Cc: linux-phy@lists.infradead.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-42-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      7aee650e
    • Maxime Ripard's avatar
      phy: cadence: sierra: Add a determine_rate hook · 1ca48301
      Maxime Ripard authored
      The Cadence Sierra PLL clock implements a mux with a set_parent hook,
      but doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The latter case would be equivalent to setting the flag
      CLK_SET_RATE_NO_REPARENT, together with setting our determine_rate hook
      to __clk_mux_determine_rate(). Indeed, if no determine_rate
      implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      And if it was an oversight, then we are at least explicit about our
      behavior now and it can be further refined down the line.
      
      Since the CLK_SET_RATE_NO_REPARENT flag was already set though, it seems
      unlikely.
      
      Cc: Kishon Vijay Abraham I <kishon@kernel.org>
      Cc: Vinod Koul <vkoul@kernel.org>
      Cc: linux-phy@lists.infradead.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-41-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      1ca48301
    • Maxime Ripard's avatar
      drm/tegra: sor: Add a determine_rate hook · 3867497d
      Maxime Ripard authored
      The Tegra sor pad clock implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      Similarly, it doesn't look like the device tree using that clock driver
      uses any of the assigned-clock properties on that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The latter case would be equivalent to setting the determine_rate
      implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
      determine_rate implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      And if it was an oversight, then we are at least explicit about our
      behavior now and it can be further refined down the line.
      
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: David Airlie <airlied@gmail.com>
      Cc: Jonathan Hunter <jonathanh@nvidia.com>
      Cc: Mikko Perttunen <mperttunen@nvidia.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: linux-tegra@vger.kernel.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-40-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      3867497d
    • Maxime Ripard's avatar
      clk: versatile: sp810: Add a determine_rate hook · d5a5a6e4
      Maxime Ripard authored
      The Versatile sp810 "timerclken" clock implements a mux with a
      set_parent hook, but doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      This mismatch is probably due to the fact that the driver introduction
      predates the determine_rate introduction, and it was never revised since
      then.
      
      The default, implicit, behaviour that has been in use so far has thus
      been to simply keep using the current parent in all cases. This is also
      the behaviour of the new clk_hw_determine_rate_no_reparent() helper, so
      we can simply use it to make our expectation explicit.
      
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-39-971d5077e7d2@cerno.techAcked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Acked-by: default avatarPawel Moll <pawel.moll@arm.com>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      d5a5a6e4
    • Maxime Ripard's avatar
      clk: ux500: sysctrl: Add a determine_rate hook · b7f0dee2
      Maxime Ripard authored
      The UX500 sysctrl "set_parent" clocks implement a mux with a set_parent
      hook, but doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      Similarly, it doesn't look like the device tree using that clock driver
      uses any of the assigned-clock properties on that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The latter case would be equivalent to setting the determine_rate
      implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
      determine_rate implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      And if it was an oversight, then we are at least explicit about our
      behavior now and it can be further refined down the line.
      
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-38-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      b7f0dee2
    • Maxime Ripard's avatar
      clk: ux500: prcmu: Add a determine_rate hook · 97eb8f8a
      Maxime Ripard authored
      The UX500 PRCMU "clkout" clock implements a mux with a set_parent hook,
      but doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      The PRCMU binding also allows to specify the default clock parent
      through a device tree cell. This will be enforced at prepare time by the
      driver.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      The result is that the driver relies on prepare to set the default
      parent, and thus the set_parent hook is effectively unused by design.
      
      We can make that decision explicit by setting the determine_rate
      implementation to clk_hw_determine_rate_no_reparent() that will keep the
      same behaviour. Indeed, if no determine_rate implementation is provided,
      clk_round_rate() (through clk_core_round_rate_nolock()) will call itself
      on the parent if CLK_SET_RATE_PARENT is set, and will not change the
      clock rate otherwise.
      
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-37-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      97eb8f8a
    • Maxime Ripard's avatar
      clk: tegra: periph: Add a determine_rate hook · b11fcfa8
      Maxime Ripard authored
      The Tegra periph nodiv clock implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      However, the upstream device trees seem to use assigned-clock-parents on
      that clock to force the parent at boot time, so it's likely that the
      author intent was to force the parent through the device tree and
      prevent any reparenting but through an explicit call to
      clk_set_parent().
      
      This case would be equivalent to setting the determine_rate
      implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
      determine_rate implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      Cc: Jonathan Hunter <jonathanh@nvidia.com>
      Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
      Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: linux-tegra@vger.kernel.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-36-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      b11fcfa8
    • Maxime Ripard's avatar
      clk: tegra: super: Add a determine_rate hook · 78b435c8
      Maxime Ripard authored
      The Tegra super mux clock implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      However, the upstream device trees seem to use assigned-clock-parents on
      that clock to force the parent at boot time, so it's likely that the
      author intent was to force the parent through the device tree and
      prevent any reparenting but through an explicit call to
      clk_set_parent().
      
      This case would be equivalent to setting the determine_rate
      implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
      determine_rate implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      Cc: Jonathan Hunter <jonathanh@nvidia.com>
      Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
      Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: linux-tegra@vger.kernel.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-35-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      78b435c8
    • Maxime Ripard's avatar
      clk: tegra: bpmp: Add a determine_rate hook · 4552a852
      Maxime Ripard authored
      The Tegra BPMP mux clock implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      However, the upstream device trees seem to use assigned-clock-parents on
      that clock to force the parent at boot time, so it's likely that the
      author intent was to force the parent through the device tree and
      prevent any reparenting but through an explicit call to
      clk_set_parent().
      
      This case would be equivalent to setting the determine_rate
      implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
      determine_rate implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      Cc: Jonathan Hunter <jonathanh@nvidia.com>
      Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
      Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: linux-tegra@vger.kernel.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-34-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      4552a852
    • Maxime Ripard's avatar
      clk: stm32: core: Add a determine_rate hook · d052f067
      Maxime Ripard authored
      The STM32 mux clock implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidate to
      trigger that parent change is a call to clk_set_rate(), with
      determine_rate() figuring out which parent is the best suited for a
      given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The latter case would be equivalent to setting the flag
      CLK_SET_RATE_NO_REPARENT, together with setting our determine_rate hook
      to __clk_mux_determine_rate(). Indeed, if no determine_rate
      implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      And if it was an oversight, then we are at least explicit about our
      behavior now and it can be further refined down the line.
      
      Since the CLK_SET_RATE_NO_REPARENT flag was already set though, it seems
      unlikely.
      
      Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-stm32@st-md-mailman.stormreply.com
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-33-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      d052f067
    • Maxime Ripard's avatar
      clk: socfpga: gate: Add a determine_rate hook · 9607beb9
      Maxime Ripard authored
      The SoCFGPA gate clock implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      Similarly, it doesn't look like the device tree using that clock driver
      uses any of the assigned-clock properties on that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The latter case would be equivalent to setting the determine_rate
      implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
      determine_rate implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      And if it was an oversight, then we are at least explicit about our
      behavior now and it can be further refined down the line.
      
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-32-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      9607beb9
    • Maxime Ripard's avatar
      clk: renesas: r9a06g032: Add a determine_rate hook · 03b56aa9
      Maxime Ripard authored
      The Renesas r9a06g032 bitselect clock implements a mux with a set_parent
      hook, but doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      Similarly, it doesn't look like the device tree using that clock driver
      uses any of the assigned-clock properties on that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The latter case would be equivalent to setting the determine_rate
      implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
      determine_rate implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      And if it was an oversight, then we are at least explicit about our
      behavior now and it can be further refined down the line.
      
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: linux-renesas-soc@vger.kernel.org
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Reviewed-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-31-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      03b56aa9
    • Maxime Ripard's avatar
      clk: pxa: Add a determine_rate hook · e9b6ea4e
      Maxime Ripard authored
      The PXA "CKEN" clock implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      Similarly, it doesn't look like the device tree using that clock driver
      uses any of the assigned-clock properties on that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The latter case would be equivalent to setting the determine_rate
      implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
      determine_rate implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      And if it was an oversight, then we are at least explicit about our
      behavior now and it can be further refined down the line.
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-30-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      e9b6ea4e
    • Maxime Ripard's avatar
      clk: mediatek: cpumux: Add a determine_rate hook · 90fe6ebf
      Maxime Ripard authored
      The Mediatek cpumux clock implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      Similarly, it doesn't look like the device tree using that clock driver
      uses any of the assigned-clock properties on that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The latter case would be equivalent to setting the determine_rate
      implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
      determine_rate implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      And if it was an oversight, then we are at least explicit about our
      behavior now and it can be further refined down the line.
      
      Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
      Cc: Matthias Brugger <matthias.bgg@gmail.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-mediatek@lists.infradead.org
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-29-971d5077e7d2@cerno.techReviewed-by: default avatarChen-Yu Tsai <wenst@chromium.org>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      90fe6ebf
    • Maxime Ripard's avatar
      clk: imx: scu: Add a determine_rate hook · 1c2c20db
      Maxime Ripard authored
      The iMX SCU mux clock implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      Similarly, it doesn't look like the device tree using that clock driver
      uses any of the assigned-clock properties on that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The latter case would be equivalent to setting the determine_rate
      implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
      determine_rate implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      And if it was an oversight, then we are at least explicit about our
      behavior now and it can be further refined down the line.
      
      Cc: Abel Vesa <abelvesa@kernel.org>
      Cc: Fabio Estevam <festevam@gmail.com>
      Cc: Peng Fan <peng.fan@nxp.com>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: NXP Linux Team <linux-imx@nxp.com>
      Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-28-971d5077e7d2@cerno.tech
      | Reported-by: kernel test robot <lkp@intel.com>:
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      1c2c20db
    • Maxime Ripard's avatar
      clk: imx: fixup-mux: Add a determine_rate hook · b2252ca6
      Maxime Ripard authored
      The iMX fixup mux clock implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      However, the upstream device trees seem to use assigned-clock-parents on
      that clock to force the parent at boot time, so it's likely that the
      author intent was to force the parent through the device tree and
      prevent any reparenting but through an explicit call to
      clk_set_parent().
      
      This case would be equivalent to setting the determine_rate
      implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
      determine_rate implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      Cc: Abel Vesa <abelvesa@kernel.org>
      Cc: Fabio Estevam <festevam@gmail.com>
      Cc: Peng Fan <peng.fan@nxp.com>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: NXP Linux Team <linux-imx@nxp.com>
      Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-27-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      b2252ca6
    • Maxime Ripard's avatar
      clk: imx: busy: Add a determine_rate hook · 79ef35a9
      Maxime Ripard authored
      The iMX busy clock implements a mux with a set_parent hook, but
      doesn't provide a determine_rate implementation.
      
      This is a bit odd, since set_parent() is there to, as its name implies,
      change the parent of a clock. However, the most likely candidates to
      trigger that parent change are either the assigned-clock-parents device
      tree property or a call to clk_set_rate(), with determine_rate()
      figuring out which parent is the best suited for a given rate.
      
      The other trigger would be a call to clk_set_parent(), but it's far less
      used, and it doesn't look like there's any obvious user for that clock.
      
      Similarly, it doesn't look like the device tree using that clock driver
      uses any of the assigned-clock properties on that clock.
      
      So, the set_parent hook is effectively unused, possibly because of an
      oversight. However, it could also be an explicit decision by the
      original author to avoid any reparenting but through an explicit call to
      clk_set_parent().
      
      The latter case would be equivalent to setting the determine_rate
      implementation to clk_hw_determine_rate_no_reparent(). Indeed, if no
      determine_rate implementation is provided, clk_round_rate() (through
      clk_core_round_rate_nolock()) will call itself on the parent if
      CLK_SET_RATE_PARENT is set, and will not change the clock rate
      otherwise.
      
      And if it was an oversight, then we are at least explicit about our
      behavior now and it can be further refined down the line.
      
      Cc: Abel Vesa <abelvesa@kernel.org>
      Cc: Fabio Estevam <festevam@gmail.com>
      Cc: Peng Fan <peng.fan@nxp.com>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: NXP Linux Team <linux-imx@nxp.com>
      Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-26-971d5077e7d2@cerno.techSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      79ef35a9