Re: [PATCH 3/9] coresight-tpdm: Initialize DSB subunit configuration

From: Suzuki K Poulose
Date: Wed Oct 26 2022 - 10:18:54 EST


On 26/10/2022 09:10, Tao Zhang wrote:
Hi Suzuki,

在 10/24/2022 6:02 PM, Suzuki K Poulose 写道:
Hi

On 08/09/2022 09:44, Tao Zhang wrote:
DSB subunit need to be configured in enablement and disablement.
A struct that specifics associated to dsb dataset is needed. It
saves the configuration and parameters of the dsb datasets. This
change is to add this struct and initialize the configuration of
DSB subunit.

Signed-off-by: Tao Zhang <quic_taozha@xxxxxxxxxxx>
---
  drivers/hwtracing/coresight/coresight-tpdm.c | 44 ++++++++++++++++++++++++++--
  drivers/hwtracing/coresight/coresight-tpdm.h | 17 +++++++++++
  2 files changed, 58 insertions(+), 3 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-tpdm.c b/drivers/hwtracing/coresight/coresight-tpdm.c
index 88df3e6..69ea453 100644
--- a/drivers/hwtracing/coresight/coresight-tpdm.c
+++ b/drivers/hwtracing/coresight/coresight-tpdm.c
@@ -24,6 +24,22 @@ static void tpdm_enable_dsb(struct tpdm_drvdata *drvdata)
  {
      u32 val;
  +    val = readl_relaxed(drvdata->base + TPDM_DSB_TIER);
+    /* Set trigger timestamp */
+    if (drvdata->dsb->trig_ts)

What happens if this instance doesn't have a DSB set ? Have
you tested this on a system without the DSB ?

The function "tpdm_enable_dsb" will only be called when it is checked that the DSB dataset is present.

And only the TPDM that supports the DSB dataset will have the DSB TIER register.

If the TPDM doesn't support the DSB dataset, this instance should not be run. Otherwise, it will cause that the incorrect register is accessed.

Thanks, this is what happens when you send something that is not queued
anywhwere. Please provide a reference tree in the future, for ease of
reviewing such things

Suzuki