* [PATCH 0/2] clk: spacemit: refactor common ccu driver
@ 2025-12-20 1:11 Yixun Lan
2025-12-20 1:11 ` [PATCH 1/2] clk: spacemit: extract common ccu functions Yixun Lan
2025-12-20 1:11 ` [PATCH 2/2] reset: spacemit: fix auxiliary device id Yixun Lan
0 siblings, 2 replies; 9+ messages in thread
From: Yixun Lan @ 2025-12-20 1:11 UTC (permalink / raw)
To: Stephen Boyd, Michael Turquette, Philipp Zabel
Cc: Alex Elder, Guodong Xu, Inochi Amaoto, linux-kernel, linux-clk,
linux-riscv, spacemit, Yixun Lan, Yao Zi
The goal here is to refactor the clock driver to extract common part, and
reuse it, so in the future, we can maximize the source code usage once
adding new clock driver (specifically, for the SpacemiT K3 SoC here)
Since reset driver register via auxiliary bus which requires a adjustment
of the auxiliary device id accordingly.
This patch will depend on Kconfig fix for building modules [1], and the idea
come from K3 clock's review[2]
Link: https://lore.kernel.org/all/20251219012819.440972-1-inochiama@gmail.com/ [1]
Link: https://lore.kernel.org/all/aTo8sCPpVM1o9PKX@pie [2]
Signed-off-by: Yixun Lan <dlan@gentoo.org>
---
Yixun Lan (2):
clk: spacemit: extract common ccu functions
reset: spacemit: fix auxiliary device id
drivers/clk/spacemit/ccu-k1.c | 176 +-------------------------------------
drivers/clk/spacemit/ccu_common.c | 171 ++++++++++++++++++++++++++++++++++++
drivers/clk/spacemit/ccu_common.h | 10 +++
drivers/reset/reset-spacemit.c | 2 +-
include/soc/spacemit/ccu.h | 21 +++++
include/soc/spacemit/k1-syscon.h | 12 +--
6 files changed, 205 insertions(+), 187 deletions(-)
---
base-commit: fb964a99ad6848a9022c6909365aad23e177387c
change-id: 20251217-06-k1-clk-common-8d1c57995047
prerequisite-message-id: 20251219012819.440972-1-inochiama@gmail.com
prerequisite-patch-id: df430730ed961011cee5c5d47b7ace84b3c5ebb7
prerequisite-patch-id: 64003618c33be925602e46b7543f2c13d3f36474
Best regards,
--
Yixun Lan
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 1/2] clk: spacemit: extract common ccu functions 2025-12-20 1:11 [PATCH 0/2] clk: spacemit: refactor common ccu driver Yixun Lan @ 2025-12-20 1:11 ` Yixun Lan 2025-12-20 1:11 ` [PATCH 2/2] reset: spacemit: fix auxiliary device id Yixun Lan 1 sibling, 0 replies; 9+ messages in thread From: Yixun Lan @ 2025-12-20 1:11 UTC (permalink / raw) To: Stephen Boyd, Michael Turquette, Philipp Zabel Cc: Alex Elder, Guodong Xu, Inochi Amaoto, linux-kernel, linux-clk, linux-riscv, spacemit, Yixun Lan, Yao Zi Refactor the probe function of SpacemiT's clock, and extract a common ccu file, so new clock driver added in the future can share the same code, which would lower the burden of maintenance. Since this commit changes the module name where the auxiliary device registered, the auxiliary device id need to be adjusted. Idea of the patch is come from review of K3 clock driver, please refer this disucssion [1]. Link: https://lore.kernel.org/all/aTo8sCPpVM1o9PKX@pie/ [1] Suggested-by: Yao Zi <me@ziyao.cc> Signed-off-by: Yixun Lan <dlan@gentoo.org> --- drivers/clk/spacemit/ccu-k1.c | 176 +------------------------------------- drivers/clk/spacemit/ccu_common.c | 171 ++++++++++++++++++++++++++++++++++++ drivers/clk/spacemit/ccu_common.h | 10 +++ include/soc/spacemit/ccu.h | 21 +++++ include/soc/spacemit/k1-syscon.h | 12 +-- 5 files changed, 204 insertions(+), 186 deletions(-) diff --git a/drivers/clk/spacemit/ccu-k1.c b/drivers/clk/spacemit/ccu-k1.c index 01d9485b615d..8627a0c292e9 100644 --- a/drivers/clk/spacemit/ccu-k1.c +++ b/drivers/clk/spacemit/ccu-k1.c @@ -5,15 +5,10 @@ */ #include <linux/array_size.h> -#include <linux/auxiliary_bus.h> #include <linux/clk-provider.h> -#include <linux/delay.h> -#include <linux/idr.h> -#include <linux/mfd/syscon.h> #include <linux/minmax.h> #include <linux/module.h> #include <linux/platform_device.h> -#include <linux/slab.h> #include <soc/spacemit/k1-syscon.h> #include "ccu_common.h" @@ -23,14 +18,6 @@ #include <dt-bindings/clock/spacemit,k1-syscon.h> -struct spacemit_ccu_data { - const char *reset_name; - struct clk_hw **hws; - size_t num; -}; - -static DEFINE_IDA(auxiliary_ids); - /* APBS clocks start, APBS region contains and only contains all PLL clocks */ /* @@ -1001,167 +988,6 @@ static const struct spacemit_ccu_data k1_ccu_apbc2_data = { .reset_name = "apbc2-reset", }; -static int spacemit_ccu_register(struct device *dev, - struct regmap *regmap, - struct regmap *lock_regmap, - const struct spacemit_ccu_data *data) -{ - struct clk_hw_onecell_data *clk_data; - int i, ret; - - /* Nothing to do if the CCU does not implement any clocks */ - if (!data->hws) - return 0; - - clk_data = devm_kzalloc(dev, struct_size(clk_data, hws, data->num), - GFP_KERNEL); - if (!clk_data) - return -ENOMEM; - - clk_data->num = data->num; - - for (i = 0; i < data->num; i++) { - struct clk_hw *hw = data->hws[i]; - struct ccu_common *common; - const char *name; - - if (!hw) { - clk_data->hws[i] = ERR_PTR(-ENOENT); - continue; - } - - name = hw->init->name; - - common = hw_to_ccu_common(hw); - common->regmap = regmap; - common->lock_regmap = lock_regmap; - - ret = devm_clk_hw_register(dev, hw); - if (ret) { - dev_err(dev, "Cannot register clock %d - %s\n", - i, name); - return ret; - } - - clk_data->hws[i] = hw; - } - - ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_data); - if (ret) - dev_err(dev, "failed to add clock hardware provider (%d)\n", ret); - - return ret; -} - -static void spacemit_cadev_release(struct device *dev) -{ - struct auxiliary_device *adev = to_auxiliary_dev(dev); - - ida_free(&auxiliary_ids, adev->id); - kfree(to_spacemit_ccu_adev(adev)); -} - -static void spacemit_adev_unregister(void *data) -{ - struct auxiliary_device *adev = data; - - auxiliary_device_delete(adev); - auxiliary_device_uninit(adev); -} - -static int spacemit_ccu_reset_register(struct device *dev, - struct regmap *regmap, - const char *reset_name) -{ - struct spacemit_ccu_adev *cadev; - struct auxiliary_device *adev; - int ret; - - /* Nothing to do if the CCU does not implement a reset controller */ - if (!reset_name) - return 0; - - cadev = kzalloc(sizeof(*cadev), GFP_KERNEL); - if (!cadev) - return -ENOMEM; - - cadev->regmap = regmap; - - adev = &cadev->adev; - adev->name = reset_name; - adev->dev.parent = dev; - adev->dev.release = spacemit_cadev_release; - adev->dev.of_node = dev->of_node; - ret = ida_alloc(&auxiliary_ids, GFP_KERNEL); - if (ret < 0) - goto err_free_cadev; - adev->id = ret; - - ret = auxiliary_device_init(adev); - if (ret) - goto err_free_aux_id; - - ret = auxiliary_device_add(adev); - if (ret) { - auxiliary_device_uninit(adev); - return ret; - } - - return devm_add_action_or_reset(dev, spacemit_adev_unregister, adev); - -err_free_aux_id: - ida_free(&auxiliary_ids, adev->id); -err_free_cadev: - kfree(cadev); - - return ret; -} - -static int k1_ccu_probe(struct platform_device *pdev) -{ - struct regmap *base_regmap, *lock_regmap = NULL; - const struct spacemit_ccu_data *data; - struct device *dev = &pdev->dev; - int ret; - - base_regmap = device_node_to_regmap(dev->of_node); - if (IS_ERR(base_regmap)) - return dev_err_probe(dev, PTR_ERR(base_regmap), - "failed to get regmap\n"); - - /* - * The lock status of PLLs locate in MPMU region, while PLLs themselves - * are in APBS region. Reference to MPMU syscon is required to check PLL - * status. - */ - if (of_device_is_compatible(dev->of_node, "spacemit,k1-pll")) { - struct device_node *mpmu = of_parse_phandle(dev->of_node, - "spacemit,mpmu", 0); - if (!mpmu) - return dev_err_probe(dev, -ENODEV, - "Cannot parse MPMU region\n"); - - lock_regmap = device_node_to_regmap(mpmu); - of_node_put(mpmu); - - if (IS_ERR(lock_regmap)) - return dev_err_probe(dev, PTR_ERR(lock_regmap), - "failed to get lock regmap\n"); - } - - data = of_device_get_match_data(dev); - - ret = spacemit_ccu_register(dev, base_regmap, lock_regmap, data); - if (ret) - return dev_err_probe(dev, ret, "failed to register clocks\n"); - - ret = spacemit_ccu_reset_register(dev, base_regmap, data->reset_name); - if (ret) - return dev_err_probe(dev, ret, "failed to register resets\n"); - - return 0; -} - static const struct of_device_id of_k1_ccu_match[] = { { .compatible = "spacemit,k1-pll", @@ -1200,7 +1026,7 @@ static struct platform_driver k1_ccu_driver = { .name = "spacemit,k1-ccu", .of_match_table = of_k1_ccu_match, }, - .probe = k1_ccu_probe, + .probe = spacemit_ccu_probe, }; module_platform_driver(k1_ccu_driver); diff --git a/drivers/clk/spacemit/ccu_common.c b/drivers/clk/spacemit/ccu_common.c index 4412c4104dab..f1a837aafb46 100644 --- a/drivers/clk/spacemit/ccu_common.c +++ b/drivers/clk/spacemit/ccu_common.c @@ -1,6 +1,177 @@ // SPDX-License-Identifier: GPL-2.0-only +#include <linux/clk-provider.h> +#include <linux/device/devres.h> +#include <linux/mfd/syscon.h> #include <linux/module.h> +#include <linux/of.h> +#include <linux/slab.h> +#include <soc/spacemit/ccu.h> + +#include "ccu_common.h" + +static DEFINE_IDA(auxiliary_ids); +static int spacemit_ccu_register(struct device *dev, + struct regmap *regmap, + struct regmap *lock_regmap, + const struct spacemit_ccu_data *data) +{ + struct clk_hw_onecell_data *clk_data; + int i, ret; + + /* Nothing to do if the CCU does not implement any clocks */ + if (!data->hws) + return 0; + + clk_data = devm_kzalloc(dev, struct_size(clk_data, hws, data->num), + GFP_KERNEL); + if (!clk_data) + return -ENOMEM; + + clk_data->num = data->num; + + for (i = 0; i < data->num; i++) { + struct clk_hw *hw = data->hws[i]; + struct ccu_common *common; + const char *name; + + if (!hw) { + clk_data->hws[i] = ERR_PTR(-ENOENT); + continue; + } + + name = hw->init->name; + + common = hw_to_ccu_common(hw); + common->regmap = regmap; + common->lock_regmap = lock_regmap; + + ret = devm_clk_hw_register(dev, hw); + if (ret) { + dev_err(dev, "Cannot register clock %d - %s\n", + i, name); + return ret; + } + + clk_data->hws[i] = hw; + } + + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_data); + if (ret) + dev_err(dev, "failed to add clock hardware provider (%d)\n", ret); + + return ret; +} + +static void spacemit_cadev_release(struct device *dev) +{ + struct auxiliary_device *adev = to_auxiliary_dev(dev); + + ida_free(&auxiliary_ids, adev->id); + kfree(to_spacemit_ccu_adev(adev)); +} + +static void spacemit_adev_unregister(void *data) +{ + struct auxiliary_device *adev = data; + + auxiliary_device_delete(adev); + auxiliary_device_uninit(adev); +} + +static int spacemit_ccu_reset_register(struct device *dev, + struct regmap *regmap, + const char *reset_name) +{ + struct spacemit_ccu_adev *cadev; + struct auxiliary_device *adev; + int ret; + + /* Nothing to do if the CCU does not implement a reset controller */ + if (!reset_name) + return 0; + + cadev = kzalloc(sizeof(*cadev), GFP_KERNEL); + if (!cadev) + return -ENOMEM; + + cadev->regmap = regmap; + + adev = &cadev->adev; + adev->name = reset_name; + adev->dev.parent = dev; + adev->dev.release = spacemit_cadev_release; + adev->dev.of_node = dev->of_node; + ret = ida_alloc(&auxiliary_ids, GFP_KERNEL); + if (ret < 0) + goto err_free_cadev; + adev->id = ret; + + ret = auxiliary_device_init(adev); + if (ret) + goto err_free_aux_id; + + ret = auxiliary_device_add(adev); + if (ret) { + auxiliary_device_uninit(adev); + return ret; + } + + return devm_add_action_or_reset(dev, spacemit_adev_unregister, adev); + +err_free_aux_id: + ida_free(&auxiliary_ids, adev->id); +err_free_cadev: + kfree(cadev); + + return ret; +} + +int spacemit_ccu_probe(struct platform_device *pdev) +{ + struct regmap *base_regmap, *lock_regmap = NULL; + const struct spacemit_ccu_data *data; + struct device *dev = &pdev->dev; + int ret; + + base_regmap = device_node_to_regmap(dev->of_node); + if (IS_ERR(base_regmap)) + return dev_err_probe(dev, PTR_ERR(base_regmap), + "failed to get regmap\n"); + + /* + * The lock status of PLLs locate in MPMU region, while PLLs themselves + * are in APBS region. Reference to MPMU syscon is required to check PLL + * status. + */ + if (of_device_is_compatible(dev->of_node, "spacemit,k1-pll")) { + struct device_node *mpmu = of_parse_phandle(dev->of_node, + "spacemit,mpmu", 0); + if (!mpmu) + return dev_err_probe(dev, -ENODEV, + "Cannot parse MPMU region\n"); + + lock_regmap = device_node_to_regmap(mpmu); + of_node_put(mpmu); + + if (IS_ERR(lock_regmap)) + return dev_err_probe(dev, PTR_ERR(lock_regmap), + "failed to get lock regmap\n"); + } + + data = of_device_get_match_data(dev); + + ret = spacemit_ccu_register(dev, base_regmap, lock_regmap, data); + if (ret) + return dev_err_probe(dev, ret, "failed to register clocks\n"); + + ret = spacemit_ccu_reset_register(dev, base_regmap, data->reset_name); + if (ret) + return dev_err_probe(dev, ret, "failed to register resets\n"); + + return 0; +} +EXPORT_SYMBOL_NS_GPL(spacemit_ccu_probe, "CLK_SPACEMIT"); MODULE_DESCRIPTION("SpacemiT CCU common clock driver"); MODULE_LICENSE("GPL"); diff --git a/drivers/clk/spacemit/ccu_common.h b/drivers/clk/spacemit/ccu_common.h index da72f3836e0b..9b4ef24875e5 100644 --- a/drivers/clk/spacemit/ccu_common.h +++ b/drivers/clk/spacemit/ccu_common.h @@ -7,6 +7,8 @@ #ifndef _CCU_COMMON_H_ #define _CCU_COMMON_H_ +#include <linux/clk-provider.h> +#include <linux/platform_device.h> #include <linux/regmap.h> struct ccu_common { @@ -36,6 +38,12 @@ static inline struct ccu_common *hw_to_ccu_common(struct clk_hw *hw) return container_of(hw, struct ccu_common, hw); } +struct spacemit_ccu_data { + const char *reset_name; + struct clk_hw **hws; + size_t num; +}; + #define ccu_read(c, reg) \ ({ \ u32 tmp; \ @@ -45,4 +53,6 @@ static inline struct ccu_common *hw_to_ccu_common(struct clk_hw *hw) #define ccu_update(c, reg, mask, val) \ regmap_update_bits((c)->regmap, (c)->reg_##reg, mask, val) +int spacemit_ccu_probe(struct platform_device *pdev); + #endif /* _CCU_COMMON_H_ */ diff --git a/include/soc/spacemit/ccu.h b/include/soc/spacemit/ccu.h new file mode 100644 index 000000000000..84dcdecccc05 --- /dev/null +++ b/include/soc/spacemit/ccu.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef __SOC_SPACEMIT_CCU_H__ +#define __SOC_SPACEMIT_CCU_H__ + +#include <linux/auxiliary_bus.h> +#include <linux/regmap.h> + +/* Auxiliary device used to represent a CCU reset controller */ +struct spacemit_ccu_adev { + struct auxiliary_device adev; + struct regmap *regmap; +}; + +static inline struct spacemit_ccu_adev * +to_spacemit_ccu_adev(struct auxiliary_device *adev) +{ + return container_of(adev, struct spacemit_ccu_adev, adev); +} + +#endif /* __SOC_SPACEMIT_CCU_H__ */ diff --git a/include/soc/spacemit/k1-syscon.h b/include/soc/spacemit/k1-syscon.h index 354751562c55..0be7a2e8d445 100644 --- a/include/soc/spacemit/k1-syscon.h +++ b/include/soc/spacemit/k1-syscon.h @@ -5,17 +5,7 @@ #ifndef __SOC_K1_SYSCON_H__ #define __SOC_K1_SYSCON_H__ -/* Auxiliary device used to represent a CCU reset controller */ -struct spacemit_ccu_adev { - struct auxiliary_device adev; - struct regmap *regmap; -}; - -static inline struct spacemit_ccu_adev * -to_spacemit_ccu_adev(struct auxiliary_device *adev) -{ - return container_of(adev, struct spacemit_ccu_adev, adev); -} +#include "ccu.h" /* APBS register offset */ #define APBS_PLL1_SWCR1 0x100 -- 2.52.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] reset: spacemit: fix auxiliary device id 2025-12-20 1:11 [PATCH 0/2] clk: spacemit: refactor common ccu driver Yixun Lan 2025-12-20 1:11 ` [PATCH 1/2] clk: spacemit: extract common ccu functions Yixun Lan @ 2025-12-20 1:11 ` Yixun Lan 2025-12-20 2:40 ` Yao Zi 2025-12-25 7:47 ` Yixun Lan 1 sibling, 2 replies; 9+ messages in thread From: Yixun Lan @ 2025-12-20 1:11 UTC (permalink / raw) To: Stephen Boyd, Michael Turquette, Philipp Zabel Cc: Alex Elder, Guodong Xu, Inochi Amaoto, linux-kernel, linux-clk, linux-riscv, spacemit, Yixun Lan Due to the auxiliary register procedure moved to ccu common module, the auxiliary device id need to be adjusted, otherwise reset driver will fail to probe. Signed-off-by: Yixun Lan <dlan@gentoo.org> --- drivers/reset/reset-spacemit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/reset/reset-spacemit.c b/drivers/reset/reset-spacemit.c index e1272aff28f7..0bfd90567011 100644 --- a/drivers/reset/reset-spacemit.c +++ b/drivers/reset/reset-spacemit.c @@ -278,7 +278,7 @@ static int spacemit_reset_probe(struct auxiliary_device *adev, #define K1_AUX_DEV_ID(_unit) \ { \ - .name = "spacemit_ccu_k1." #_unit "-reset", \ + .name = "spacemit_ccu." #_unit "-reset", \ .driver_data = (kernel_ulong_t)&k1_ ## _unit ## _reset_data, \ } -- 2.52.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] reset: spacemit: fix auxiliary device id 2025-12-20 1:11 ` [PATCH 2/2] reset: spacemit: fix auxiliary device id Yixun Lan @ 2025-12-20 2:40 ` Yao Zi 2025-12-20 2:59 ` Yixun Lan 2025-12-25 7:47 ` Yixun Lan 1 sibling, 1 reply; 9+ messages in thread From: Yao Zi @ 2025-12-20 2:40 UTC (permalink / raw) To: Yixun Lan, Stephen Boyd, Michael Turquette, Philipp Zabel Cc: Alex Elder, Guodong Xu, Inochi Amaoto, linux-kernel, linux-clk, linux-riscv, spacemit On Sat, Dec 20, 2025 at 09:11:20AM +0800, Yixun Lan wrote: > Due to the auxiliary register procedure moved to ccu common module, > the auxiliary device id need to be adjusted, otherwise reset driver > will fail to probe. Does it mean the reset driver fails to probe with only PATCH 1 in the series applied? If so these two patches should probably be merged, or we will get unfunctional commits. Regards, Yao Zi > Signed-off-by: Yixun Lan <dlan@gentoo.org> _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] reset: spacemit: fix auxiliary device id 2025-12-20 2:40 ` Yao Zi @ 2025-12-20 2:59 ` Yixun Lan 2025-12-24 11:48 ` Yixun Lan 0 siblings, 1 reply; 9+ messages in thread From: Yixun Lan @ 2025-12-20 2:59 UTC (permalink / raw) To: Yao Zi Cc: Stephen Boyd, Michael Turquette, Philipp Zabel, Alex Elder, Guodong Xu, Inochi Amaoto, linux-kernel, linux-clk, linux-riscv, spacemit Hi Yao, On 02:40 Sat 20 Dec , Yao Zi wrote: > On Sat, Dec 20, 2025 at 09:11:20AM +0800, Yixun Lan wrote: > > Due to the auxiliary register procedure moved to ccu common module, > > the auxiliary device id need to be adjusted, otherwise reset driver > > will fail to probe. > > Does it mean the reset driver fails to probe with only PATCH 1 in the > series applied? If so these two patches should probably be merged, or we > will get unfunctional commits. yes, it will fail with only patch 1 and no, I do not want to combine them together as they belong to different subsystem. it shouldn't be a problem if they are accepted in same merge window, or if people too picky to worry bisectable breakage, then I would ask reset/clock maintainer an ack instead to make it go via clock tree in one combined PR -- Yixun Lan (dlan) _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] reset: spacemit: fix auxiliary device id 2025-12-20 2:59 ` Yixun Lan @ 2025-12-24 11:48 ` Yixun Lan 2026-01-03 22:00 ` Yixun Lan 0 siblings, 1 reply; 9+ messages in thread From: Yixun Lan @ 2025-12-24 11:48 UTC (permalink / raw) To: Philipp Zabel Cc: Stephen Boyd, Michael Turquette, Alex Elder, Guodong Xu, Inochi Amaoto, Yao Zi, linux-kernel, linux-clk, linux-riscv, spacemit Hi Philipp Zabel, I'd like to see your preference for this issue, see my comment below On 10:59 Sat 20 Dec , Yixun Lan wrote: > Hi Yao, > > On 02:40 Sat 20 Dec , Yao Zi wrote: > > On Sat, Dec 20, 2025 at 09:11:20AM +0800, Yixun Lan wrote: > > > Due to the auxiliary register procedure moved to ccu common module, > > > the auxiliary device id need to be adjusted, otherwise reset driver > > > will fail to probe. > > > > Does it mean the reset driver fails to probe with only PATCH 1 in the > > series applied? If so these two patches should probably be merged, or we > > will get unfunctional commits. > yes, it will fail with only patch 1 > > and no, I do not want to combine them together as they belong to > different subsystem. it shouldn't be a problem if they are accepted in > same merge window, or if people too picky to worry bisectable breakage, > then I would ask reset/clock maintainer an ack instead to make it go > via clock tree in one combined PR > I'd consider above approach is less optimal, would it ok if I create an immutable tag for this single patch, and send it to you? so can be shared by both clock and reset subsystem.. eventually reset driver should go via reset tree, and I also know Guodong is working on new reset driver to add support for incoming K3 SoC, which means potential conflicts or extra dependency.. -- Yixun Lan (dlan) _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] reset: spacemit: fix auxiliary device id 2025-12-24 11:48 ` Yixun Lan @ 2026-01-03 22:00 ` Yixun Lan 2026-01-08 11:07 ` Philipp Zabel 0 siblings, 1 reply; 9+ messages in thread From: Yixun Lan @ 2026-01-03 22:00 UTC (permalink / raw) To: Philipp Zabel Cc: Stephen Boyd, Michael Turquette, Alex Elder, Guodong Xu, Inochi Amaoto, Yao Zi, linux-kernel, linux-clk, linux-riscv, spacemit Hi Philipp Zabel, I still need your opinion in order to know which direction I should go.. On 19:48 Wed 24 Dec , Yixun Lan wrote: > Hi Philipp Zabel, > > I'd like to see your preference for this issue, see my comment below > > On 10:59 Sat 20 Dec , Yixun Lan wrote: > > Hi Yao, > > > > On 02:40 Sat 20 Dec , Yao Zi wrote: > > > On Sat, Dec 20, 2025 at 09:11:20AM +0800, Yixun Lan wrote: > > > > Due to the auxiliary register procedure moved to ccu common module, > > > > the auxiliary device id need to be adjusted, otherwise reset driver > > > > will fail to probe. > > > > > > Does it mean the reset driver fails to probe with only PATCH 1 in the > > > series applied? If so these two patches should probably be merged, or we > > > will get unfunctional commits. > > yes, it will fail with only patch 1 > > > > and no, I do not want to combine them together as they belong to > > different subsystem. it shouldn't be a problem if they are accepted in > > same merge window, or if people too picky to worry bisectable breakage, > > then I would ask reset/clock maintainer an ack instead to make it go > > via clock tree in one combined PR > > .. > I'd consider above approach is less optimal, would it ok if I create an > immutable tag for this single patch, and send it to you? so can be shared > by both clock and reset subsystem.. eventually reset driver should go via > reset tree, and I also know Guodong is working on new reset driver to > add support for incoming K3 SoC, which means potential conflicts or > extra dependency.. > see my above comment although I've updated this series[1] to v3, the problem still exist, for this refactoring work, taking this single patch[2] should be enough but for incoming K3 reset driver, a shared header file[3] also need to go with same approach.. as both clock and reset driver need it (we could postpone this for now, and take action once things really happen) [1] https://lore.kernel.org/spacemit/20260103-06-k1-clk-common-v3-0-6061d9f69eef@gentoo.org/ [2] https://lore.kernel.org/spacemit/20260103-06-k1-clk-common-v3-4-6061d9f69eef@gentoo.org/ [3] https://lore.kernel.org/spacemit/20260103-k3-clk-v4-4-4cccba2360f0@gentoo.org/ -- Yixun Lan (dlan) _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] reset: spacemit: fix auxiliary device id 2026-01-03 22:00 ` Yixun Lan @ 2026-01-08 11:07 ` Philipp Zabel 0 siblings, 0 replies; 9+ messages in thread From: Philipp Zabel @ 2026-01-08 11:07 UTC (permalink / raw) To: Yixun Lan Cc: Stephen Boyd, Michael Turquette, Alex Elder, Guodong Xu, Inochi Amaoto, Yao Zi, linux-kernel, linux-clk, linux-riscv, spacemit On So, 2026-01-04 at 06:00 +0800, Yixun Lan wrote: > Hi Philipp Zabel, > > I still need your opinion in order to know which direction I should > go.. I say merge via clock tree. I'll comment on v3. regards Philipp _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] reset: spacemit: fix auxiliary device id 2025-12-20 1:11 ` [PATCH 2/2] reset: spacemit: fix auxiliary device id Yixun Lan 2025-12-20 2:40 ` Yao Zi @ 2025-12-25 7:47 ` Yixun Lan 1 sibling, 0 replies; 9+ messages in thread From: Yixun Lan @ 2025-12-25 7:47 UTC (permalink / raw) To: Stephen Boyd, Michael Turquette, Philipp Zabel Cc: Alex Elder, Guodong Xu, Inochi Amaoto, linux-kernel, linux-clk, linux-riscv, spacemit Hi All, On 09:11 Sat 20 Dec , Yixun Lan wrote: > Due to the auxiliary register procedure moved to ccu common module, > the auxiliary device id need to be adjusted, otherwise reset driver > will fail to probe. > > Signed-off-by: Yixun Lan <dlan@gentoo.org> > --- > drivers/reset/reset-spacemit.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/reset/reset-spacemit.c b/drivers/reset/reset-spacemit.c > index e1272aff28f7..0bfd90567011 100644 > --- a/drivers/reset/reset-spacemit.c > +++ b/drivers/reset/reset-spacemit.c > @@ -278,7 +278,7 @@ static int spacemit_reset_probe(struct auxiliary_device *adev, > > #define K1_AUX_DEV_ID(_unit) \ > { \ > - .name = "spacemit_ccu_k1." #_unit "-reset", \ > + .name = "spacemit_ccu." #_unit "-reset", \ To distinguish support from K3 SoC, the k1 namespace still need to be kept, I will update this in next version -- Yixun Lan (dlan) _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-01-08 11:08 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-12-20 1:11 [PATCH 0/2] clk: spacemit: refactor common ccu driver Yixun Lan 2025-12-20 1:11 ` [PATCH 1/2] clk: spacemit: extract common ccu functions Yixun Lan 2025-12-20 1:11 ` [PATCH 2/2] reset: spacemit: fix auxiliary device id Yixun Lan 2025-12-20 2:40 ` Yao Zi 2025-12-20 2:59 ` Yixun Lan 2025-12-24 11:48 ` Yixun Lan 2026-01-03 22:00 ` Yixun Lan 2026-01-08 11:07 ` Philipp Zabel 2025-12-25 7:47 ` Yixun Lan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox