[PATCH v6 05/19] coresight: Add callback to determine if PM is needed

Leo Yan leo.yan at arm.com
Tue Mar 17 04:22:01 PDT 2026


On Fri, Mar 13, 2026 at 11:26:59AM +0000, Suzuki K Poulose wrote:
> On 05/03/2026 10:17, Leo Yan wrote:
> > Add a callback in the source device that returns a boolean indicating
> > whether power management operations are required. The save and restore
> > flow is skipped if the callback returns false.
> > 
> > The ETMv4 driver implements its own version's callback.
> > 
> > Reviewed-by: James Clark <james.clark at linaro.org>
> > Tested-by: James Clark <james.clark at linaro.org>
> > Signed-off-by: Leo Yan <leo.yan at arm.com>
> > ---
> >   drivers/hwtracing/coresight/coresight-core.c       |  9 ++++++++-
> >   drivers/hwtracing/coresight/coresight-etm4x-core.c | 16 ++++++++++++++++
> >   include/linux/coresight.h                          |  1 +
> >   3 files changed, 25 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
> > index 5f7930ef537e2877649c404858d9fe6f593af037..6956429ca507d850c8b8c62c65de4b6fe1a1740c 100644
> > --- a/drivers/hwtracing/coresight/coresight-core.c
> > +++ b/drivers/hwtracing/coresight/coresight-core.c
> > @@ -1681,7 +1681,14 @@ static bool coresight_pm_is_needed(struct coresight_device *csdev)
> >   	    !coresight_ops(csdev)->pm_restore_enable)
> >   		return false;
> > -	return true;
> > +	/*
> > +	 * PM callbacks are provided but pm_is_neended() is absent, it means
> > +	 * no extra check is needed.
> > +	 */
> > +	if (!coresight_ops(csdev)->pm_is_needed)
> > +		return true;
> 
> Do we really need this call back ? The ETM can skip registering the PM ops
> when it is not needed (make them NULL) ? And the oresight_get_mode() is any
> way available for all devices and use that simply in the core function ?

Good point!  I will drop pm_is_needed() callback in new version.



More information about the linux-arm-kernel mailing list