On 11/11/2025 09:24, Leo Yan wrote:
On Mon, Nov 10, 2025 at 11:37:52AM +0000, Suzuki Kuruppassery Poulose wrote:
[...]
-static int etm4_enable_hw(struct etmv4_drvdata *drvdata) +static int etm4_enable_hw(struct etmv4_drvdata *drvdata, bool restart_ss)
While this looks to work, I wonder if we could manage this all in the config ? i.e.,
Use an extra field, say config->retain_single_shot_status, which defaults to 0 and is always cleared once we pass through enable_hw.
This is fine for me in general. I agree that adding an argument in etm4_enable_hw() is not scalable, though we can take a bit advantage of stack push and pop so no need cleanup.
Before proceed, I would check another idea. Can we do this with is_idle_task()?
if (!is_idle_task(current)) { if (config->ss_ctrl[i] || config->ss_pe_cmp[i]) config->ss_status[i] &= ~TRCSSCSRn_STATUS; }
What happens when we do a system wide session and a CPU is running an idle task ?
Suzuki
As a result, we can avoid new flag and extra operatoins (set/clear) for the added flag.
Note, this does not only impact CPU idle flow, this also applies on CPU hotplug flow (as CPU hotplug callback also runs in idle thread). I think this would be fine, no matter CPU idle or hotplug, we keep the single-shot state after the CPU resume back.
Thoughts?
Thanks, Leo