[PATCH v2 16/23] coresight: trbe: Always classify TRBSR when updating buffer

Leo Yan leo.yan at arm.com
Fri Nov 27 07:43:23 PST 2026


On Thu, Nov 26, 2026 at 03:00:46PM +0000, Suzuki K Poulose wrote:

> > With classification on the no-IRQ path, a normal software stop can
> > have TRBSR.S clear and an ignored detected trigger can set TRBSR.TRG.
> > Neither should warn or discard valid trace. Mark fatal status as
> > truncated and return zero.
> 
> > Use LIMIT for a filled WRAP and TRBPTR otherwise.
> 
> This is already the case, right. Please could we remove this bit ?

Yes, I'll drop it.

> > @@ -662,8 +662,6 @@ static enum trbe_fault_action trbe_get_fault_act(struct perf_output_handle *hand
> >   	int ec = get_trbe_ec(trbsr);
> >   	int bsc = get_trbe_bsc(trbsr);
> > -	WARN_ON(is_trbe_running(trbsr));
> > -
> 
> Why are we removing this ?  Do we expect to be called with TRBE running ?
> Both trbe_update_buffer and the irq_handler stops the trbe. So this
> must be held valid ?

Both paths disable the TRBE by clearing TRBLIMITR_EL1.E. With this patch,
arm_trbe_update_buffer() can call trbe_get_fault_act() when no
maintenance IRQ is pending. If no management event stopped collection,
TRBSR_EL1.S can still be clear.

Arm ARM DDI 0487 M.c, section D6.2, Table D6-1 shows:

  TRBLIMITR_EL1.E = 0, TRBSR_EL1.S = X, and Running = False.
  (X means either value of S bit)
 
Since is_trbe_running() tests only TRBSR_EL1.S, the warning would fire
on a software stop.

Thanks,
Leo



More information about the linux-arm-kernel mailing list