* [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate()
@ 2025-07-03 23:22 Brian Masney
2025-07-03 23:22 ` [PATCH 01/10] clk: bcm: bcm2835: convert from " Brian Masney
` (11 more replies)
0 siblings, 12 replies; 24+ messages in thread
From: Brian Masney @ 2025-07-03 23:22 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Florian Fainelli, Ray Jui,
Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi, Brian Masney
The round_rate() clk ops is deprecated in the clk framework in favor
of the determine_rate() ops, so let's go ahead and convert some of the
outstanding bcm, qcom, and sunxi drivers that have a round_rate()
implementation over to determine_rate() using the Coccinelle semantic
patch posted below.
This Coccinelle semantic patch is able to automatically convert ~95% of
the clk drivers, and I can clean up the remaining ones by hand. I'll
initially post some small changes to get feedback about the approach,
and I can post some larger series by submaintainer once we get
agreement that the approach looks good.
I boot tested this on a Raspberry Pi 4 using Fedora 42, and validated
that the mmc driver still works since it uses the bcm2835 clk driver.
The other drivers were only compile tested.
There are some other cleanups improvements that can be done to some of
these drivers, however given the volume of changes, I'm only focusing
on the migration of the existing code, and making changes in a
deterministic way.
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 (10):
clk: bcm: bcm2835: convert from round_rate() to determine_rate()
clk: qcom: gcc-ipq4019: convert from round_rate() to determine_rate()
clk: qcom: rpm: convert from round_rate() to determine_rate()
clk: qcom: rpmh: convert from round_rate() to determine_rate()
clk: qcom: smd-rpm: convert from round_rate() to determine_rate()
clk: qcom: spmi-pmic-div: convert from round_rate() to determine_rate()
clk: sunxi-ng: ccu_gate: convert from round_rate() to determine_rate()
clk: sunxi-ng: ccu_nk: convert from round_rate() to determine_rate()
clk: sunxi-ng: ccu_nkmp: convert from round_rate() to determine_rate()
clk: sunxi-ng: ccu_nm: convert from round_rate() to determine_rate()
drivers/clk/bcm/clk-bcm2835.c | 17 +++++++++-----
drivers/clk/qcom/clk-rpm.c | 10 ++++-----
drivers/clk/qcom/clk-rpmh.c | 8 +++----
drivers/clk/qcom/clk-smd-rpm.c | 8 +++----
drivers/clk/qcom/clk-spmi-pmic-div.c | 12 +++++-----
drivers/clk/qcom/gcc-ipq4019.c | 14 +++++++-----
drivers/clk/sunxi-ng/ccu_gate.c | 14 +++++++-----
drivers/clk/sunxi-ng/ccu_nk.c | 14 ++++++------
drivers/clk/sunxi-ng/ccu_nkmp.c | 23 ++++++++++---------
drivers/clk/sunxi-ng/ccu_nm.c | 43 ++++++++++++++++++------------------
10 files changed, 88 insertions(+), 75 deletions(-)
---
base-commit: 17bbde2e1716e2ee4b997d476b48ae85c5a47671
change-id: 20250703-clk-cocci-drop-round-rate-62c89b2d4c6c
Best regards,
--
Brian Masney <bmasney@redhat.com>
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 01/10] clk: bcm: bcm2835: convert from round_rate() to determine_rate()
2025-07-03 23:22 [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney
@ 2025-07-03 23:22 ` Brian Masney
2025-07-09 0:06 ` Florian Fainelli
2025-07-24 21:32 ` Stephen Boyd
2025-07-03 23:22 ` [PATCH 02/10] clk: qcom: gcc-ipq4019: " Brian Masney
` (10 subsequent siblings)
11 siblings, 2 replies; 24+ messages in thread
From: Brian Masney @ 2025-07-03 23:22 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Florian Fainelli, Ray Jui,
Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi, Brian Masney
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
drivers/clk/bcm/clk-bcm2835.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
index fb04734afc806286b6a68996f36bd8a49b542cc8..5e7788406de39c94884cbc3aa162c378443322c0 100644
--- a/drivers/clk/bcm/clk-bcm2835.c
+++ b/drivers/clk/bcm/clk-bcm2835.c
@@ -570,18 +570,23 @@ static long bcm2835_pll_rate_from_divisors(unsigned long parent_rate,
return rate >> A2W_PLL_FRAC_BITS;
}
-static long bcm2835_pll_round_rate(struct clk_hw *hw, unsigned long rate,
- unsigned long *parent_rate)
+static int bcm2835_pll_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
{
struct bcm2835_pll *pll = container_of(hw, struct bcm2835_pll, hw);
const struct bcm2835_pll_data *data = pll->data;
u32 ndiv, fdiv;
- rate = clamp(rate, data->min_rate, data->max_rate);
+ req->rate = clamp(req->rate, data->min_rate, data->max_rate);
- bcm2835_pll_choose_ndiv_and_fdiv(rate, *parent_rate, &ndiv, &fdiv);
+ bcm2835_pll_choose_ndiv_and_fdiv(req->rate, req->best_parent_rate,
+ &ndiv, &fdiv);
- return bcm2835_pll_rate_from_divisors(*parent_rate, ndiv, fdiv, 1);
+ req->rate = bcm2835_pll_rate_from_divisors(req->best_parent_rate,
+ ndiv, fdiv,
+ 1);
+
+ return 0;
}
static unsigned long bcm2835_pll_get_rate(struct clk_hw *hw,
@@ -783,7 +788,7 @@ static const struct clk_ops bcm2835_pll_clk_ops = {
.unprepare = bcm2835_pll_off,
.recalc_rate = bcm2835_pll_get_rate,
.set_rate = bcm2835_pll_set_rate,
- .round_rate = bcm2835_pll_round_rate,
+ .determine_rate = bcm2835_pll_determine_rate,
.debug_init = bcm2835_pll_debug_init,
};
--
2.50.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 02/10] clk: qcom: gcc-ipq4019: convert from round_rate() to determine_rate()
2025-07-03 23:22 [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney
2025-07-03 23:22 ` [PATCH 01/10] clk: bcm: bcm2835: convert from " Brian Masney
@ 2025-07-03 23:22 ` Brian Masney
2025-07-09 12:55 ` Maxime Ripard
2025-07-03 23:22 ` [PATCH 03/10] clk: qcom: rpm: " Brian Masney
` (9 subsequent siblings)
11 siblings, 1 reply; 24+ messages in thread
From: Brian Masney @ 2025-07-03 23:22 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Florian Fainelli, Ray Jui,
Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi, Brian Masney
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
drivers/clk/qcom/gcc-ipq4019.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/clk/qcom/gcc-ipq4019.c b/drivers/clk/qcom/gcc-ipq4019.c
index d38628b5226898b6a556a1fe16806cb79c4735da..5ac44cfb53ce023c0668afdcb67de636f3319197 100644
--- a/drivers/clk/qcom/gcc-ipq4019.c
+++ b/drivers/clk/qcom/gcc-ipq4019.c
@@ -125,21 +125,23 @@ static const struct clk_fepll_vco gcc_fepll_vco = {
* It looks up the frequency table and returns the next higher frequency
* supported in hardware.
*/
-static long clk_cpu_div_round_rate(struct clk_hw *hw, unsigned long rate,
- unsigned long *p_rate)
+static int clk_cpu_div_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
{
struct clk_fepll *pll = to_clk_fepll(hw);
struct clk_hw *p_hw;
const struct freq_tbl *f;
- f = qcom_find_freq(pll->freq_tbl, rate);
+ f = qcom_find_freq(pll->freq_tbl, req->rate);
if (!f)
return -EINVAL;
p_hw = clk_hw_get_parent_by_index(hw, f->src);
- *p_rate = clk_hw_get_rate(p_hw);
+ req->best_parent_rate = clk_hw_get_rate(p_hw);
+
+ req->rate = f->freq;
- return f->freq;
+ return 0;
};
/*
@@ -205,7 +207,7 @@ clk_cpu_div_recalc_rate(struct clk_hw *hw,
};
static const struct clk_ops clk_regmap_cpu_div_ops = {
- .round_rate = clk_cpu_div_round_rate,
+ .determine_rate = clk_cpu_div_determine_rate,
.set_rate = clk_cpu_div_set_rate,
.recalc_rate = clk_cpu_div_recalc_rate,
};
--
2.50.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 03/10] clk: qcom: rpm: convert from round_rate() to determine_rate()
2025-07-03 23:22 [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney
2025-07-03 23:22 ` [PATCH 01/10] clk: bcm: bcm2835: convert from " Brian Masney
2025-07-03 23:22 ` [PATCH 02/10] clk: qcom: gcc-ipq4019: " Brian Masney
@ 2025-07-03 23:22 ` Brian Masney
2025-07-08 13:08 ` Konrad Dybcio
2025-07-03 23:22 ` [PATCH 04/10] clk: qcom: rpmh: " Brian Masney
` (8 subsequent siblings)
11 siblings, 1 reply; 24+ messages in thread
From: Brian Masney @ 2025-07-03 23:22 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Florian Fainelli, Ray Jui,
Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi, Brian Masney
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
drivers/clk/qcom/clk-rpm.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/qcom/clk-rpm.c b/drivers/clk/qcom/clk-rpm.c
index ccc112c21667ebf8522b06b37234f46c69b07698..be0145631197bea65438f3bed10344f18d6de802 100644
--- a/drivers/clk/qcom/clk-rpm.c
+++ b/drivers/clk/qcom/clk-rpm.c
@@ -351,15 +351,15 @@ static int clk_rpm_set_rate(struct clk_hw *hw,
return 0;
}
-static long clk_rpm_round_rate(struct clk_hw *hw, unsigned long rate,
- unsigned long *parent_rate)
+static int clk_rpm_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
{
/*
* RPM handles rate rounding and we don't have a way to
* know what the rate will be, so just return whatever
* rate is requested.
*/
- return rate;
+ return 0;
}
static unsigned long clk_rpm_recalc_rate(struct clk_hw *hw,
@@ -383,7 +383,7 @@ static const struct clk_ops clk_rpm_xo_ops = {
static const struct clk_ops clk_rpm_fixed_ops = {
.prepare = clk_rpm_fixed_prepare,
.unprepare = clk_rpm_fixed_unprepare,
- .round_rate = clk_rpm_round_rate,
+ .determine_rate = clk_rpm_determine_rate,
.recalc_rate = clk_rpm_recalc_rate,
};
@@ -391,7 +391,7 @@ static const struct clk_ops clk_rpm_ops = {
.prepare = clk_rpm_prepare,
.unprepare = clk_rpm_unprepare,
.set_rate = clk_rpm_set_rate,
- .round_rate = clk_rpm_round_rate,
+ .determine_rate = clk_rpm_determine_rate,
.recalc_rate = clk_rpm_recalc_rate,
};
--
2.50.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 04/10] clk: qcom: rpmh: convert from round_rate() to determine_rate()
2025-07-03 23:22 [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney
` (2 preceding siblings ...)
2025-07-03 23:22 ` [PATCH 03/10] clk: qcom: rpm: " Brian Masney
@ 2025-07-03 23:22 ` Brian Masney
2025-07-08 13:08 ` Konrad Dybcio
2025-07-03 23:22 ` [PATCH 05/10] clk: qcom: smd-rpm: " Brian Masney
` (7 subsequent siblings)
11 siblings, 1 reply; 24+ messages in thread
From: Brian Masney @ 2025-07-03 23:22 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Florian Fainelli, Ray Jui,
Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi, Brian Masney
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
drivers/clk/qcom/clk-rpmh.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c
index 00fb3e53a388ed24ed76622983eb5bd81a6b7002..74b052ac1ee10bdeeb59880019fb06ad58db3f74 100644
--- a/drivers/clk/qcom/clk-rpmh.c
+++ b/drivers/clk/qcom/clk-rpmh.c
@@ -321,10 +321,10 @@ static int clk_rpmh_bcm_set_rate(struct clk_hw *hw, unsigned long rate,
return 0;
}
-static long clk_rpmh_round_rate(struct clk_hw *hw, unsigned long rate,
- unsigned long *parent_rate)
+static int clk_rpmh_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
{
- return rate;
+ return 0;
}
static unsigned long clk_rpmh_bcm_recalc_rate(struct clk_hw *hw,
@@ -339,7 +339,7 @@ static const struct clk_ops clk_rpmh_bcm_ops = {
.prepare = clk_rpmh_bcm_prepare,
.unprepare = clk_rpmh_bcm_unprepare,
.set_rate = clk_rpmh_bcm_set_rate,
- .round_rate = clk_rpmh_round_rate,
+ .determine_rate = clk_rpmh_determine_rate,
.recalc_rate = clk_rpmh_bcm_recalc_rate,
};
--
2.50.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 05/10] clk: qcom: smd-rpm: convert from round_rate() to determine_rate()
2025-07-03 23:22 [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney
` (3 preceding siblings ...)
2025-07-03 23:22 ` [PATCH 04/10] clk: qcom: rpmh: " Brian Masney
@ 2025-07-03 23:22 ` Brian Masney
2025-07-08 13:08 ` Konrad Dybcio
2025-07-03 23:22 ` [PATCH 06/10] clk: qcom: spmi-pmic-div: " Brian Masney
` (6 subsequent siblings)
11 siblings, 1 reply; 24+ messages in thread
From: Brian Masney @ 2025-07-03 23:22 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Florian Fainelli, Ray Jui,
Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi, Brian Masney
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
drivers/clk/qcom/clk-smd-rpm.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c
index 3fbaa646286f284da12b902873b079863a2c0d77..3bf6df3884a542e7be572f2319990c2bfa7bc642 100644
--- a/drivers/clk/qcom/clk-smd-rpm.c
+++ b/drivers/clk/qcom/clk-smd-rpm.c
@@ -370,15 +370,15 @@ static int clk_smd_rpm_set_rate(struct clk_hw *hw, unsigned long rate,
return 0;
}
-static long clk_smd_rpm_round_rate(struct clk_hw *hw, unsigned long rate,
- unsigned long *parent_rate)
+static int clk_smd_rpm_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
{
/*
* RPM handles rate rounding and we don't have a way to
* know what the rate will be, so just return whatever
* rate is requested.
*/
- return rate;
+ return 0;
}
static unsigned long clk_smd_rpm_recalc_rate(struct clk_hw *hw,
@@ -427,7 +427,7 @@ static const struct clk_ops clk_smd_rpm_ops = {
.prepare = clk_smd_rpm_prepare,
.unprepare = clk_smd_rpm_unprepare,
.set_rate = clk_smd_rpm_set_rate,
- .round_rate = clk_smd_rpm_round_rate,
+ .determine_rate = clk_smd_rpm_determine_rate,
.recalc_rate = clk_smd_rpm_recalc_rate,
};
--
2.50.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 06/10] clk: qcom: spmi-pmic-div: convert from round_rate() to determine_rate()
2025-07-03 23:22 [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney
` (4 preceding siblings ...)
2025-07-03 23:22 ` [PATCH 05/10] clk: qcom: smd-rpm: " Brian Masney
@ 2025-07-03 23:22 ` Brian Masney
2025-07-08 13:09 ` Konrad Dybcio
2025-07-03 23:22 ` [PATCH 07/10] clk: sunxi-ng: ccu_gate: " Brian Masney
` (5 subsequent siblings)
11 siblings, 1 reply; 24+ messages in thread
From: Brian Masney @ 2025-07-03 23:22 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Florian Fainelli, Ray Jui,
Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi, Brian Masney
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
drivers/clk/qcom/clk-spmi-pmic-div.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/qcom/clk-spmi-pmic-div.c b/drivers/clk/qcom/clk-spmi-pmic-div.c
index 41a0a4f3b4fb316827365a522079dcd99630c49f..3e2ac6745325a1e0a30a4587d27f14d93011a225 100644
--- a/drivers/clk/qcom/clk-spmi-pmic-div.c
+++ b/drivers/clk/qcom/clk-spmi-pmic-div.c
@@ -112,16 +112,18 @@ static void clk_spmi_pmic_div_disable(struct clk_hw *hw)
spin_unlock_irqrestore(&clkdiv->lock, flags);
}
-static long clk_spmi_pmic_div_round_rate(struct clk_hw *hw, unsigned long rate,
- unsigned long *parent_rate)
+static int clk_spmi_pmic_div_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
{
unsigned int div, div_factor;
- div = DIV_ROUND_UP(*parent_rate, rate);
+ div = DIV_ROUND_UP(req->best_parent_rate, req->rate);
div_factor = div_to_div_factor(div);
div = div_factor_to_div(div_factor);
- return *parent_rate / div;
+ req->rate = req->best_parent_rate / div;
+
+ return 0;
}
static unsigned long
@@ -169,7 +171,7 @@ static const struct clk_ops clk_spmi_pmic_div_ops = {
.disable = clk_spmi_pmic_div_disable,
.set_rate = clk_spmi_pmic_div_set_rate,
.recalc_rate = clk_spmi_pmic_div_recalc_rate,
- .round_rate = clk_spmi_pmic_div_round_rate,
+ .determine_rate = clk_spmi_pmic_div_determine_rate,
};
struct spmi_pmic_div_clk_cc {
--
2.50.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 07/10] clk: sunxi-ng: ccu_gate: convert from round_rate() to determine_rate()
2025-07-03 23:22 [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney
` (5 preceding siblings ...)
2025-07-03 23:22 ` [PATCH 06/10] clk: qcom: spmi-pmic-div: " Brian Masney
@ 2025-07-03 23:22 ` Brian Masney
2025-07-09 12:55 ` Maxime Ripard
2025-07-03 23:22 ` [PATCH 08/10] clk: sunxi-ng: ccu_nk: " Brian Masney
` (4 subsequent siblings)
11 siblings, 1 reply; 24+ messages in thread
From: Brian Masney @ 2025-07-03 23:22 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Florian Fainelli, Ray Jui,
Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi, Brian Masney
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
drivers/clk/sunxi-ng/ccu_gate.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/clk/sunxi-ng/ccu_gate.c b/drivers/clk/sunxi-ng/ccu_gate.c
index 474a9e8831f87ffcec7712c14ecb55b8523f05a6..30673fe4e3c2cd2c86f94a21929b144ba4cf01fe 100644
--- a/drivers/clk/sunxi-ng/ccu_gate.c
+++ b/drivers/clk/sunxi-ng/ccu_gate.c
@@ -91,8 +91,8 @@ static unsigned long ccu_gate_recalc_rate(struct clk_hw *hw,
return rate;
}
-static long ccu_gate_round_rate(struct clk_hw *hw, unsigned long rate,
- unsigned long *prate)
+static int ccu_gate_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
{
struct ccu_gate *cg = hw_to_ccu_gate(hw);
int div = 1;
@@ -101,14 +101,16 @@ static long ccu_gate_round_rate(struct clk_hw *hw, unsigned long rate,
div = cg->common.prediv;
if (clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) {
- unsigned long best_parent = rate;
+ unsigned long best_parent = req->rate;
if (cg->common.features & CCU_FEATURE_ALL_PREDIV)
best_parent *= div;
- *prate = clk_hw_round_rate(clk_hw_get_parent(hw), best_parent);
+ req->best_parent_rate = clk_hw_round_rate(clk_hw_get_parent(hw), best_parent);
}
- return *prate / div;
+ req->rate = req->best_parent_rate / div;
+
+ return 0;
}
static int ccu_gate_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -127,7 +129,7 @@ const struct clk_ops ccu_gate_ops = {
.disable = ccu_gate_disable,
.enable = ccu_gate_enable,
.is_enabled = ccu_gate_is_enabled,
- .round_rate = ccu_gate_round_rate,
+ .determine_rate = ccu_gate_determine_rate,
.set_rate = ccu_gate_set_rate,
.recalc_rate = ccu_gate_recalc_rate,
};
--
2.50.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 08/10] clk: sunxi-ng: ccu_nk: convert from round_rate() to determine_rate()
2025-07-03 23:22 [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney
` (6 preceding siblings ...)
2025-07-03 23:22 ` [PATCH 07/10] clk: sunxi-ng: ccu_gate: " Brian Masney
@ 2025-07-03 23:22 ` Brian Masney
2025-07-09 12:57 ` Maxime Ripard
2025-07-03 23:22 ` [PATCH 09/10] clk: sunxi-ng: ccu_nkmp: " Brian Masney
` (3 subsequent siblings)
11 siblings, 1 reply; 24+ messages in thread
From: Brian Masney @ 2025-07-03 23:22 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Florian Fainelli, Ray Jui,
Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi, Brian Masney
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
drivers/clk/sunxi-ng/ccu_nk.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/clk/sunxi-ng/ccu_nk.c b/drivers/clk/sunxi-ng/ccu_nk.c
index 555e99de2cc6ee0c84ccaaac9ee83be2d88741a0..5db748fbb5bd9399a2d551c8821a4bb17ded005a 100644
--- a/drivers/clk/sunxi-ng/ccu_nk.c
+++ b/drivers/clk/sunxi-ng/ccu_nk.c
@@ -92,26 +92,26 @@ static unsigned long ccu_nk_recalc_rate(struct clk_hw *hw,
return rate;
}
-static long ccu_nk_round_rate(struct clk_hw *hw, unsigned long rate,
- unsigned long *parent_rate)
+static int ccu_nk_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
{
struct ccu_nk *nk = hw_to_ccu_nk(hw);
struct _ccu_nk _nk;
if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV)
- rate *= nk->fixed_post_div;
+ req->rate *= nk->fixed_post_div;
_nk.min_n = nk->n.min ?: 1;
_nk.max_n = nk->n.max ?: 1 << nk->n.width;
_nk.min_k = nk->k.min ?: 1;
_nk.max_k = nk->k.max ?: 1 << nk->k.width;
- rate = ccu_nk_find_best(*parent_rate, rate, &_nk);
+ req->rate = ccu_nk_find_best(req->best_parent_rate, req->rate, &_nk);
if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV)
- rate = rate / nk->fixed_post_div;
+ req->rate = req->rate / nk->fixed_post_div;
- return rate;
+ return 0;
}
static int ccu_nk_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -155,7 +155,7 @@ const struct clk_ops ccu_nk_ops = {
.is_enabled = ccu_nk_is_enabled,
.recalc_rate = ccu_nk_recalc_rate,
- .round_rate = ccu_nk_round_rate,
+ .determine_rate = ccu_nk_determine_rate,
.set_rate = ccu_nk_set_rate,
};
EXPORT_SYMBOL_NS_GPL(ccu_nk_ops, "SUNXI_CCU");
--
2.50.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 09/10] clk: sunxi-ng: ccu_nkmp: convert from round_rate() to determine_rate()
2025-07-03 23:22 [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney
` (7 preceding siblings ...)
2025-07-03 23:22 ` [PATCH 08/10] clk: sunxi-ng: ccu_nk: " Brian Masney
@ 2025-07-03 23:22 ` Brian Masney
2025-07-09 12:59 ` Maxime Ripard
2025-07-03 23:22 ` [PATCH 10/10] clk: sunxi-ng: ccu_nm: " Brian Masney
` (2 subsequent siblings)
11 siblings, 1 reply; 24+ messages in thread
From: Brian Masney @ 2025-07-03 23:22 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Florian Fainelli, Ray Jui,
Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi, Brian Masney
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
drivers/clk/sunxi-ng/ccu_nkmp.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/drivers/clk/sunxi-ng/ccu_nkmp.c b/drivers/clk/sunxi-ng/ccu_nkmp.c
index 6e03b69d402848b237154319d2296ffb4133a213..25efb5b3760759f2943737856246ce93000ebf05 100644
--- a/drivers/clk/sunxi-ng/ccu_nkmp.c
+++ b/drivers/clk/sunxi-ng/ccu_nkmp.c
@@ -127,20 +127,20 @@ static unsigned long ccu_nkmp_recalc_rate(struct clk_hw *hw,
return rate;
}
-static long ccu_nkmp_round_rate(struct clk_hw *hw, unsigned long rate,
- unsigned long *parent_rate)
+static int ccu_nkmp_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
{
struct ccu_nkmp *nkmp = hw_to_ccu_nkmp(hw);
struct _ccu_nkmp _nkmp;
if (nkmp->common.features & CCU_FEATURE_FIXED_POSTDIV)
- rate *= nkmp->fixed_post_div;
+ req->rate *= nkmp->fixed_post_div;
- if (nkmp->max_rate && rate > nkmp->max_rate) {
- rate = nkmp->max_rate;
+ if (nkmp->max_rate && req->rate > nkmp->max_rate) {
+ req->rate = nkmp->max_rate;
if (nkmp->common.features & CCU_FEATURE_FIXED_POSTDIV)
- rate /= nkmp->fixed_post_div;
- return rate;
+ req->rate /= nkmp->fixed_post_div;
+ return 0;
}
_nkmp.min_n = nkmp->n.min ?: 1;
@@ -152,12 +152,13 @@ static long ccu_nkmp_round_rate(struct clk_hw *hw, unsigned long rate,
_nkmp.min_p = 1;
_nkmp.max_p = nkmp->p.max ?: 1 << ((1 << nkmp->p.width) - 1);
- rate = ccu_nkmp_find_best(*parent_rate, rate, &_nkmp);
+ req->rate = ccu_nkmp_find_best(req->best_parent_rate, req->rate,
+ &_nkmp);
if (nkmp->common.features & CCU_FEATURE_FIXED_POSTDIV)
- rate = rate / nkmp->fixed_post_div;
+ req->rate = req->rate / nkmp->fixed_post_div;
- return rate;
+ return 0;
}
static int ccu_nkmp_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -227,7 +228,7 @@ const struct clk_ops ccu_nkmp_ops = {
.is_enabled = ccu_nkmp_is_enabled,
.recalc_rate = ccu_nkmp_recalc_rate,
- .round_rate = ccu_nkmp_round_rate,
+ .determine_rate = ccu_nkmp_determine_rate,
.set_rate = ccu_nkmp_set_rate,
};
EXPORT_SYMBOL_NS_GPL(ccu_nkmp_ops, "SUNXI_CCU");
--
2.50.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH 10/10] clk: sunxi-ng: ccu_nm: convert from round_rate() to determine_rate()
2025-07-03 23:22 [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney
` (8 preceding siblings ...)
2025-07-03 23:22 ` [PATCH 09/10] clk: sunxi-ng: ccu_nkmp: " Brian Masney
@ 2025-07-03 23:22 ` Brian Masney
2025-07-09 13:00 ` Maxime Ripard
2025-07-14 7:21 ` (subset) [PATCH 00/10] clk: convert drivers from deprecated " Chen-Yu Tsai
2025-07-17 4:30 ` Bjorn Andersson
11 siblings, 1 reply; 24+ messages in thread
From: Brian Masney @ 2025-07-03 23:22 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Florian Fainelli, Ray Jui,
Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi, Brian Masney
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.
I manually fixed up one minor formatting issue that occurred after
applying the semantic patch:
req->rate = ccu_nm_find_best(&nm->common, req->best_parent_rate,
req->rate,
&_nm);
I manually changed it to:
req->rate = ccu_nm_find_best(&nm->common, req->best_parent_rate,
req->rate, &_nm);
Signed-off-by: Brian Masney <bmasney@redhat.com>
---
drivers/clk/sunxi-ng/ccu_nm.c | 43 ++++++++++++++++++++++---------------------
1 file changed, 22 insertions(+), 21 deletions(-)
diff --git a/drivers/clk/sunxi-ng/ccu_nm.c b/drivers/clk/sunxi-ng/ccu_nm.c
index a4e2243b8d6b4a8fdd9ea1ff2ca06e2f1a009632..df01ed3b37a6b56e93e18cc4c1ad5909e2ba0c5b 100644
--- a/drivers/clk/sunxi-ng/ccu_nm.c
+++ b/drivers/clk/sunxi-ng/ccu_nm.c
@@ -116,39 +116,39 @@ static unsigned long ccu_nm_recalc_rate(struct clk_hw *hw,
return rate;
}
-static long ccu_nm_round_rate(struct clk_hw *hw, unsigned long rate,
- unsigned long *parent_rate)
+static int ccu_nm_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
{
struct ccu_nm *nm = hw_to_ccu_nm(hw);
struct _ccu_nm _nm;
if (nm->common.features & CCU_FEATURE_FIXED_POSTDIV)
- rate *= nm->fixed_post_div;
+ req->rate *= nm->fixed_post_div;
- if (rate < nm->min_rate) {
- rate = nm->min_rate;
+ if (req->rate < nm->min_rate) {
+ req->rate = nm->min_rate;
if (nm->common.features & CCU_FEATURE_FIXED_POSTDIV)
- rate /= nm->fixed_post_div;
- return rate;
+ req->rate /= nm->fixed_post_div;
+ return 0;
}
- if (nm->max_rate && rate > nm->max_rate) {
- rate = nm->max_rate;
+ if (nm->max_rate && req->rate > nm->max_rate) {
+ req->rate = nm->max_rate;
if (nm->common.features & CCU_FEATURE_FIXED_POSTDIV)
- rate /= nm->fixed_post_div;
- return rate;
+ req->rate /= nm->fixed_post_div;
+ return 0;
}
- if (ccu_frac_helper_has_rate(&nm->common, &nm->frac, rate)) {
+ if (ccu_frac_helper_has_rate(&nm->common, &nm->frac, req->rate)) {
if (nm->common.features & CCU_FEATURE_FIXED_POSTDIV)
- rate /= nm->fixed_post_div;
- return rate;
+ req->rate /= nm->fixed_post_div;
+ return 0;
}
- if (ccu_sdm_helper_has_rate(&nm->common, &nm->sdm, rate)) {
+ if (ccu_sdm_helper_has_rate(&nm->common, &nm->sdm, req->rate)) {
if (nm->common.features & CCU_FEATURE_FIXED_POSTDIV)
- rate /= nm->fixed_post_div;
- return rate;
+ req->rate /= nm->fixed_post_div;
+ return 0;
}
_nm.min_n = nm->n.min ?: 1;
@@ -156,12 +156,13 @@ static long ccu_nm_round_rate(struct clk_hw *hw, unsigned long rate,
_nm.min_m = 1;
_nm.max_m = nm->m.max ?: 1 << nm->m.width;
- rate = ccu_nm_find_best(&nm->common, *parent_rate, rate, &_nm);
+ req->rate = ccu_nm_find_best(&nm->common, req->best_parent_rate,
+ req->rate, &_nm);
if (nm->common.features & CCU_FEATURE_FIXED_POSTDIV)
- rate /= nm->fixed_post_div;
+ req->rate /= nm->fixed_post_div;
- return rate;
+ return 0;
}
static int ccu_nm_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -233,7 +234,7 @@ const struct clk_ops ccu_nm_ops = {
.is_enabled = ccu_nm_is_enabled,
.recalc_rate = ccu_nm_recalc_rate,
- .round_rate = ccu_nm_round_rate,
+ .determine_rate = ccu_nm_determine_rate,
.set_rate = ccu_nm_set_rate,
};
EXPORT_SYMBOL_NS_GPL(ccu_nm_ops, "SUNXI_CCU");
--
2.50.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH 03/10] clk: qcom: rpm: convert from round_rate() to determine_rate()
2025-07-03 23:22 ` [PATCH 03/10] clk: qcom: rpm: " Brian Masney
@ 2025-07-08 13:08 ` Konrad Dybcio
0 siblings, 0 replies; 24+ messages in thread
From: Konrad Dybcio @ 2025-07-08 13:08 UTC (permalink / raw)
To: Brian Masney, Michael Turquette, Stephen Boyd, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi
On 7/4/25 1:22 AM, Brian Masney wrote:
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 04/10] clk: qcom: rpmh: convert from round_rate() to determine_rate()
2025-07-03 23:22 ` [PATCH 04/10] clk: qcom: rpmh: " Brian Masney
@ 2025-07-08 13:08 ` Konrad Dybcio
0 siblings, 0 replies; 24+ messages in thread
From: Konrad Dybcio @ 2025-07-08 13:08 UTC (permalink / raw)
To: Brian Masney, Michael Turquette, Stephen Boyd, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi
On 7/4/25 1:22 AM, Brian Masney wrote:
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 05/10] clk: qcom: smd-rpm: convert from round_rate() to determine_rate()
2025-07-03 23:22 ` [PATCH 05/10] clk: qcom: smd-rpm: " Brian Masney
@ 2025-07-08 13:08 ` Konrad Dybcio
0 siblings, 0 replies; 24+ messages in thread
From: Konrad Dybcio @ 2025-07-08 13:08 UTC (permalink / raw)
To: Brian Masney, Michael Turquette, Stephen Boyd, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi
On 7/4/25 1:22 AM, Brian Masney wrote:
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 06/10] clk: qcom: spmi-pmic-div: convert from round_rate() to determine_rate()
2025-07-03 23:22 ` [PATCH 06/10] clk: qcom: spmi-pmic-div: " Brian Masney
@ 2025-07-08 13:09 ` Konrad Dybcio
0 siblings, 0 replies; 24+ messages in thread
From: Konrad Dybcio @ 2025-07-08 13:09 UTC (permalink / raw)
To: Brian Masney, Michael Turquette, Stephen Boyd, Florian Fainelli,
Ray Jui, Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi
On 7/4/25 1:22 AM, Brian Masney wrote:
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 01/10] clk: bcm: bcm2835: convert from round_rate() to determine_rate()
2025-07-03 23:22 ` [PATCH 01/10] clk: bcm: bcm2835: convert from " Brian Masney
@ 2025-07-09 0:06 ` Florian Fainelli
2025-07-24 21:32 ` Stephen Boyd
1 sibling, 0 replies; 24+ messages in thread
From: Florian Fainelli @ 2025-07-09 0:06 UTC (permalink / raw)
To: Brian Masney, Michael Turquette, Stephen Boyd, Ray Jui,
Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Maxime Ripard
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi
On 7/3/2025 4:22 PM, 'Brian Masney' via BCM-KERNEL-FEEDBACK-LIST,PDL wrote:
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 02/10] clk: qcom: gcc-ipq4019: convert from round_rate() to determine_rate()
2025-07-03 23:22 ` [PATCH 02/10] clk: qcom: gcc-ipq4019: " Brian Masney
@ 2025-07-09 12:55 ` Maxime Ripard
0 siblings, 0 replies; 24+ messages in thread
From: Maxime Ripard @ 2025-07-09 12:55 UTC (permalink / raw)
To: Brian Masney
Cc: linux-arm-kernel, linux-arm-msm, linux-clk, linux-kernel,
linux-rpi-kernel, linux-sunxi, Bjorn Andersson,
Broadcom internal kernel review list, Chen-Yu Tsai,
Florian Fainelli, Jernej Skrabec, Maxime Ripard, Maxime Ripard,
Michael Turquette, Ray Jui, Samuel Holland, Scott Branden,
Stephen Boyd
On Thu, 3 Jul 2025 19:22:26 -0400, Brian Masney wrote:
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
>
> [ ... ]
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Thanks!
Maxime
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 07/10] clk: sunxi-ng: ccu_gate: convert from round_rate() to determine_rate()
2025-07-03 23:22 ` [PATCH 07/10] clk: sunxi-ng: ccu_gate: " Brian Masney
@ 2025-07-09 12:55 ` Maxime Ripard
0 siblings, 0 replies; 24+ messages in thread
From: Maxime Ripard @ 2025-07-09 12:55 UTC (permalink / raw)
To: Brian Masney
Cc: linux-arm-kernel, linux-arm-msm, linux-clk, linux-kernel,
linux-rpi-kernel, linux-sunxi, Bjorn Andersson,
Broadcom internal kernel review list, Chen-Yu Tsai,
Florian Fainelli, Jernej Skrabec, Maxime Ripard, Maxime Ripard,
Michael Turquette, Ray Jui, Samuel Holland, Scott Branden,
Stephen Boyd
On Thu, 3 Jul 2025 19:22:31 -0400, Brian Masney wrote:
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
>
> [ ... ]
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Thanks!
Maxime
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 08/10] clk: sunxi-ng: ccu_nk: convert from round_rate() to determine_rate()
2025-07-03 23:22 ` [PATCH 08/10] clk: sunxi-ng: ccu_nk: " Brian Masney
@ 2025-07-09 12:57 ` Maxime Ripard
0 siblings, 0 replies; 24+ messages in thread
From: Maxime Ripard @ 2025-07-09 12:57 UTC (permalink / raw)
To: Brian Masney
Cc: linux-arm-kernel, linux-arm-msm, linux-clk, linux-kernel,
linux-rpi-kernel, linux-sunxi, Bjorn Andersson,
Broadcom internal kernel review list, Chen-Yu Tsai,
Florian Fainelli, Jernej Skrabec, Maxime Ripard, Maxime Ripard,
Michael Turquette, Ray Jui, Samuel Holland, Scott Branden,
Stephen Boyd
On Thu, 3 Jul 2025 19:22:32 -0400, Brian Masney wrote:
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
>
> [ ... ]
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Thanks!
Maxime
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 09/10] clk: sunxi-ng: ccu_nkmp: convert from round_rate() to determine_rate()
2025-07-03 23:22 ` [PATCH 09/10] clk: sunxi-ng: ccu_nkmp: " Brian Masney
@ 2025-07-09 12:59 ` Maxime Ripard
0 siblings, 0 replies; 24+ messages in thread
From: Maxime Ripard @ 2025-07-09 12:59 UTC (permalink / raw)
To: Brian Masney
Cc: linux-arm-kernel, linux-arm-msm, linux-clk, linux-kernel,
linux-rpi-kernel, linux-sunxi, Bjorn Andersson,
Broadcom internal kernel review list, Chen-Yu Tsai,
Florian Fainelli, Jernej Skrabec, Maxime Ripard, Maxime Ripard,
Michael Turquette, Ray Jui, Samuel Holland, Scott Branden,
Stephen Boyd
On Thu, 3 Jul 2025 19:22:33 -0400, Brian Masney wrote:
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
>
> [ ... ]
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Thanks!
Maxime
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 10/10] clk: sunxi-ng: ccu_nm: convert from round_rate() to determine_rate()
2025-07-03 23:22 ` [PATCH 10/10] clk: sunxi-ng: ccu_nm: " Brian Masney
@ 2025-07-09 13:00 ` Maxime Ripard
0 siblings, 0 replies; 24+ messages in thread
From: Maxime Ripard @ 2025-07-09 13:00 UTC (permalink / raw)
To: Brian Masney
Cc: linux-arm-kernel, linux-arm-msm, linux-clk, linux-kernel,
linux-rpi-kernel, linux-sunxi, Bjorn Andersson,
Broadcom internal kernel review list, Chen-Yu Tsai,
Florian Fainelli, Jernej Skrabec, Maxime Ripard, Maxime Ripard,
Michael Turquette, Ray Jui, Samuel Holland, Scott Branden,
Stephen Boyd
On Thu, 3 Jul 2025 19:22:34 -0400, Brian Masney wrote:
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> I manually fixed up one minor formatting issue that occurred after
>
> [ ... ]
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Thanks!
Maxime
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: (subset) [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate()
2025-07-03 23:22 [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney
` (9 preceding siblings ...)
2025-07-03 23:22 ` [PATCH 10/10] clk: sunxi-ng: ccu_nm: " Brian Masney
@ 2025-07-14 7:21 ` Chen-Yu Tsai
2025-07-17 4:30 ` Bjorn Andersson
11 siblings, 0 replies; 24+ messages in thread
From: Chen-Yu Tsai @ 2025-07-14 7:21 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Florian Fainelli, Ray Jui,
Scott Branden, Broadcom internal kernel review list,
Bjorn Andersson, Jernej Skrabec, Samuel Holland, Maxime Ripard,
Brian Masney
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi
On Thu, 03 Jul 2025 19:22:24 -0400, Brian Masney wrote:
> The round_rate() clk ops is deprecated in the clk framework in favor
> of the determine_rate() ops, so let's go ahead and convert some of the
> outstanding bcm, qcom, and sunxi drivers that have a round_rate()
> implementation over to determine_rate() using the Coccinelle semantic
> patch posted below.
>
> This Coccinelle semantic patch is able to automatically convert ~95% of
> the clk drivers, and I can clean up the remaining ones by hand. I'll
> initially post some small changes to get feedback about the approach,
> and I can post some larger series by submaintainer once we get
> agreement that the approach looks good.
>
> [...]
Applied to sunxi/clk-for-6.17 in local tree, thanks!
[07/10] clk: sunxi-ng: ccu_gate: convert from round_rate() to determine_rate()
commit: ee9c15ca0f628435334afef74d2ff03112d80bf0
[08/10] clk: sunxi-ng: ccu_nk: convert from round_rate() to determine_rate()
commit: 2b0d4f1b3f8524b413208d47099c445eaf7c18f5
[09/10] clk: sunxi-ng: ccu_nkmp: convert from round_rate() to determine_rate()
commit: 8bc614c6ac3c97cef385aebc6520ddcfa0fca8f7
[10/10] clk: sunxi-ng: ccu_nm: convert from round_rate() to determine_rate()
commit: 80395c3b47577c12121d4e408e7b9478f7f88d02
Best regards,
--
Chen-Yu Tsai <wens@csie.org>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: (subset) [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate()
2025-07-03 23:22 [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney
` (10 preceding siblings ...)
2025-07-14 7:21 ` (subset) [PATCH 00/10] clk: convert drivers from deprecated " Chen-Yu Tsai
@ 2025-07-17 4:30 ` Bjorn Andersson
11 siblings, 0 replies; 24+ messages in thread
From: Bjorn Andersson @ 2025-07-17 4:30 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Florian Fainelli, Ray Jui,
Scott Branden, Broadcom internal kernel review list, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland, Maxime Ripard, Brian Masney
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi
On Thu, 03 Jul 2025 19:22:24 -0400, Brian Masney wrote:
> The round_rate() clk ops is deprecated in the clk framework in favor
> of the determine_rate() ops, so let's go ahead and convert some of the
> outstanding bcm, qcom, and sunxi drivers that have a round_rate()
> implementation over to determine_rate() using the Coccinelle semantic
> patch posted below.
>
> This Coccinelle semantic patch is able to automatically convert ~95% of
> the clk drivers, and I can clean up the remaining ones by hand. I'll
> initially post some small changes to get feedback about the approach,
> and I can post some larger series by submaintainer once we get
> agreement that the approach looks good.
>
> [...]
Applied, thanks!
[02/10] clk: qcom: gcc-ipq4019: convert from round_rate() to determine_rate()
commit: 3ebefed3d3afbda632b5647a06598e1bad1baeb6
[03/10] clk: qcom: rpm: convert from round_rate() to determine_rate()
commit: 120c4b7a35a2e2414fc3e35b34526b60ac54515d
[04/10] clk: qcom: rpmh: convert from round_rate() to determine_rate()
commit: 2c0dce7392fdc0fcca1f133114c7c4295ac69233
[05/10] clk: qcom: smd-rpm: convert from round_rate() to determine_rate()
commit: 11add2107c04bdcfb499cdb96ab156a4646ec9e1
[06/10] clk: qcom: spmi-pmic-div: convert from round_rate() to determine_rate()
commit: ebec04773bf313280fe1cd9c0877c73660e69a10
Best regards,
--
Bjorn Andersson <andersson@kernel.org>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 01/10] clk: bcm: bcm2835: convert from round_rate() to determine_rate()
2025-07-03 23:22 ` [PATCH 01/10] clk: bcm: bcm2835: convert from " Brian Masney
2025-07-09 0:06 ` Florian Fainelli
@ 2025-07-24 21:32 ` Stephen Boyd
1 sibling, 0 replies; 24+ messages in thread
From: Stephen Boyd @ 2025-07-24 21:32 UTC (permalink / raw)
To: Bjorn Andersson, Brian Masney,
Broadcom internal kernel review list, Chen-Yu Tsai,
Florian Fainelli, Jernej Skrabec, Maxime Ripard,
Michael Turquette, Ray Jui, Samuel Holland, Scott Branden
Cc: linux-clk, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, linux-sunxi, Brian Masney
Quoting Brian Masney (2025-07-03 16:22:25)
> The round_rate() clk ops is deprecated, so migrate this driver from
> round_rate() to determine_rate() using the Coccinelle semantic patch
> on the cover letter of this series.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2025-07-24 21:35 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-03 23:22 [PATCH 00/10] clk: convert drivers from deprecated round_rate() to determine_rate() Brian Masney
2025-07-03 23:22 ` [PATCH 01/10] clk: bcm: bcm2835: convert from " Brian Masney
2025-07-09 0:06 ` Florian Fainelli
2025-07-24 21:32 ` Stephen Boyd
2025-07-03 23:22 ` [PATCH 02/10] clk: qcom: gcc-ipq4019: " Brian Masney
2025-07-09 12:55 ` Maxime Ripard
2025-07-03 23:22 ` [PATCH 03/10] clk: qcom: rpm: " Brian Masney
2025-07-08 13:08 ` Konrad Dybcio
2025-07-03 23:22 ` [PATCH 04/10] clk: qcom: rpmh: " Brian Masney
2025-07-08 13:08 ` Konrad Dybcio
2025-07-03 23:22 ` [PATCH 05/10] clk: qcom: smd-rpm: " Brian Masney
2025-07-08 13:08 ` Konrad Dybcio
2025-07-03 23:22 ` [PATCH 06/10] clk: qcom: spmi-pmic-div: " Brian Masney
2025-07-08 13:09 ` Konrad Dybcio
2025-07-03 23:22 ` [PATCH 07/10] clk: sunxi-ng: ccu_gate: " Brian Masney
2025-07-09 12:55 ` Maxime Ripard
2025-07-03 23:22 ` [PATCH 08/10] clk: sunxi-ng: ccu_nk: " Brian Masney
2025-07-09 12:57 ` Maxime Ripard
2025-07-03 23:22 ` [PATCH 09/10] clk: sunxi-ng: ccu_nkmp: " Brian Masney
2025-07-09 12:59 ` Maxime Ripard
2025-07-03 23:22 ` [PATCH 10/10] clk: sunxi-ng: ccu_nm: " Brian Masney
2025-07-09 13:00 ` Maxime Ripard
2025-07-14 7:21 ` (subset) [PATCH 00/10] clk: convert drivers from deprecated " Chen-Yu Tsai
2025-07-17 4:30 ` Bjorn Andersson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).