[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250721134238.GD3137075@e132581.arm.com>
Date: Mon, 21 Jul 2025 14:42:38 +0100
From: Leo Yan <leo.yan@....com>
To: Suzuki K Poulose <suzuki.poulose@....com>
Cc: Mike Leach <mike.leach@...aro.org>,
James Clark <james.clark@...aro.org>,
Anshuman Khandual <anshuman.khandual@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 05/10] coresight: Appropriately disable trace bus
clocks
On Mon, Jul 21, 2025 at 10:20:42AM +0100, Suzuki Kuruppassery Poulose wrote:
> On 27/06/2025 12:51, 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")
>
> I would drop this tag as I don't see what we are fixing ?
This patch changes the clock operations from:
atclk = devm_clk_get(dev, "atclk");
clk_prepare_enable(atclk);
to:
atclk = devm_clk_get_optional_enabled(dev, "atclk");
The commit log mentions in the old approach, "clocks are not disabled
when modules exit." So the patch is not only a refactoring, it changes
to use devm_clk_get_optional_enabled() to register
clk_disable_unprepare() as a callback to disable clock when the device
is released.
BTW, I selected the commit "d1839e687773" as the Fixed tag as it is
the first commit that introduced the devm_clk_get() +
clk_prepare_enable().
> If there is indeed something, I would recommend:
> - Call it out in the commit description.
> - Move that as a separate patch, so that it can be
> safely backported without touching all the other drivers.
>
> If you agree with the above, I will drop the "Fixes" tag and
> can merge it.
Please let me know if anything I can follow up.
Thanks,
Leo
Powered by blists - more mailing lists