Re: [PATCH v7 05/13] coresight: etm4x: exclude ss_status from drvdata->config
From: Yeoreum Yun
Date: Thu May 28 2026 - 09:53:40 EST
Hi Leo,
> On Tue, May 19, 2026 at 04:48:04PM +0100, Yeoreum Yun wrote:
>
> [...]
>
> > @@ -571,11 +571,11 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata)
> > etm4x_relaxed_write32(csa, config->res_ctrl[i], TRCRSCTLRn(i));
> >
> > for (i = 0; i < caps->nr_ss_cmp; i++) {
> > - /* always clear status bit on restart if using single-shot */
> > + /* always clear status and pending bits on restart if using single-shot */
> > if (config->ss_ctrl[i] || config->ss_pe_cmp[i])
> > - config->ss_status[i] &= ~TRCSSCSRn_STATUS;
> > + drvdata->ss_status[i] &= ~(TRCSSCSRn_STATUS | TRCSSCSRn_PENDING);
> > etm4x_relaxed_write32(csa, config->ss_ctrl[i], TRCSSCCRn(i));
> > - etm4x_relaxed_write32(csa, config->ss_status[i], TRCSSCSRn(i));
> > + etm4x_relaxed_write32(csa, drvdata->ss_status[i], TRCSSCSRn(i));
> > if (etm4x_sspcicrn_present(drvdata, i))
> > etm4x_relaxed_write32(csa, config->ss_pe_cmp[i], TRCSSPCICRn(i));
> > }
> > @@ -772,6 +772,7 @@ static int etm4_parse_event_config(struct coresight_device *csdev,
> > /* Clear configuration from previous run */
> > memset(config, 0, sizeof(struct etmv4_config));
> >
> > +
>
> Unexpected new line?
Oops. I'll remove it.
>
> > @@ -1497,8 +1498,9 @@ static void etm4_init_arch_data(void *info)
> > */
> > caps->nr_ss_cmp = FIELD_GET(TRCIDR4_NUMSSCC_MASK, etmidr4);
> > for (i = 0; i < caps->nr_ss_cmp; i++) {
> > - drvdata->config.ss_status[i] =
> > - etm4x_relaxed_read32(csa, TRCSSCSRn(i));
> > + drvdata->ss_status[i] = etm4x_relaxed_read32(csa, TRCSSCSRn(i));
> > + drvdata->ss_status[i] &= (TRCSSCSRn_PC | TRCSSCSRn_DV |
> > + TRCSSCSRn_DA | TRCSSCSRn_INST);
>
> Since etm4_enable_hw() clears the TRCSSCSRn_STATUS and
> TRCSSCSRn_PENDING bits every time, here is no need to clear the
> status bits during probe.
>
> In the future, we may want to preserve the status within a session and
> clear it only when starting a new session. Clearing the status bits here
> still cannot handle stale status across multiple sessions, so we can
> defer this improvement for later.
Yes. That would require near future as we discussed in offline.
but the at the initialisation perspective, it should ignore those bits
since that would be random value after reset.
So, I'll remain it as it is.
--
Sincerely,
Yeoreum Yun