一是告诉底层的CLOCK Driver,需把可能引起睡眠的操作,放到Prepare()/Unprepare()中实现,一定不能放到Enable()/Disable()中; 二是提醒上层使用CLOCK的Driver,调用Prepare/Unprepare 接口时可能会睡眠,千万不能在Atomic上下文(例如内部包含Mutex 锁、中断关闭、Spinlock 锁保护的区域)调用,而调用Enable()/Disable()接口则...
驱动程序中常用的API集成了原子和非原子操作,以确保时钟启用或停用的正确执行。这些操作可能需要CPU睡眠,特别是在启动依赖于长时间稳定状态的时钟,如PLL时钟时。因此,为了简化调用,内核封装了`clk_prepare_enable`和`clk_disable_unprepare`接口。CLK子系统的核心数据结构包括`struct clk_notifier`、`str...
int clk_prepare(struct clk *clk) void clk_unprepare(struct clk *clk) //启动/停止clock。不会睡眠。 static inline int clk_enable(struct clk *clk) static inline void clk_disable(struct clk *clk) //clock频率的获取和设置 static inline unsigned long clk_get_rate(struct clk *clk) static inlin...
v6.1/standard/preempt-rt/nxp-sdk-6.1/nxp-soc][PATCH] soc: imx8mp: place read register before clk_disable_unprepare() on 16/05/2024 Xiaolei Wang wrote: > commit 328efccc7847 ("soc: imx8m: Enable OCOTP clock for imx8mm > before reading registers") has re-enabled the clock, so readin...
clk_disable_unprepare(hpriv->clks[c]);returnrc; } EXPORT_SYMBOL_GPL(ahci_platform_enable_clks); 问题:AHCI_MAX_CLKS 在drivers/ata/ahci.h文件中定义其为枚举变量AHCI_MAX_CLKS = 5,理解代码为什么会是5的时候参考AHCI1.3 && SATA3.0 && Synopsys SATA手册,只在Synopsys SATA手册找到clock domains中...
…ime_resume() 'ddata->clk' is enabled by clk_prepare_enable(), it should be disabled by clk_disable_unprepare(). Fixes: 8d9d4bd ("hwrng: omap3-rom - Use runtime PM instead of custom functions") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Herbert ...
+++ b/drivers/soc/imx/soc-imx8m.c @@ -135,15 +135,15 @@ static void __init imx8mm_soc_uid(void) soc_uid <<= 32; soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW + offset); - clk_disable_unprepare(clk); - clk_put(clk); ...
clk_disable_unprepare(cesa->engines[i].zclk);clk_disable_unprepare(cesa->engines[i].clk); mv_cesa_put_sram(pdev, i);if (cesa->engines[i].irq > 0)irq_set_affinity_hint(cesa->engines[i].irq, NULL); @@ -589,8 +583,6 @@ static void mv_cesa_remove(struct platform_device *p...
__clk_unprepare(clk->parent); returnret; } } } clk->prepare_count++; return0; } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30.
void (*unprepare_unused)(struct clk_hw *hw); int (*enable)(struct clk_hw *hw); void (*disable)(struct clk_hw *hw); int (*is_enabled)(struct clk_hw *hw); void (*disable_unused)(struct clk_hw *hw); unsigned long (*recalc_rate)(struct clk_hw *hw, ...