On Mon, Jun 09, 2025 at 05:14:09PM +0100, Suzuki Kuruppassery Poulose wrote:
On 09/06/2025 17:00, Leo Yan wrote:
Some CoreSight components have trace bus clocks 'atclk' and are enabled using clk_prepare_enable(). These clocks are not disabled when modules exit.
As atclk is optional, use devm_clk_get_optional_enabled() to manage it. The benefit is the driver model layer can automatically disable and release clocks.
Check the returned value with IS_ERR() to detect errors but leave the NULL pointer case if the clock is not found. And remove the error handling codes which are no longer needed.
Fixes: d1839e687773 ("coresight: etm: retrieve and handle atclk") Reviewed-by: Anshuman Khandual anshuman.khandual@arm.com Signed-off-by: Leo Yan leo.yan@arm.com
Can we consolidate the ATCLK handling to the core coresight helper for APB clocks ? It is an optional clock for all devices anyways ?
Yes. ATCLK is always optional.
Could you check the patch 07? It is exactly a consolidation to put ATCLK and APB clocks into a central place.
Thanks, Leo