[PATCH v5 11/11] coresight: etm4x: Reuse normal enable and disable logic in CPU idle

Leo Yan leo.yan at arm.com
Tue Nov 11 01:25:24 PST 2025


On Mon, Nov 10, 2025 at 11:44:20AM +0000, Suzuki Kuruppassery Poulose wrote:

[...]

> > +	etm4_cs_lock(drvdata, csa);
> 
> > +	etm4_disable_hw(drvdata);
> > +	etm4_cs_unlock(drvdata, csa);
> This looks a bit hacky. Here are the options :
> 
> 1. Leave it as above, but clearly explain in a comment why we do this.
> 2. The other option is to restructure etm4_disable_hw into
>  etm4_cs_unlock()
>  __etm4_disable_hw()
>  etm4_cs_lock()

I will try the option 2.

> And use __etm4_disable_hw() from here.
> 
> >   	/* wait for TRCSTATR.IDLE to go up */
> >   	if (etm4x_wait_status(csa, TRCSTATR_IDLE_BIT, 1)) {
> >   		dev_err(etm_dev,
> > @@ -1972,14 +1889,6 @@ static int __etm4_cpu_save(struct etmv4_drvdata *drvdata)
> >   		goto out;
> 
> This goto can be removed too.

Indeed, will remove it.

Thanks,
Leo



More information about the linux-arm-kernel mailing list