[PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()

Brian Masney via B4 Relay posted 114 patches 1 month, 3 weeks ago
There is a newer version of this series
drivers/clk/actions/owl-composite.c        |   8 +-
drivers/clk/actions/owl-divider.c          |  13 +--
drivers/clk/actions/owl-factor.c           |  12 +--
drivers/clk/actions/owl-pll.c              |  25 ++++--
drivers/clk/at91/clk-audio-pll.c           |  42 +++++----
drivers/clk/at91/clk-h32mx.c               |  33 ++++---
drivers/clk/at91/clk-peripheral.c          |  48 ++++++----
drivers/clk/at91/clk-pll.c                 |  12 +--
drivers/clk/at91/clk-plldiv.c              |  34 +++++---
drivers/clk/at91/clk-sam9x60-pll.c         |  29 +++---
drivers/clk/at91/clk-usb.c                 |  20 +++--
drivers/clk/axs10x/i2s_pll_clock.c         |  14 +--
drivers/clk/axs10x/pll_clock.c             |  12 +--
drivers/clk/baikal-t1/ccu-div.c            |  27 +++---
drivers/clk/baikal-t1/ccu-pll.c            |  14 +--
drivers/clk/bcm/clk-iproc-asiu.c           |  25 +++---
drivers/clk/clk-apple-nco.c                |  14 +--
drivers/clk/clk-bm1880.c                   |  21 +++--
drivers/clk/clk-cdce706.c                  |  16 ++--
drivers/clk/clk-cdce925.c                  |  50 ++++++-----
drivers/clk/clk-cs2000-cp.c                |  14 +--
drivers/clk/clk-divider.c                  |  23 -----
drivers/clk/clk-ep93xx.c                   |  18 ++--
drivers/clk/clk-fixed-factor.c             |  16 ++--
drivers/clk/clk-fractional-divider.c       |  25 ++++--
drivers/clk/clk-gemini.c                   |  15 ++--
drivers/clk/clk-highbank.c                 |  26 +++---
drivers/clk/clk-hsdk-pll.c                 |  12 +--
drivers/clk/clk-lmk04832.c                 |  53 ++++++-----
drivers/clk/clk-loongson1.c                |  12 +--
drivers/clk/clk-max9485.c                  |  27 +++---
drivers/clk/clk-milbeaut.c                 |  22 +++--
drivers/clk/clk-multiplier.c               |  12 +--
drivers/clk/clk-rp1.c                      |  45 ++++++----
drivers/clk/clk-scmi.c                     |  30 -------
drivers/clk/clk-scpi.c                     |  18 ++--
drivers/clk/clk-si514.c                    |  24 +++--
drivers/clk/clk-si521xx.c                  |  14 +--
drivers/clk/clk-si5341.c                   |  22 +++--
drivers/clk/clk-si544.c                    |  10 +--
drivers/clk/clk-si570.c                    |  24 +++--
drivers/clk/clk-sp7021.c                   |  22 ++---
drivers/clk/clk-sparx5.c                   |  10 ++-
drivers/clk/clk-stm32f4.c                  |  26 +++---
drivers/clk/clk-tps68470.c                 |  12 +--
drivers/clk/clk-versaclock3.c              |  70 +++++++++------
drivers/clk/clk-versaclock5.c              |  71 ++++++++-------
drivers/clk/clk-versaclock7.c              |  30 ++++---
drivers/clk/clk-vt8500.c                   |  59 ++++++++-----
drivers/clk/clk-wm831x.c                   |  14 +--
drivers/clk/clk-xgene.c                    |  41 +++++----
drivers/clk/hisilicon/clk-hi3660-stub.c    |  18 ++--
drivers/clk/hisilicon/clk-hi6220-stub.c    |  12 +--
drivers/clk/hisilicon/clkdivider-hi6220.c  |  12 +--
drivers/clk/ingenic/cgu.c                  |  12 +--
drivers/clk/ingenic/jz4780-cgu.c           |  24 ++---
drivers/clk/ingenic/x1000-cgu.c            |  19 ++--
drivers/clk/mediatek/clk-pll.c             |  13 +--
drivers/clk/mediatek/clk-pll.h             |   3 +-
drivers/clk/mediatek/clk-pllfh.c           |   2 +-
drivers/clk/microchip/clk-core.c           |  44 ++++++----
drivers/clk/mmp/clk-audio.c                |  18 ++--
drivers/clk/mmp/clk-frac.c                 |  27 +++---
drivers/clk/mstar/clk-msc313-cpupll.c      |  18 ++--
drivers/clk/mvebu/ap-cpu-clk.c             |  12 +--
drivers/clk/mvebu/armada-37xx-periph.c     |  15 ++--
drivers/clk/mvebu/clk-corediv.c            |  18 ++--
drivers/clk/mvebu/clk-cpu.c                |  12 +--
drivers/clk/mvebu/dove-divider.c           |  16 ++--
drivers/clk/mxs/clk-div.c                  |   8 +-
drivers/clk/mxs/clk-frac.c                 |  16 ++--
drivers/clk/mxs/clk-ref.c                  |  16 ++--
drivers/clk/nuvoton/clk-ma35d1-divider.c   |  12 ++-
drivers/clk/nuvoton/clk-ma35d1-pll.c       |  28 +++---
drivers/clk/nxp/clk-lpc18xx-cgu.c          |  16 ++--
drivers/clk/nxp/clk-lpc32xx.c              |  59 +++++++------
drivers/clk/pistachio/clk-pll.c            |  20 +++--
drivers/clk/qcom/clk-alpha-pll.c           | 136 ++++++++++++++++-------------
drivers/clk/qcom/clk-regmap-divider.c      |  27 +++---
drivers/clk/renesas/rzg2l-cpg.c            |   9 +-
drivers/clk/renesas/rzv2h-cpg.c            |  10 ---
drivers/clk/rockchip/clk-ddr.c             |  13 +--
drivers/clk/rockchip/clk-half-divider.c    |  12 +--
drivers/clk/rockchip/clk-pll.c             |  23 +++--
drivers/clk/samsung/clk-cpu.c              |  12 +--
drivers/clk/samsung/clk-pll.c              |  33 ++++---
drivers/clk/sifive/fu540-prci.h            |   2 +-
drivers/clk/sifive/fu740-prci.h            |   2 +-
drivers/clk/sifive/sifive-prci.c           |  11 +--
drivers/clk/sifive/sifive-prci.h           |   4 +-
drivers/clk/sophgo/clk-cv18xx-ip.c         |  10 ++-
drivers/clk/sophgo/clk-sg2042-clkgen.c     |  17 ++--
drivers/clk/sophgo/clk-sg2042-pll.c        |  24 ++---
drivers/clk/spacemit/ccu_ddn.c             |  11 ++-
drivers/clk/spacemit/ccu_mix.c             |  12 +--
drivers/clk/spacemit/ccu_pll.c             |  10 ++-
drivers/clk/spear/clk-aux-synth.c          |  12 +--
drivers/clk/spear/clk-frac-synth.c         |  12 +--
drivers/clk/spear/clk-gpt-synth.c          |  12 +--
drivers/clk/spear/clk-vco-pll.c            |  23 +++--
drivers/clk/sprd/div.c                     |  13 +--
drivers/clk/sprd/pll.c                     |   8 +-
drivers/clk/st/clkgen-fsyn.c               |  33 +++----
drivers/clk/st/clkgen-pll.c                |  38 ++++----
drivers/clk/stm32/clk-stm32-core.c         |  28 +++---
drivers/clk/stm32/clk-stm32mp1.c           |  13 +--
drivers/clk/ux500/clk-prcmu.c              |  14 +--
drivers/clk/versatile/clk-icst.c           |  72 +++++++++------
drivers/clk/versatile/clk-vexpress-osc.c   |  16 ++--
drivers/clk/visconti/pll.c                 |  17 ++--
drivers/clk/x86/clk-cgu.c                  |  35 ++++----
drivers/clk/xilinx/clk-xlnx-clock-wizard.c |  55 ++++++------
drivers/clk/xilinx/xlnx_vcu.c              |  15 ++--
drivers/clk/zynq/pll.c                     |  12 +--
drivers/clk/zynqmp/divider.c               |  23 ++---
drivers/clk/zynqmp/pll.c                   |  24 ++---
116 files changed, 1477 insertions(+), 1132 deletions(-)
[PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
Posted by Brian Masney via B4 Relay 1 month, 3 weeks ago
The round_rate() clk ops is deprecated in the clk framework in favor
of the determine_rate() clk ops, so let's go ahead and convert the
various clk drivers using the Coccinelle semantic patch posted below.
I did a few minor cosmetic cleanups of the code in a few cases.

This series is broken up into several categories:

- Patch 1 to clk/at91/peripheral is a bug fix for a return value.

- Patch 2 to clk/at91/peripheral wasn't straight forward like the other
  drivers, so I'm explicitly calling this one out separately.

- Patch 3 adds a determine_rate() op and keeps the round_rate() in place
  since this is needed by drivers/clk/actions/owl-composite.c and keeps
  the tree bisectable. The deprecated round_rate() op is dropped in patch
  113.

- Patches 4-70 are for drivers where there is no clk submaintainer
  listed in the MAINTAINERS file. Patch 19 includes a minor fix so that
  Coccinelle can be ran against a particular source file.

- Patches 71-110 are for drivers where this is an entry in MAINTAINERS
  for the driver.

- Patches 111-114 are for drivers that implement both round_rate() and
  determine_rate(), so the round_rate() implementation is dropped.

Once all of my conversion patches across the various trees in the kernel
have been merged, I will post a small series that removes the
round_rate() op from the clk core and the documentation. Here's the
other patch series that are currently in flight that need to be merged
before we can remove round_rate() from the core.

- arm32 (3): https://lore.kernel.org/linux-clk/20250710-arm32-clk-round-rate-v1-0-a9146b77aca9@redhat.com/T/
- clk/tegra (6): https://lore.kernel.org/linux-clk/20250710-clk-tegra-round-rate-v1-0-e48ac3df4279@redhat.com/T/
- clk/ti (7): https://lore.kernel.org/linux-clk/20250811-b4-clk-ti-round-rate-v1-0-cc0840594a49@redhat.com/T/
- clocksource (1): https://lore.kernel.org/linux-clk/20250810-clocksource-round-rate-v1-1-486ef53e45eb@redhat.com/T/
- drm (9): https://lore.kernel.org/linux-clk/20250811-drm-clk-round-rate-v2-0-4a91ccf239cf@redhat.com/T/
- drm/msm (7): https://lore.kernel.org/linux-clk/20250810-drm-msm-phy-clk-round-rate-v2-0-0fd1f7979c83@redhat.com/T/
- i2c (1): https://lore.kernel.org/linux-clk/20250810-i2c-round-rate-v1-1-9488b57153e7@redhat.com/T/
- media (4): https://lore.kernel.org/linux-clk/20250710-media-clk-round-rate-v1-0-a9617b061741@redhat.com/T/
- mips (1): https://lore.kernel.org/linux-clk/20250810-mips-round-rate-v1-1-54e424c520dd@redhat.com/T/
- net (1): https://lore.kernel.org/linux-clk/20250810-net-round-rate-v1-1-dbb237c9fe5c@redhat.com/T/
- peci (1): https://lore.kernel.org/linux-clk/20250810-peci-round-rate-v1-1-ec96d216a455@redhat.com/T/
- phy (9): https://lore.kernel.org/linux-phy/20250810-phy-clk-round-rate-v2-0-9162470bb9f2@redhat.com/T/
- pmdomain (1): https://lore.kernel.org/linux-clk/20250810-pmdomain-round-rate-v1-1-1a90dbacdeb6@redhat.com/T/
- tty (1): https://lore.kernel.org/linux-clk/20250810-tty-round-rate-v1-1-849009f3bdfd@redhat.com/T/

Coccinelle semantic patch:

    virtual patch

    // Look up the current name of the round_rate function
    @ has_round_rate @
    identifier round_rate_name =~ ".*_round_rate";
    identifier hw_param, rate_param, parent_rate_param;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    	...
    }

    // Rename the route_rate function name to determine_rate()
    @ script:python generate_name depends on has_round_rate @
    round_rate_name << has_round_rate.round_rate_name;
    new_name;
    @@

    coccinelle.new_name = round_rate_name.replace("_round_rate", "_determine_rate")

    // Change rate to req->rate; also change occurrences of 'return XXX'.
    @ chg_rate depends on generate_name @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    identifier ERR =~ "E.*";
    expression E;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    (
    -return -ERR;
    +return -ERR;
    |
    - return rate_param;
    + return 0;
    |
    - return E;
    + req->rate = E;
    +
    + return 0;
    |
    - rate_param
    + req->rate
    )
    ...>
    }

    // Coccinelle only transforms the first occurrence of the rate parameter
    // Run a second time. FIXME: Is there a better way to do this?
    @ chg_rate2 depends on generate_name @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    - rate_param
    + req->rate
    ...>
    }

    // Change parent_rate to req->best_parent_rate
    @ chg_parent_rate depends on generate_name @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    @@

    long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
                  unsigned long *parent_rate_param)
    {
    <...
    (
    - *parent_rate_param
    + req->best_parent_rate
    |
    - parent_rate_param
    + &req->best_parent_rate
    )
    ...>
    }

    // Convert the function definition from round_rate() to determine_rate()
    @ func_definition depends on chg_rate @
    identifier has_round_rate.round_rate_name;
    identifier has_round_rate.hw_param;
    identifier has_round_rate.rate_param;
    identifier has_round_rate.parent_rate_param;
    identifier generate_name.new_name;
    @@

    - long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
    -               unsigned long *parent_rate_param)
    + int new_name(struct clk_hw *hw, struct clk_rate_request *req)
    {
        ...
    }

    // Update the ops from round_rate() to determine_rate()
    @ ops depends on func_definition @
    identifier has_round_rate.round_rate_name;
    identifier generate_name.new_name;
    @@

    {
        ...,
    -   .round_rate = round_rate_name,
    +   .determine_rate = new_name,
        ...,
    }

Note that I used coccinelle 1.2 instead of 1.3 since the newer version
adds unnecessary braces as described in this post.
https://lore.kernel.org/cocci/67642477-5f3e-4b2a-914d-579a54f48cbd@intel.com/

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
Brian Masney (114):
      clk: at91: peripheral: fix return value
      clk: at91: peripheral: convert from round_rate() to determine_rate()
      clk: fixed-factor: add determine_rate() ops
      clk: at91: audio-pll: convert from round_rate() to determine_rate()
      clk: at91: h32mx: convert from round_rate() to determine_rate()
      clk: at91: pll: convert from round_rate() to determine_rate()
      clk: at91: plldiv: convert from round_rate() to determine_rate()
      clk: at91: sam9x60-pll: convert from round_rate() to determine_rate()
      clk: at91: usb: convert from round_rate() to determine_rate()
      clk: baikal-t1: ccu-div: convert from round_rate() to determine_rate()
      clk: baikal-t1: ccu-pll: convert from round_rate() to determine_rate()
      clk: cdce925: convert from round_rate() to determine_rate()
      clk: cs2000-cp: convert from round_rate() to determine_rate()
      clk: ep93xx: convert from round_rate() to determine_rate()
      clk: fractional-divider: convert from round_rate() to determine_rate()
      clk: gemini: convert from round_rate() to determine_rate()
      clk: highbank: convert from round_rate() to determine_rate()
      clk: hisilicon: clkdivider-hi6220: convert from round_rate() to determine_rate()
      clk: hisilicon: hi3660-stub: move comma from declaration of DEFINE_CLK_STUB()
      clk: hisilicon: hi3660-stub: convert from round_rate() to determine_rate()
      clk: hisilicon: hi6220-stub: convert from round_rate() to determine_rate()
      clk: ingenic: cgu: convert from round_rate() to determine_rate()
      clk: ingenic: jz4780-cgu: convert from round_rate() to determine_rate()
      clk: ingenic: x1000-cgu: convert from round_rate() to determine_rate()
      clk: lmk04832: convert from round_rate() to determine_rate()
      clk: loongson1: convert from round_rate() to determine_rate()
      clk: max9485: convert from round_rate() to determine_rate()
      clk: milbeaut: convert from round_rate() to determine_rate()
      clk: mmp: audio: convert from round_rate() to determine_rate()
      clk: mmp: frac: convert from round_rate() to determine_rate()
      clk: multiplier: convert from round_rate() to determine_rate()
      clk: mxs: div: convert from round_rate() to determine_rate()
      clk: mxs: frac: convert from round_rate() to determine_rate()
      clk: mxs: ref: convert from round_rate() to determine_rate()
      clk: nuvoton: ma35d1-divider: convert from round_rate() to determine_rate()
      clk: nuvoton: ma35d1-pll: convert from round_rate() to determine_rate()
      clk: nxp: lpc18xx-cgu: convert from round_rate() to determine_rate()
      clk: nxp: lpc32xx: convert from round_rate() to determine_rate()
      clk: pistachio: pll: convert from round_rate() to determine_rate()
      clk: scpi: convert from round_rate() to determine_rate()
      clk: si514: convert from round_rate() to determine_rate()
      clk: si521xx: convert from round_rate() to determine_rate()
      clk: si5341: convert from round_rate() to determine_rate()
      clk: si544: convert from round_rate() to determine_rate()
      clk: si570: convert from round_rate() to determine_rate()
      clk: sifive: sifive-prci: convert from round_rate() to determine_rate()
      clk: sophgo: cv18xx-ip: convert from round_rate() to determine_rate()
      clk: sophgo: sg2042-clkgen: convert from round_rate() to determine_rate()
      clk: spacemit: ccu_ddn: convert from round_rate() to determine_rate()
      clk: spacemit: ccu_mix: convert from round_rate() to determine_rate()
      clk: spacemit: ccu_pll: convert from round_rate() to determine_rate()
      clk: sparx5: convert from round_rate() to determine_rate()
      clk: sprd: div: convert from round_rate() to determine_rate()
      clk: sprd: pll: convert from round_rate() to determine_rate()
      clk: st: clkgen-fsyn: convert from round_rate() to determine_rate()
      clk: st: clkgen-pll: convert from round_rate() to determine_rate()
      clk: stm32f4: convert from round_rate() to determine_rate()
      clk: stm32: stm32-core: convert from round_rate() to determine_rate()
      clk: stm32: stm32mp1: convert from round_rate() to determine_rate()
      clk: tps68470: convert from round_rate() to determine_rate()
      clk: versaclock3: convert from round_rate() to determine_rate()
      clk: vt8500: convert from round_rate() to determine_rate()
      clk: wm831x: convert from round_rate() to determine_rate()
      clk: x86: cgu: convert from round_rate() to determine_rate()
      clk: xgene: convert from round_rate() to determine_rate()
      clk: xilinx: xlnx-clock-wizard: convert from round_rate() to determine_rate()
      clk: xilinx: xlnx_vcu: convert from round_rate() to determine_rate()
      clk: zynqmp: divider: convert from round_rate() to determine_rate()
      clk: zynqmp: pll: convert from round_rate() to determine_rate()
      clk: zynq: pll: convert from round_rate() to determine_rate()
      clk: actions: owl-composite: convert from round_rate() to determine_rate()
      clk: actions: owl-divider: convert from round_rate() to determine_rate()
      clk: actions: owl-factor: convert from round_rate() to determine_rate()
      clk: actions: owl-pll: convert from round_rate() to determine_rate()
      clk: apple-nco: convert from round_rate() to determine_rate()
      clk: axs10x: i2s_pll_clock: convert from round_rate() to determine_rate()
      clk: axs10x: pll_clock: convert from round_rate() to determine_rate()
      clk: bcm: iproc-asiu: convert from round_rate() to determine_rate()
      clk: bm1880: convert from round_rate() to determine_rate()
      clk: cdce706: convert from round_rate() to determine_rate()
      clk: hsdk-pll: convert from round_rate() to determine_rate()
      clk: mediatek: pll: convert from round_rate() to determine_rate()
      clk: microchip: core: convert from round_rate() to determine_rate()
      clk: mstar: msc313-cpupll: convert from round_rate() to determine_rate()
      clk: mvebu: ap-cpu-clk: convert from round_rate() to determine_rate()
      clk: mvebu: armada-37xx-periph: convert from round_rate() to determine_rate()
      clk: mvebu: corediv: convert from round_rate() to determine_rate()
      clk: mvebu: cpu: convert from round_rate() to determine_rate()
      clk: mvebu: dove-divider: convert from round_rate() to determine_rate()
      clk: qcom: alpha-pll: convert from round_rate() to determine_rate()
      clk: qcom: regmap-divider: convert from round_rate() to determine_rate()
      clk: renesas: rzg2l-cpg: convert from round_rate() to determine_rate()
      clk: renesas: rzv2h-cpg: remove round_rate() in favor of determine_rate()
      clk: rockchip: ddr: convert from round_rate() to determine_rate()
      clk: rockchip: half-divider: convert from round_rate() to determine_rate()
      clk: rockchip: pll: convert from round_rate() to determine_rate()
      clk: rp1: convert from round_rate() to determine_rate()
      clk: samsung: cpu: convert from round_rate() to determine_rate()
      clk: samsung: pll: convert from round_rate() to determine_rate()
      clk: sp7021: convert from round_rate() to determine_rate()
      clk: spear: aux-synth: convert from round_rate() to determine_rate()
      clk: spear: frac-synth: convert from round_rate() to determine_rate()
      clk: spear: gpt-synth: convert from round_rate() to determine_rate()
      clk: spear: vco-pll: convert from round_rate() to determine_rate()
      clk: ux500: prcmu: convert from round_rate() to determine_rate()
      clk: versaclock5: convert from round_rate() to determine_rate()
      clk: versaclock7: convert from round_rate() to determine_rate()
      clk: versatile: icst: convert from round_rate() to determine_rate()
      clk: versatile: vexpress-osc: convert from round_rate() to determine_rate()
      clk: visconti: pll: convert from round_rate() to determine_rate()
      clk: divider: remove round_rate() in favor of determine_rate()
      clk: scmi: remove round_rate() in favor of determine_rate()
      clk: sophgo: sg2042-pll: remove round_rate() in favor of determine_rate()
      clk: fixed-factor: drop round_rate() clk ops

 drivers/clk/actions/owl-composite.c        |   8 +-
 drivers/clk/actions/owl-divider.c          |  13 +--
 drivers/clk/actions/owl-factor.c           |  12 +--
 drivers/clk/actions/owl-pll.c              |  25 ++++--
 drivers/clk/at91/clk-audio-pll.c           |  42 +++++----
 drivers/clk/at91/clk-h32mx.c               |  33 ++++---
 drivers/clk/at91/clk-peripheral.c          |  48 ++++++----
 drivers/clk/at91/clk-pll.c                 |  12 +--
 drivers/clk/at91/clk-plldiv.c              |  34 +++++---
 drivers/clk/at91/clk-sam9x60-pll.c         |  29 +++---
 drivers/clk/at91/clk-usb.c                 |  20 +++--
 drivers/clk/axs10x/i2s_pll_clock.c         |  14 +--
 drivers/clk/axs10x/pll_clock.c             |  12 +--
 drivers/clk/baikal-t1/ccu-div.c            |  27 +++---
 drivers/clk/baikal-t1/ccu-pll.c            |  14 +--
 drivers/clk/bcm/clk-iproc-asiu.c           |  25 +++---
 drivers/clk/clk-apple-nco.c                |  14 +--
 drivers/clk/clk-bm1880.c                   |  21 +++--
 drivers/clk/clk-cdce706.c                  |  16 ++--
 drivers/clk/clk-cdce925.c                  |  50 ++++++-----
 drivers/clk/clk-cs2000-cp.c                |  14 +--
 drivers/clk/clk-divider.c                  |  23 -----
 drivers/clk/clk-ep93xx.c                   |  18 ++--
 drivers/clk/clk-fixed-factor.c             |  16 ++--
 drivers/clk/clk-fractional-divider.c       |  25 ++++--
 drivers/clk/clk-gemini.c                   |  15 ++--
 drivers/clk/clk-highbank.c                 |  26 +++---
 drivers/clk/clk-hsdk-pll.c                 |  12 +--
 drivers/clk/clk-lmk04832.c                 |  53 ++++++-----
 drivers/clk/clk-loongson1.c                |  12 +--
 drivers/clk/clk-max9485.c                  |  27 +++---
 drivers/clk/clk-milbeaut.c                 |  22 +++--
 drivers/clk/clk-multiplier.c               |  12 +--
 drivers/clk/clk-rp1.c                      |  45 ++++++----
 drivers/clk/clk-scmi.c                     |  30 -------
 drivers/clk/clk-scpi.c                     |  18 ++--
 drivers/clk/clk-si514.c                    |  24 +++--
 drivers/clk/clk-si521xx.c                  |  14 +--
 drivers/clk/clk-si5341.c                   |  22 +++--
 drivers/clk/clk-si544.c                    |  10 +--
 drivers/clk/clk-si570.c                    |  24 +++--
 drivers/clk/clk-sp7021.c                   |  22 ++---
 drivers/clk/clk-sparx5.c                   |  10 ++-
 drivers/clk/clk-stm32f4.c                  |  26 +++---
 drivers/clk/clk-tps68470.c                 |  12 +--
 drivers/clk/clk-versaclock3.c              |  70 +++++++++------
 drivers/clk/clk-versaclock5.c              |  71 ++++++++-------
 drivers/clk/clk-versaclock7.c              |  30 ++++---
 drivers/clk/clk-vt8500.c                   |  59 ++++++++-----
 drivers/clk/clk-wm831x.c                   |  14 +--
 drivers/clk/clk-xgene.c                    |  41 +++++----
 drivers/clk/hisilicon/clk-hi3660-stub.c    |  18 ++--
 drivers/clk/hisilicon/clk-hi6220-stub.c    |  12 +--
 drivers/clk/hisilicon/clkdivider-hi6220.c  |  12 +--
 drivers/clk/ingenic/cgu.c                  |  12 +--
 drivers/clk/ingenic/jz4780-cgu.c           |  24 ++---
 drivers/clk/ingenic/x1000-cgu.c            |  19 ++--
 drivers/clk/mediatek/clk-pll.c             |  13 +--
 drivers/clk/mediatek/clk-pll.h             |   3 +-
 drivers/clk/mediatek/clk-pllfh.c           |   2 +-
 drivers/clk/microchip/clk-core.c           |  44 ++++++----
 drivers/clk/mmp/clk-audio.c                |  18 ++--
 drivers/clk/mmp/clk-frac.c                 |  27 +++---
 drivers/clk/mstar/clk-msc313-cpupll.c      |  18 ++--
 drivers/clk/mvebu/ap-cpu-clk.c             |  12 +--
 drivers/clk/mvebu/armada-37xx-periph.c     |  15 ++--
 drivers/clk/mvebu/clk-corediv.c            |  18 ++--
 drivers/clk/mvebu/clk-cpu.c                |  12 +--
 drivers/clk/mvebu/dove-divider.c           |  16 ++--
 drivers/clk/mxs/clk-div.c                  |   8 +-
 drivers/clk/mxs/clk-frac.c                 |  16 ++--
 drivers/clk/mxs/clk-ref.c                  |  16 ++--
 drivers/clk/nuvoton/clk-ma35d1-divider.c   |  12 ++-
 drivers/clk/nuvoton/clk-ma35d1-pll.c       |  28 +++---
 drivers/clk/nxp/clk-lpc18xx-cgu.c          |  16 ++--
 drivers/clk/nxp/clk-lpc32xx.c              |  59 +++++++------
 drivers/clk/pistachio/clk-pll.c            |  20 +++--
 drivers/clk/qcom/clk-alpha-pll.c           | 136 ++++++++++++++++-------------
 drivers/clk/qcom/clk-regmap-divider.c      |  27 +++---
 drivers/clk/renesas/rzg2l-cpg.c            |   9 +-
 drivers/clk/renesas/rzv2h-cpg.c            |  10 ---
 drivers/clk/rockchip/clk-ddr.c             |  13 +--
 drivers/clk/rockchip/clk-half-divider.c    |  12 +--
 drivers/clk/rockchip/clk-pll.c             |  23 +++--
 drivers/clk/samsung/clk-cpu.c              |  12 +--
 drivers/clk/samsung/clk-pll.c              |  33 ++++---
 drivers/clk/sifive/fu540-prci.h            |   2 +-
 drivers/clk/sifive/fu740-prci.h            |   2 +-
 drivers/clk/sifive/sifive-prci.c           |  11 +--
 drivers/clk/sifive/sifive-prci.h           |   4 +-
 drivers/clk/sophgo/clk-cv18xx-ip.c         |  10 ++-
 drivers/clk/sophgo/clk-sg2042-clkgen.c     |  17 ++--
 drivers/clk/sophgo/clk-sg2042-pll.c        |  24 ++---
 drivers/clk/spacemit/ccu_ddn.c             |  11 ++-
 drivers/clk/spacemit/ccu_mix.c             |  12 +--
 drivers/clk/spacemit/ccu_pll.c             |  10 ++-
 drivers/clk/spear/clk-aux-synth.c          |  12 +--
 drivers/clk/spear/clk-frac-synth.c         |  12 +--
 drivers/clk/spear/clk-gpt-synth.c          |  12 +--
 drivers/clk/spear/clk-vco-pll.c            |  23 +++--
 drivers/clk/sprd/div.c                     |  13 +--
 drivers/clk/sprd/pll.c                     |   8 +-
 drivers/clk/st/clkgen-fsyn.c               |  33 +++----
 drivers/clk/st/clkgen-pll.c                |  38 ++++----
 drivers/clk/stm32/clk-stm32-core.c         |  28 +++---
 drivers/clk/stm32/clk-stm32mp1.c           |  13 +--
 drivers/clk/ux500/clk-prcmu.c              |  14 +--
 drivers/clk/versatile/clk-icst.c           |  72 +++++++++------
 drivers/clk/versatile/clk-vexpress-osc.c   |  16 ++--
 drivers/clk/visconti/pll.c                 |  17 ++--
 drivers/clk/x86/clk-cgu.c                  |  35 ++++----
 drivers/clk/xilinx/clk-xlnx-clock-wizard.c |  55 ++++++------
 drivers/clk/xilinx/xlnx_vcu.c              |  15 ++--
 drivers/clk/zynq/pll.c                     |  12 +--
 drivers/clk/zynqmp/divider.c               |  23 ++---
 drivers/clk/zynqmp/pll.c                   |  24 ++---
 116 files changed, 1477 insertions(+), 1132 deletions(-)
---
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
change-id: 20250729-clk-for-stephen-round-rate-5a88ebdf8da6

Best regards,
-- 
Brian Masney <bmasney@redhat.com>
Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
Posted by Krzysztof Kozlowski 1 month, 1 week ago
On 11/08/2025 17:17, Brian Masney via B4 Relay wrote:
> The round_rate() clk ops is deprecated in the clk framework in favor
> of the determine_rate() clk ops, so let's go ahead and convert the
> various clk drivers using the Coccinelle semantic patch posted below.
> I did a few minor cosmetic cleanups of the code in a few cases.

This is going to create huge conflicts and I did not find here any
merging strategy.

What do you expect from us here?

Best regards,
Krzysztof
Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
Posted by Brian Masney 1 month, 1 week ago
Hi Krzysztof (and Stephen),

On Fri, Aug 22, 2025 at 08:31:08AM +0200, Krzysztof Kozlowski wrote:
> On 11/08/2025 17:17, Brian Masney via B4 Relay wrote:
> > The round_rate() clk ops is deprecated in the clk framework in favor
> > of the determine_rate() clk ops, so let's go ahead and convert the
> > various clk drivers using the Coccinelle semantic patch posted below.
> > I did a few minor cosmetic cleanups of the code in a few cases.
> 
> This is going to create huge conflicts and I did not find here any
> merging strategy.
> 
> What do you expect from us here?

That's a good question. You are right that there's a handful of drivers
where this will create a merge conflict with some other work that's been
posted this development cycle due to other unrelated changes. I suspect
the majority of these will still apply cleanly.

This series doesn't remove round_rate from the clk core, and I'll post
that change once everything else has been merged across the tree. I've
been trying to catch any new round_rate implementations that are posted
in review.

7 of the 114 patches in this series needs a v2 with a minor fix. I see
several paths forward to merging this. It's ultimately up to Stephen how
he wants to proceed.

- I send Stephen a PULL request with all of these patches with the minor
  cleanups to the 7 patches. Depending on the timing, Stephen can merge
  the other work first, and I deal with cleaning up the merge conflicts.
  Or he can if he prefers to instead.

- Stephen applies everyone else's work first to his tree, and then the
  good 107 patches in this series. He skips anything that doesn't apply
  due to other people's work and I follow up with a smaller series.

I would prefer to not to have to post a v2 114 patch series if
possible.

If I don't hear back from Stephen about how he wants to proceed, then
I'm planning to send him a PULL request the week of Sep 1st.

Does this sound good? I'm open to other suggestions.

Brian
Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
Posted by Krzysztof Kozlowski 1 month, 1 week ago
On 22/08/2025 13:32, Brian Masney wrote:
> 7 of the 114 patches in this series needs a v2 with a minor fix. I see
> several paths forward to merging this. It's ultimately up to Stephen how
> he wants to proceed.
> 
> - I send Stephen a PULL request with all of these patches with the minor
>   cleanups to the 7 patches. Depending on the timing, Stephen can merge
>   the other work first, and I deal with cleaning up the merge conflicts.
>   Or he can if he prefers to instead.
> 
> - Stephen applies everyone else's work first to his tree, and then the
>   good 107 patches in this series. He skips anything that doesn't apply
>   due to other people's work and I follow up with a smaller series.

Both cause cross tree merge conflicts. Anyway, please document clearly
the dependencies between patches.


Best regards,
Krzysztof
Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
Posted by Brian Masney 1 month, 1 week ago
On Fri, Aug 22, 2025 at 02:23:50PM +0200, Krzysztof Kozlowski wrote:
> On 22/08/2025 13:32, Brian Masney wrote:
> > 7 of the 114 patches in this series needs a v2 with a minor fix. I see
> > several paths forward to merging this. It's ultimately up to Stephen how
> > he wants to proceed.
> > 
> > - I send Stephen a PULL request with all of these patches with the minor
> >   cleanups to the 7 patches. Depending on the timing, Stephen can merge
> >   the other work first, and I deal with cleaning up the merge conflicts.
> >   Or he can if he prefers to instead.
> > 
> > - Stephen applies everyone else's work first to his tree, and then the
> >   good 107 patches in this series. He skips anything that doesn't apply
> >   due to other people's work and I follow up with a smaller series.
> 
> Both cause cross tree merge conflicts. Anyway, please document clearly
> the dependencies between patches.

This series only touches drivers/clk, so it shouldn't cause any issues
with other subsystems, unless there's a topic branch somewhere, or I'm
missing something?

There are some drivers under drivers/clk/ where there is an entry in the
MAINTAINERS file that's not Stephen, although it wasn't clear to me if
all of those people will send PULL requests to Stephen. I described on
the cover how how the series was broken up.

  - Patches 4-70 are for drivers where there is no clk submaintainer
  - Patches 71-110 are for drivers where this is an entry in MAINTAINERS
    (for drivers/clk)

For the clk subdirectories that had say more than 3 patches, I sent
those off as separate patch series. The ones in this series have an
entry in MAINTAINERS only have a few patches for each maintainer.

As for patch dependencies, patches 111 (clk/divider) and
114 (clk/fixed-factor) should go in last. It doesn't matter the order
everything else goes in.

Brian
Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
Posted by Krzysztof Kozlowski 1 month, 1 week ago
On 22/08/2025 15:09, Brian Masney wrote:
> On Fri, Aug 22, 2025 at 02:23:50PM +0200, Krzysztof Kozlowski wrote:
>> On 22/08/2025 13:32, Brian Masney wrote:
>>> 7 of the 114 patches in this series needs a v2 with a minor fix. I see
>>> several paths forward to merging this. It's ultimately up to Stephen how
>>> he wants to proceed.
>>>
>>> - I send Stephen a PULL request with all of these patches with the minor
>>>   cleanups to the 7 patches. Depending on the timing, Stephen can merge
>>>   the other work first, and I deal with cleaning up the merge conflicts.
>>>   Or he can if he prefers to instead.
>>>
>>> - Stephen applies everyone else's work first to his tree, and then the
>>>   good 107 patches in this series. He skips anything that doesn't apply
>>>   due to other people's work and I follow up with a smaller series.
>>
>> Both cause cross tree merge conflicts. Anyway, please document clearly
>> the dependencies between patches.
> 
> This series only touches drivers/clk, so it shouldn't cause any issues
> with other subsystems, unless there's a topic branch somewhere, or I'm
> missing something?

Individual maintainers handle subdirectories.

> 
> There are some drivers under drivers/clk/ where there is an entry in the
> MAINTAINERS file that's not Stephen, although it wasn't clear to me if
> all of those people will send PULL requests to Stephen. I described on
> the cover how how the series was broken up.
> 
>   - Patches 4-70 are for drivers where there is no clk submaintainer
>   - Patches 71-110 are for drivers where this is an entry in MAINTAINERS
>     (for drivers/clk)

It's hidden between multiple other descriptions of patches, so I really
would not think that this means that it is okay by individual maintainer
to take the patch.

This really should be the one most important part of the cover letter
for something like this.
..

Best regards,
Krzysztof
Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
Posted by Geert Uytterhoeven 1 month ago
On Sat, 23 Aug 2025 at 18:43, Krzysztof Kozlowski <krzk@kernel.org> wrote:
> On 22/08/2025 15:09, Brian Masney wrote:
> > On Fri, Aug 22, 2025 at 02:23:50PM +0200, Krzysztof Kozlowski wrote:
> >> On 22/08/2025 13:32, Brian Masney wrote:
> >>> 7 of the 114 patches in this series needs a v2 with a minor fix. I see
> >>> several paths forward to merging this. It's ultimately up to Stephen how
> >>> he wants to proceed.
> >>>
> >>> - I send Stephen a PULL request with all of these patches with the minor
> >>>   cleanups to the 7 patches. Depending on the timing, Stephen can merge
> >>>   the other work first, and I deal with cleaning up the merge conflicts.
> >>>   Or he can if he prefers to instead.
> >>>
> >>> - Stephen applies everyone else's work first to his tree, and then the
> >>>   good 107 patches in this series. He skips anything that doesn't apply
> >>>   due to other people's work and I follow up with a smaller series.
> >>
> >> Both cause cross tree merge conflicts. Anyway, please document clearly
> >> the dependencies between patches.
> >
> > This series only touches drivers/clk, so it shouldn't cause any issues
> > with other subsystems, unless there's a topic branch somewhere, or I'm
> > missing something?
>
> Individual maintainers handle subdirectories.

FWI(still)W, I have taken the Renesas SoC-specific patches through
the renesas-clk tree...

> > There are some drivers under drivers/clk/ where there is an entry in the
> > MAINTAINERS file that's not Stephen, although it wasn't clear to me if
> > all of those people will send PULL requests to Stephen. I described on
> > the cover how how the series was broken up.
> >
> >   - Patches 4-70 are for drivers where there is no clk submaintainer
> >   - Patches 71-110 are for drivers where this is an entry in MAINTAINERS
> >     (for drivers/clk)
>
> It's hidden between multiple other descriptions of patches, so I really
> would not think that this means that it is okay by individual maintainer
> to take the patch.
>
> This really should be the one most important part of the cover letter
> for something like this.
> ..

It was indeed rather implicit:

   "Once all of my conversion patches across the various trees in the kernel
    have been merged, I will post a small series that removes the
    round_rate() op from the clk core and the documentation. Here's the
    other patch series that are currently in flight that need to be merged
    before we can remove round_rate() from the core. [...]"

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
Posted by Icenowy Zheng 1 month, 3 weeks ago
在 2025-08-11星期一的 11:17 -0400,Brian Masney via B4 Relay写道:
> The round_rate() clk ops is deprecated in the clk framework in favor
> of the determine_rate() clk ops, so let's go ahead and convert the
> various clk drivers using the Coccinelle semantic patch posted below.
> I did a few minor cosmetic cleanups of the code in a few cases.
> 
> This series is broken up into several categories:
> 
> - Patch 1 to clk/at91/peripheral is a bug fix for a return value.
> 
> - Patch 2 to clk/at91/peripheral wasn't straight forward like the
> other
>   drivers, so I'm explicitly calling this one out separately.
> 
> - Patch 3 adds a determine_rate() op and keeps the round_rate() in
> place
>   since this is needed by drivers/clk/actions/owl-composite.c and
> keeps
>   the tree bisectable. The deprecated round_rate() op is dropped in
> patch
>   113.
> 
> - Patches 4-70 are for drivers where there is no clk submaintainer
>   listed in the MAINTAINERS file. Patch 19 includes a minor fix so
> that
>   Coccinelle can be ran against a particular source file.
> 
> - Patches 71-110 are for drivers where this is an entry in
> MAINTAINERS
>   for the driver.
> 
> - Patches 111-114 are for drivers that implement both round_rate()
> and
>   determine_rate(), so the round_rate() implementation is dropped.

I was doing a patch to add divider setting support to clk-th1520-ap
driver and sent patch now, should I remove round_rate from the next
revision and just keep determine_rate? Is it safe to do this even if
this patchset is not merged?

In addition, will the clk_round_rate() API exported to other subsystems
be affected?

> 
> Once all of my conversion patches across the various trees in the
> kernel
> have been merged, I will post a small series that removes the
> round_rate() op from the clk core and the documentation. Here's the
> other patch series that are currently in flight that need to be
> merged
> before we can remove round_rate() from the core.
> 
> - arm32 (3):
> https://lore.kernel.org/linux-clk/20250710-arm32-clk-round-rate-v1-0-a9146b77aca9@redhat.com/T/
> - clk/tegra (6):
> https://lore.kernel.org/linux-clk/20250710-clk-tegra-round-rate-v1-0-e48ac3df4279@redhat.com/T/
> - clk/ti (7):
> https://lore.kernel.org/linux-clk/20250811-b4-clk-ti-round-rate-v1-0-cc0840594a49@redhat.com/T/
> - clocksource (1):
> https://lore.kernel.org/linux-clk/20250810-clocksource-round-rate-v1-1-486ef53e45eb@redhat.com/T/
> - drm (9):
> https://lore.kernel.org/linux-clk/20250811-drm-clk-round-rate-v2-0-4a91ccf239cf@redhat.com/T/
> - drm/msm (7):
> https://lore.kernel.org/linux-clk/20250810-drm-msm-phy-clk-round-rate-v2-0-0fd1f7979c83@redhat.com/T/
> - i2c (1):
> https://lore.kernel.org/linux-clk/20250810-i2c-round-rate-v1-1-9488b57153e7@redhat.com/T/
> - media (4):
> https://lore.kernel.org/linux-clk/20250710-media-clk-round-rate-v1-0-a9617b061741@redhat.com/T/
> - mips (1):
> https://lore.kernel.org/linux-clk/20250810-mips-round-rate-v1-1-54e424c520dd@redhat.com/T/
> - net (1):
> https://lore.kernel.org/linux-clk/20250810-net-round-rate-v1-1-dbb237c9fe5c@redhat.com/T/
> - peci (1):
> https://lore.kernel.org/linux-clk/20250810-peci-round-rate-v1-1-ec96d216a455@redhat.com/T/
> - phy (9):
> https://lore.kernel.org/linux-phy/20250810-phy-clk-round-rate-v2-0-9162470bb9f2@redhat.com/T/
> - pmdomain (1):
> https://lore.kernel.org/linux-clk/20250810-pmdomain-round-rate-v1-1-1a90dbacdeb6@redhat.com/T/
> - tty (1):
> https://lore.kernel.org/linux-clk/20250810-tty-round-rate-v1-1-849009f3bdfd@redhat.com/T/
> 
> Coccinelle semantic patch:
> 
>     virtual patch
> 
>     // Look up the current name of the round_rate function
>     @ has_round_rate @
>     identifier round_rate_name =~ ".*_round_rate";
>     identifier hw_param, rate_param, parent_rate_param;
>     @@
> 
>     long round_rate_name(struct clk_hw *hw_param, unsigned long
> rate_param,
>                   unsigned long *parent_rate_param)
>     {
>         ...
>     }
> 
>     // Rename the route_rate function name to determine_rate()
>     @ script:python generate_name depends on has_round_rate @
>     round_rate_name << has_round_rate.round_rate_name;
>     new_name;
>     @@
> 
>     coccinelle.new_name = round_rate_name.replace("_round_rate",
> "_determine_rate")
> 
>     // Change rate to req->rate; also change occurrences of 'return
> XXX'.
>     @ chg_rate depends on generate_name @
>     identifier has_round_rate.round_rate_name;
>     identifier has_round_rate.hw_param;
>     identifier has_round_rate.rate_param;
>     identifier has_round_rate.parent_rate_param;
>     identifier ERR =~ "E.*";
>     expression E;
>     @@
> 
>     long round_rate_name(struct clk_hw *hw_param, unsigned long
> rate_param,
>                   unsigned long *parent_rate_param)
>     {
>     <...
>     (
>     -return -ERR;
>     +return -ERR;
>     |
>     - return rate_param;
>     + return 0;
>     |
>     - return E;
>     + req->rate = E;
>     +
>     + return 0;
>     |
>     - rate_param
>     + req->rate
>     )
>     ...>
>     }
> 
>     // Coccinelle only transforms the first occurrence of the rate
> parameter
>     // Run a second time. FIXME: Is there a better way to do this?
>     @ chg_rate2 depends on generate_name @
>     identifier has_round_rate.round_rate_name;
>     identifier has_round_rate.hw_param;
>     identifier has_round_rate.rate_param;
>     identifier has_round_rate.parent_rate_param;
>     @@
> 
>     long round_rate_name(struct clk_hw *hw_param, unsigned long
> rate_param,
>                   unsigned long *parent_rate_param)
>     {
>     <...
>     - rate_param
>     + req->rate
>     ...>
>     }
> 
>     // Change parent_rate to req->best_parent_rate
>     @ chg_parent_rate depends on generate_name @
>     identifier has_round_rate.round_rate_name;
>     identifier has_round_rate.hw_param;
>     identifier has_round_rate.rate_param;
>     identifier has_round_rate.parent_rate_param;
>     @@
> 
>     long round_rate_name(struct clk_hw *hw_param, unsigned long
> rate_param,
>                   unsigned long *parent_rate_param)
>     {
>     <...
>     (
>     - *parent_rate_param
>     + req->best_parent_rate
>     |
>     - parent_rate_param
>     + &req->best_parent_rate
>     )
>     ...>
>     }
> 
>     // Convert the function definition from round_rate() to
> determine_rate()
>     @ func_definition depends on chg_rate @
>     identifier has_round_rate.round_rate_name;
>     identifier has_round_rate.hw_param;
>     identifier has_round_rate.rate_param;
>     identifier has_round_rate.parent_rate_param;
>     identifier generate_name.new_name;
>     @@
> 
>     - long round_rate_name(struct clk_hw *hw_param, unsigned long
> rate_param,
>     -               unsigned long *parent_rate_param)
>     + int new_name(struct clk_hw *hw, struct clk_rate_request *req)
>     {
>         ...
>     }
> 
>     // Update the ops from round_rate() to determine_rate()
>     @ ops depends on func_definition @
>     identifier has_round_rate.round_rate_name;
>     identifier generate_name.new_name;
>     @@
> 
>     {
>         ...,
>     -   .round_rate = round_rate_name,
>     +   .determine_rate = new_name,
>         ...,
>     }
> 
> Note that I used coccinelle 1.2 instead of 1.3 since the newer
> version
> adds unnecessary braces as described in this post.
> https://lore.kernel.org/cocci/67642477-5f3e-4b2a-914d-579a54f48cbd@intel.com/
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
> Brian Masney (114):
>       clk: at91: peripheral: fix return value
>       clk: at91: peripheral: convert from round_rate() to
> determine_rate()
>       clk: fixed-factor: add determine_rate() ops
>       clk: at91: audio-pll: convert from round_rate() to
> determine_rate()
>       clk: at91: h32mx: convert from round_rate() to determine_rate()
>       clk: at91: pll: convert from round_rate() to determine_rate()
>       clk: at91: plldiv: convert from round_rate() to
> determine_rate()
>       clk: at91: sam9x60-pll: convert from round_rate() to
> determine_rate()
>       clk: at91: usb: convert from round_rate() to determine_rate()
>       clk: baikal-t1: ccu-div: convert from round_rate() to
> determine_rate()
>       clk: baikal-t1: ccu-pll: convert from round_rate() to
> determine_rate()
>       clk: cdce925: convert from round_rate() to determine_rate()
>       clk: cs2000-cp: convert from round_rate() to determine_rate()
>       clk: ep93xx: convert from round_rate() to determine_rate()
>       clk: fractional-divider: convert from round_rate() to
> determine_rate()
>       clk: gemini: convert from round_rate() to determine_rate()
>       clk: highbank: convert from round_rate() to determine_rate()
>       clk: hisilicon: clkdivider-hi6220: convert from round_rate() to
> determine_rate()
>       clk: hisilicon: hi3660-stub: move comma from declaration of
> DEFINE_CLK_STUB()
>       clk: hisilicon: hi3660-stub: convert from round_rate() to
> determine_rate()
>       clk: hisilicon: hi6220-stub: convert from round_rate() to
> determine_rate()
>       clk: ingenic: cgu: convert from round_rate() to
> determine_rate()
>       clk: ingenic: jz4780-cgu: convert from round_rate() to
> determine_rate()
>       clk: ingenic: x1000-cgu: convert from round_rate() to
> determine_rate()
>       clk: lmk04832: convert from round_rate() to determine_rate()
>       clk: loongson1: convert from round_rate() to determine_rate()
>       clk: max9485: convert from round_rate() to determine_rate()
>       clk: milbeaut: convert from round_rate() to determine_rate()
>       clk: mmp: audio: convert from round_rate() to determine_rate()
>       clk: mmp: frac: convert from round_rate() to determine_rate()
>       clk: multiplier: convert from round_rate() to determine_rate()
>       clk: mxs: div: convert from round_rate() to determine_rate()
>       clk: mxs: frac: convert from round_rate() to determine_rate()
>       clk: mxs: ref: convert from round_rate() to determine_rate()
>       clk: nuvoton: ma35d1-divider: convert from round_rate() to
> determine_rate()
>       clk: nuvoton: ma35d1-pll: convert from round_rate() to
> determine_rate()
>       clk: nxp: lpc18xx-cgu: convert from round_rate() to
> determine_rate()
>       clk: nxp: lpc32xx: convert from round_rate() to
> determine_rate()
>       clk: pistachio: pll: convert from round_rate() to
> determine_rate()
>       clk: scpi: convert from round_rate() to determine_rate()
>       clk: si514: convert from round_rate() to determine_rate()
>       clk: si521xx: convert from round_rate() to determine_rate()
>       clk: si5341: convert from round_rate() to determine_rate()
>       clk: si544: convert from round_rate() to determine_rate()
>       clk: si570: convert from round_rate() to determine_rate()
>       clk: sifive: sifive-prci: convert from round_rate() to
> determine_rate()
>       clk: sophgo: cv18xx-ip: convert from round_rate() to
> determine_rate()
>       clk: sophgo: sg2042-clkgen: convert from round_rate() to
> determine_rate()
>       clk: spacemit: ccu_ddn: convert from round_rate() to
> determine_rate()
>       clk: spacemit: ccu_mix: convert from round_rate() to
> determine_rate()
>       clk: spacemit: ccu_pll: convert from round_rate() to
> determine_rate()
>       clk: sparx5: convert from round_rate() to determine_rate()
>       clk: sprd: div: convert from round_rate() to determine_rate()
>       clk: sprd: pll: convert from round_rate() to determine_rate()
>       clk: st: clkgen-fsyn: convert from round_rate() to
> determine_rate()
>       clk: st: clkgen-pll: convert from round_rate() to
> determine_rate()
>       clk: stm32f4: convert from round_rate() to determine_rate()
>       clk: stm32: stm32-core: convert from round_rate() to
> determine_rate()
>       clk: stm32: stm32mp1: convert from round_rate() to
> determine_rate()
>       clk: tps68470: convert from round_rate() to determine_rate()
>       clk: versaclock3: convert from round_rate() to determine_rate()
>       clk: vt8500: convert from round_rate() to determine_rate()
>       clk: wm831x: convert from round_rate() to determine_rate()
>       clk: x86: cgu: convert from round_rate() to determine_rate()
>       clk: xgene: convert from round_rate() to determine_rate()
>       clk: xilinx: xlnx-clock-wizard: convert from round_rate() to
> determine_rate()
>       clk: xilinx: xlnx_vcu: convert from round_rate() to
> determine_rate()
>       clk: zynqmp: divider: convert from round_rate() to
> determine_rate()
>       clk: zynqmp: pll: convert from round_rate() to determine_rate()
>       clk: zynq: pll: convert from round_rate() to determine_rate()
>       clk: actions: owl-composite: convert from round_rate() to
> determine_rate()
>       clk: actions: owl-divider: convert from round_rate() to
> determine_rate()
>       clk: actions: owl-factor: convert from round_rate() to
> determine_rate()
>       clk: actions: owl-pll: convert from round_rate() to
> determine_rate()
>       clk: apple-nco: convert from round_rate() to determine_rate()
>       clk: axs10x: i2s_pll_clock: convert from round_rate() to
> determine_rate()
>       clk: axs10x: pll_clock: convert from round_rate() to
> determine_rate()
>       clk: bcm: iproc-asiu: convert from round_rate() to
> determine_rate()
>       clk: bm1880: convert from round_rate() to determine_rate()
>       clk: cdce706: convert from round_rate() to determine_rate()
>       clk: hsdk-pll: convert from round_rate() to determine_rate()
>       clk: mediatek: pll: convert from round_rate() to
> determine_rate()
>       clk: microchip: core: convert from round_rate() to
> determine_rate()
>       clk: mstar: msc313-cpupll: convert from round_rate() to
> determine_rate()
>       clk: mvebu: ap-cpu-clk: convert from round_rate() to
> determine_rate()
>       clk: mvebu: armada-37xx-periph: convert from round_rate() to
> determine_rate()
>       clk: mvebu: corediv: convert from round_rate() to
> determine_rate()
>       clk: mvebu: cpu: convert from round_rate() to determine_rate()
>       clk: mvebu: dove-divider: convert from round_rate() to
> determine_rate()
>       clk: qcom: alpha-pll: convert from round_rate() to
> determine_rate()
>       clk: qcom: regmap-divider: convert from round_rate() to
> determine_rate()
>       clk: renesas: rzg2l-cpg: convert from round_rate() to
> determine_rate()
>       clk: renesas: rzv2h-cpg: remove round_rate() in favor of
> determine_rate()
>       clk: rockchip: ddr: convert from round_rate() to
> determine_rate()
>       clk: rockchip: half-divider: convert from round_rate() to
> determine_rate()
>       clk: rockchip: pll: convert from round_rate() to
> determine_rate()
>       clk: rp1: convert from round_rate() to determine_rate()
>       clk: samsung: cpu: convert from round_rate() to
> determine_rate()
>       clk: samsung: pll: convert from round_rate() to
> determine_rate()
>       clk: sp7021: convert from round_rate() to determine_rate()
>       clk: spear: aux-synth: convert from round_rate() to
> determine_rate()
>       clk: spear: frac-synth: convert from round_rate() to
> determine_rate()
>       clk: spear: gpt-synth: convert from round_rate() to
> determine_rate()
>       clk: spear: vco-pll: convert from round_rate() to
> determine_rate()
>       clk: ux500: prcmu: convert from round_rate() to
> determine_rate()
>       clk: versaclock5: convert from round_rate() to determine_rate()
>       clk: versaclock7: convert from round_rate() to determine_rate()
>       clk: versatile: icst: convert from round_rate() to
> determine_rate()
>       clk: versatile: vexpress-osc: convert from round_rate() to
> determine_rate()
>       clk: visconti: pll: convert from round_rate() to
> determine_rate()
>       clk: divider: remove round_rate() in favor of determine_rate()
>       clk: scmi: remove round_rate() in favor of determine_rate()
>       clk: sophgo: sg2042-pll: remove round_rate() in favor of
> determine_rate()
>       clk: fixed-factor: drop round_rate() clk ops
> 
>  drivers/clk/actions/owl-composite.c        |   8 +-
>  drivers/clk/actions/owl-divider.c          |  13 +--
>  drivers/clk/actions/owl-factor.c           |  12 +--
>  drivers/clk/actions/owl-pll.c              |  25 ++++--
>  drivers/clk/at91/clk-audio-pll.c           |  42 +++++----
>  drivers/clk/at91/clk-h32mx.c               |  33 ++++---
>  drivers/clk/at91/clk-peripheral.c          |  48 ++++++----
>  drivers/clk/at91/clk-pll.c                 |  12 +--
>  drivers/clk/at91/clk-plldiv.c              |  34 +++++---
>  drivers/clk/at91/clk-sam9x60-pll.c         |  29 +++---
>  drivers/clk/at91/clk-usb.c                 |  20 +++--
>  drivers/clk/axs10x/i2s_pll_clock.c         |  14 +--
>  drivers/clk/axs10x/pll_clock.c             |  12 +--
>  drivers/clk/baikal-t1/ccu-div.c            |  27 +++---
>  drivers/clk/baikal-t1/ccu-pll.c            |  14 +--
>  drivers/clk/bcm/clk-iproc-asiu.c           |  25 +++---
>  drivers/clk/clk-apple-nco.c                |  14 +--
>  drivers/clk/clk-bm1880.c                   |  21 +++--
>  drivers/clk/clk-cdce706.c                  |  16 ++--
>  drivers/clk/clk-cdce925.c                  |  50 ++++++-----
>  drivers/clk/clk-cs2000-cp.c                |  14 +--
>  drivers/clk/clk-divider.c                  |  23 -----
>  drivers/clk/clk-ep93xx.c                   |  18 ++--
>  drivers/clk/clk-fixed-factor.c             |  16 ++--
>  drivers/clk/clk-fractional-divider.c       |  25 ++++--
>  drivers/clk/clk-gemini.c                   |  15 ++--
>  drivers/clk/clk-highbank.c                 |  26 +++---
>  drivers/clk/clk-hsdk-pll.c                 |  12 +--
>  drivers/clk/clk-lmk04832.c                 |  53 ++++++-----
>  drivers/clk/clk-loongson1.c                |  12 +--
>  drivers/clk/clk-max9485.c                  |  27 +++---
>  drivers/clk/clk-milbeaut.c                 |  22 +++--
>  drivers/clk/clk-multiplier.c               |  12 +--
>  drivers/clk/clk-rp1.c                      |  45 ++++++----
>  drivers/clk/clk-scmi.c                     |  30 -------
>  drivers/clk/clk-scpi.c                     |  18 ++--
>  drivers/clk/clk-si514.c                    |  24 +++--
>  drivers/clk/clk-si521xx.c                  |  14 +--
>  drivers/clk/clk-si5341.c                   |  22 +++--
>  drivers/clk/clk-si544.c                    |  10 +--
>  drivers/clk/clk-si570.c                    |  24 +++--
>  drivers/clk/clk-sp7021.c                   |  22 ++---
>  drivers/clk/clk-sparx5.c                   |  10 ++-
>  drivers/clk/clk-stm32f4.c                  |  26 +++---
>  drivers/clk/clk-tps68470.c                 |  12 +--
>  drivers/clk/clk-versaclock3.c              |  70 +++++++++------
>  drivers/clk/clk-versaclock5.c              |  71 ++++++++-------
>  drivers/clk/clk-versaclock7.c              |  30 ++++---
>  drivers/clk/clk-vt8500.c                   |  59 ++++++++-----
>  drivers/clk/clk-wm831x.c                   |  14 +--
>  drivers/clk/clk-xgene.c                    |  41 +++++----
>  drivers/clk/hisilicon/clk-hi3660-stub.c    |  18 ++--
>  drivers/clk/hisilicon/clk-hi6220-stub.c    |  12 +--
>  drivers/clk/hisilicon/clkdivider-hi6220.c  |  12 +--
>  drivers/clk/ingenic/cgu.c                  |  12 +--
>  drivers/clk/ingenic/jz4780-cgu.c           |  24 ++---
>  drivers/clk/ingenic/x1000-cgu.c            |  19 ++--
>  drivers/clk/mediatek/clk-pll.c             |  13 +--
>  drivers/clk/mediatek/clk-pll.h             |   3 +-
>  drivers/clk/mediatek/clk-pllfh.c           |   2 +-
>  drivers/clk/microchip/clk-core.c           |  44 ++++++----
>  drivers/clk/mmp/clk-audio.c                |  18 ++--
>  drivers/clk/mmp/clk-frac.c                 |  27 +++---
>  drivers/clk/mstar/clk-msc313-cpupll.c      |  18 ++--
>  drivers/clk/mvebu/ap-cpu-clk.c             |  12 +--
>  drivers/clk/mvebu/armada-37xx-periph.c     |  15 ++--
>  drivers/clk/mvebu/clk-corediv.c            |  18 ++--
>  drivers/clk/mvebu/clk-cpu.c                |  12 +--
>  drivers/clk/mvebu/dove-divider.c           |  16 ++--
>  drivers/clk/mxs/clk-div.c                  |   8 +-
>  drivers/clk/mxs/clk-frac.c                 |  16 ++--
>  drivers/clk/mxs/clk-ref.c                  |  16 ++--
>  drivers/clk/nuvoton/clk-ma35d1-divider.c   |  12 ++-
>  drivers/clk/nuvoton/clk-ma35d1-pll.c       |  28 +++---
>  drivers/clk/nxp/clk-lpc18xx-cgu.c          |  16 ++--
>  drivers/clk/nxp/clk-lpc32xx.c              |  59 +++++++------
>  drivers/clk/pistachio/clk-pll.c            |  20 +++--
>  drivers/clk/qcom/clk-alpha-pll.c           | 136 ++++++++++++++++---
> ----------
>  drivers/clk/qcom/clk-regmap-divider.c      |  27 +++---
>  drivers/clk/renesas/rzg2l-cpg.c            |   9 +-
>  drivers/clk/renesas/rzv2h-cpg.c            |  10 ---
>  drivers/clk/rockchip/clk-ddr.c             |  13 +--
>  drivers/clk/rockchip/clk-half-divider.c    |  12 +--
>  drivers/clk/rockchip/clk-pll.c             |  23 +++--
>  drivers/clk/samsung/clk-cpu.c              |  12 +--
>  drivers/clk/samsung/clk-pll.c              |  33 ++++---
>  drivers/clk/sifive/fu540-prci.h            |   2 +-
>  drivers/clk/sifive/fu740-prci.h            |   2 +-
>  drivers/clk/sifive/sifive-prci.c           |  11 +--
>  drivers/clk/sifive/sifive-prci.h           |   4 +-
>  drivers/clk/sophgo/clk-cv18xx-ip.c         |  10 ++-
>  drivers/clk/sophgo/clk-sg2042-clkgen.c     |  17 ++--
>  drivers/clk/sophgo/clk-sg2042-pll.c        |  24 ++---
>  drivers/clk/spacemit/ccu_ddn.c             |  11 ++-
>  drivers/clk/spacemit/ccu_mix.c             |  12 +--
>  drivers/clk/spacemit/ccu_pll.c             |  10 ++-
>  drivers/clk/spear/clk-aux-synth.c          |  12 +--
>  drivers/clk/spear/clk-frac-synth.c         |  12 +--
>  drivers/clk/spear/clk-gpt-synth.c          |  12 +--
>  drivers/clk/spear/clk-vco-pll.c            |  23 +++--
>  drivers/clk/sprd/div.c                     |  13 +--
>  drivers/clk/sprd/pll.c                     |   8 +-
>  drivers/clk/st/clkgen-fsyn.c               |  33 +++----
>  drivers/clk/st/clkgen-pll.c                |  38 ++++----
>  drivers/clk/stm32/clk-stm32-core.c         |  28 +++---
>  drivers/clk/stm32/clk-stm32mp1.c           |  13 +--
>  drivers/clk/ux500/clk-prcmu.c              |  14 +--
>  drivers/clk/versatile/clk-icst.c           |  72 +++++++++------
>  drivers/clk/versatile/clk-vexpress-osc.c   |  16 ++--
>  drivers/clk/visconti/pll.c                 |  17 ++--
>  drivers/clk/x86/clk-cgu.c                  |  35 ++++----
>  drivers/clk/xilinx/clk-xlnx-clock-wizard.c |  55 ++++++------
>  drivers/clk/xilinx/xlnx_vcu.c              |  15 ++--
>  drivers/clk/zynq/pll.c                     |  12 +--
>  drivers/clk/zynqmp/divider.c               |  23 ++---
>  drivers/clk/zynqmp/pll.c                   |  24 ++---
>  116 files changed, 1477 insertions(+), 1132 deletions(-)
> ---
> base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
> change-id: 20250729-clk-for-stephen-round-rate-5a88ebdf8da6
> 
> Best regards,

Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
Posted by Brian Masney 1 month, 3 weeks ago
On Tue, Aug 12, 2025 at 09:39:45PM +0800, Icenowy Zheng wrote:
> I was doing a patch to add divider setting support to clk-th1520-ap
> driver and sent patch now, should I remove round_rate from the next
> revision and just keep determine_rate? Is it safe to do this even if
> this patchset is not merged?

Yes, you only need to implement the determine_rate() clk op. Please
remove any references to the round_rate() clk op from your driver. If
you implement both, then only the determine_rate() clk op is actually
used by the clk core.

> In addition, will the clk_round_rate() API exported to other subsystems
> be affected?

No, that will stay as is, and with the same name. The underlying
implementation in the clk core uses the determine_rate() clk op.

Brian
Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
Posted by Brian Masney 3 weeks, 5 days ago
On Mon, Aug 11, 2025 at 11:17:52AM -0400, Brian Masney wrote:
> The round_rate() clk ops is deprecated in the clk framework in favor
> of the determine_rate() clk ops, so let's go ahead and convert the
> various clk drivers using the Coccinelle semantic patch posted below.
> I did a few minor cosmetic cleanups of the code in a few cases.

I included a subset of these patches in this pull request to Stephen:
https://lore.kernel.org/linux-clk/aL8MXYrR5uoBa4cB@x1/T/#u

Brian
Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
Posted by Brian Masney 1 month ago
On Mon, Aug 11, 2025 at 11:17:52AM -0400, Brian Masney wrote:
> The round_rate() clk ops is deprecated in the clk framework in favor
> of the determine_rate() clk ops, so let's go ahead and convert the
> various clk drivers using the Coccinelle semantic patch posted below.
> I did a few minor cosmetic cleanups of the code in a few cases.

I posted a v2 patch series with 8 patches from this series that needed a
v2 to:

https://lore.kernel.org/linux-clk/20250828-clk-round-rate-v2-v1-0-b97ec8ba6cc4@redhat.com/T/

Sorry I didn't put PATCH v2 in the subject. I noticed as soon as it
started to send.

In summary, it fixes one merge conflict introduced in linux-next, remove
one case of &*, fix a comment, and removes unnecessary space after a
cast on 5 patches.

There are currently 7 patches from this series that's currently in
linux-next (renesas, spacemit, samsung). 

The relevant remaining 99 patches from this series waiting to be merged
can be grabbed with this command:

b4 am --add-link \
	--cherry-pick 1-37,39-47,52-63,65-67,69-89,91-91,94-94,96-96,100-112,114-114 \
	20250811-clk-for-stephen-round-rate-v1-0-b3bf97b038dc@redhat.com

There's no dependencies with the other series.

Brian
Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
Posted by Manivannan Sadhasivam 1 month, 3 weeks ago
On Mon, Aug 11, 2025 at 11:17:52AM GMT, Brian Masney via B4 Relay wrote:
> The round_rate() clk ops is deprecated in the clk framework in favor
> of the determine_rate() clk ops, so let's go ahead and convert the
> various clk drivers using the Coccinelle semantic patch posted below.
> I did a few minor cosmetic cleanups of the code in a few cases.
> 
> This series is broken up into several categories:
> 
> - Patch 1 to clk/at91/peripheral is a bug fix for a return value.
> 
> - Patch 2 to clk/at91/peripheral wasn't straight forward like the other
>   drivers, so I'm explicitly calling this one out separately.
> 
> - Patch 3 adds a determine_rate() op and keeps the round_rate() in place
>   since this is needed by drivers/clk/actions/owl-composite.c and keeps
>   the tree bisectable. The deprecated round_rate() op is dropped in patch
>   113.
> 
> - Patches 4-70 are for drivers where there is no clk submaintainer
>   listed in the MAINTAINERS file. Patch 19 includes a minor fix so that
>   Coccinelle can be ran against a particular source file.
> 
> - Patches 71-110 are for drivers where this is an entry in MAINTAINERS
>   for the driver.
> 
> - Patches 111-114 are for drivers that implement both round_rate() and
>   determine_rate(), so the round_rate() implementation is dropped.
> 
> Once all of my conversion patches across the various trees in the kernel
> have been merged, I will post a small series that removes the
> round_rate() op from the clk core and the documentation. Here's the
> other patch series that are currently in flight that need to be merged
> before we can remove round_rate() from the core.
> 

Please do not CC all reviewers/maintainers of individual clock controller
drivers to all patches, but only to the respective clock controller patches.
It just spams our inbox. CCing all of us in the cover letter is fine though.

- Mani

-- 
மணிவண்ணன் சதாசிவம்
Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
Posted by Krzysztof Kozlowski 1 month, 1 week ago
On 11/08/2025 17:17, Brian Masney via B4 Relay wrote:
> The round_rate() clk ops is deprecated in the clk framework in favor
> of the determine_rate() clk ops, so let's go ahead and convert the
> various clk drivers using the Coccinelle semantic patch posted below.
> I did a few minor cosmetic cleanups of the code in a few cases.
> 
@Stephen,

There will be dependencies/conflicts for Samsung, so I will take the two
Samsung patches. Let me know if you disagree.

Best regards,
Krzysztof
Re: [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
Posted by Brian Masney 1 month, 3 weeks ago
On Mon, Aug 11, 2025 at 11:17:52AM -0400, Brian Masney via B4 Relay wrote:
> Once all of my conversion patches across the various trees in the kernel
> have been merged, I will post a small series that removes the
> round_rate() op from the clk core and the documentation. Here's the
> other patch series that are currently in flight that need to be merged
> before we can remove round_rate() from the core.
> 
> - arm32 (3): https://lore.kernel.org/linux-clk/20250710-arm32-clk-round-rate-v1-0-a9146b77aca9@redhat.com/T/
> - clk/tegra (6): https://lore.kernel.org/linux-clk/20250710-clk-tegra-round-rate-v1-0-e48ac3df4279@redhat.com/T/
> - clk/ti (7): https://lore.kernel.org/linux-clk/20250811-b4-clk-ti-round-rate-v1-0-cc0840594a49@redhat.com/T/
> - clocksource (1): https://lore.kernel.org/linux-clk/20250810-clocksource-round-rate-v1-1-486ef53e45eb@redhat.com/T/
> - drm (9): https://lore.kernel.org/linux-clk/20250811-drm-clk-round-rate-v2-0-4a91ccf239cf@redhat.com/T/
> - drm/msm (7): https://lore.kernel.org/linux-clk/20250810-drm-msm-phy-clk-round-rate-v2-0-0fd1f7979c83@redhat.com/T/
> - i2c (1): https://lore.kernel.org/linux-clk/20250810-i2c-round-rate-v1-1-9488b57153e7@redhat.com/T/
> - media (4): https://lore.kernel.org/linux-clk/20250710-media-clk-round-rate-v1-0-a9617b061741@redhat.com/T/
> - mips (1): https://lore.kernel.org/linux-clk/20250810-mips-round-rate-v1-1-54e424c520dd@redhat.com/T/
> - net (1): https://lore.kernel.org/linux-clk/20250810-net-round-rate-v1-1-dbb237c9fe5c@redhat.com/T/
> - peci (1): https://lore.kernel.org/linux-clk/20250810-peci-round-rate-v1-1-ec96d216a455@redhat.com/T/
> - phy (9): https://lore.kernel.org/linux-phy/20250810-phy-clk-round-rate-v2-0-9162470bb9f2@redhat.com/T/
> - pmdomain (1): https://lore.kernel.org/linux-clk/20250810-pmdomain-round-rate-v1-1-1a90dbacdeb6@redhat.com/T/
> - tty (1): https://lore.kernel.org/linux-clk/20250810-tty-round-rate-v1-1-849009f3bdfd@redhat.com/T/

Konrad noticed on patch 90 the space after the cast. I thought I fixed
all of those by hand, but apparently not. I looked through this series
(and the others above) with `grep "u64) "` and `grep "long) "`, and found
4 other cases.

Patch 38: clk: nxp: lpc32xx: convert from round_rate() to determine_rate()
Patch 64: clk: x86: cgu: convert from round_rate() to determine_rate()
Patch 68: clk: zynqmp: divider: convert from round_rate() to determine_rate()
Patch 95: clk: rockchip: half-divider: convert from round_rate() to determine_rate()

Brian
Re: (subset) [PATCH 000/114] clk: convert drivers from deprecated round_rate() to determine_rate()
Posted by Yixun Lan 1 month, 1 week ago
On Mon, 11 Aug 2025 11:17:52 -0400, Brian Masney wrote:
> The round_rate() clk ops is deprecated in the clk framework in favor
> of the determine_rate() clk ops, so let's go ahead and convert the
> various clk drivers using the Coccinelle semantic patch posted below.
> I did a few minor cosmetic cleanups of the code in a few cases.
> 
> This series is broken up into several categories:
> 
> [...]

Thanks, Applied to SpacemiT's SoC tree at "k1/clk-for-6.18" branch

[049/114] clk: spacemit: ccu_ddn: convert from round_rate() to determine_rate()
          https://github.com/spacemit-com/linux/commit/b4a7b0d2c4485d11d37dec721709660f3967efcf
[050/114] clk: spacemit: ccu_mix: convert from round_rate() to determine_rate()
          https://github.com/spacemit-com/linux/commit/56737edda7db58549550776092da12fe03600399
[051/114] clk: spacemit: ccu_pll: convert from round_rate() to determine_rate()
          https://github.com/spacemit-com/linux/commit/d02c71cba7bba453d233a49497412ddbf2d44871

Best regards,
-- 
Yixun Lan