devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: Tao Zhang <quic_taozha@quicinc.com>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Mike Leach <mike.leach@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	James Clark <james.clark@arm.com>
Cc: Jinlong Mao <quic_jinlmao@quicinc.com>,
	Leo Yan <leo.yan@linaro.org>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	Tingwei Zhang <quic_tingweiz@quicinc.com>,
	Yuanfang Zhang <quic_yuanfang@quicinc.com>,
	Trilok Soni <quic_tsoni@quicinc.com>,
	Song Chai <quic_songchai@quicinc.com>,
	linux-arm-msm@vger.kernel.org, Jie Gan <quic_jiegan@quicinc.com>
Subject: Re: [PATCH v1 3/3] coresight-tpda: Optimize the function of reading element size
Date: Mon, 8 Jul 2024 16:49:53 +0100	[thread overview]
Message-ID: <2fdaac53-3695-45cd-a57a-1afaf365a19a@arm.com> (raw)
In-Reply-To: <20240705085152.9063-4-quic_taozha@quicinc.com>

On 05/07/2024 09:51, Tao Zhang wrote:
> Since the new funnel device supports multi-port output scenarios,
> there may be more than one TPDM connected to one TPDA. In this
> way, when reading the element size of the TPDM, TPDA driver needs
> to find the expected TPDM corresponding to the filter source.
> When TPDA finds a TPDM or a filter source from a input connection,
> it will read the Devicetree to get the expected TPDM's element
> size.
> 
> Signed-off-by: Tao Zhang <quic_taozha@quicinc.com>
> ---
>   drivers/hwtracing/coresight/coresight-tpda.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-tpda.c b/drivers/hwtracing/coresight/coresight-tpda.c
> index 52b0201090fb..fc5a4e46cf5d 100644
> --- a/drivers/hwtracing/coresight/coresight-tpda.c
> +++ b/drivers/hwtracing/coresight/coresight-tpda.c
> @@ -110,9 +110,12 @@ static int tpda_get_element_size(struct tpda_drvdata *drvdata,
>   		    csdev->pdata->in_conns[i]->dest_port != inport)
>   			continue;
>
		

> -		if (coresight_device_is_tpdm(in)) {
> +		if (coresight_device_is_tpdm(in)
> +		    || csdev->pdata->in_conns[i]->filter_src_dev) {

How can we assume that the filter-source device is always TPDM ?
It may be true for your test board, but driver must handle all
possible cases. I would rather prefer:

diff --git a/drivers/hwtracing/coresight/coresight-tpda.c 
b/drivers/hwtracing/coresight/coresight-tpda.c
index bfca103f9f84..b1d6f1dd60e3 100644
--- a/drivers/hwtracing/coresight/coresight-tpda.c
+++ b/drivers/hwtracing/coresight/coresight-tpda.c
@@ -110,6 +110,13 @@ static int tpda_get_element_size(struct 
tpda_drvdata *drvdata,
                     csdev->pdata->in_conns[i]->dest_port != inport)
                         continue;

+               /*
+                * If this port is tied to a source device,
+                * jump to that directly.
+                */
+               if (csdev->pdata->in_conns[i]->filter_src)
+                       in = csdev->pdata->in_conns[i]->filter_src;
+
                 if (coresight_device_is_tpdm(in)) {
                         if (drvdata->dsb_esize || drvdata->cmb_esize)
                                 return -EEXIST;


Suzuki


  reply	other threads:[~2024-07-08 15:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05  8:51 [PATCH v1 0/3] Add source filtering for multi-port output Tao Zhang
2024-07-05  8:51 ` [PATCH v1 1/3] dt-bindings: arm: qcom,coresight-static-replicator: Add property for source filtering Tao Zhang
2024-07-05  9:02   ` Krzysztof Kozlowski
2024-07-09 10:38     ` Suzuki K Poulose
2024-07-05 10:38   ` Rob Herring (Arm)
2024-07-05 15:23     ` Tao Zhang
2024-07-06  5:22       ` Tao Zhang
2024-07-05  8:51 ` [PATCH v1 2/3] coresight: Add source filtering for multi-port output Tao Zhang
2024-07-09 13:42   ` Suzuki K Poulose
2024-07-11  8:20     ` Tao Zhang
2024-07-05  8:51 ` [PATCH v1 3/3] coresight-tpda: Optimize the function of reading element size Tao Zhang
2024-07-08 15:49   ` Suzuki K Poulose [this message]
2024-07-11  8:20     ` Tao Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2fdaac53-3695-45cd-a57a-1afaf365a19a@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=james.clark@arm.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@linaro.org \
    --cc=quic_jiegan@quicinc.com \
    --cc=quic_jinlmao@quicinc.com \
    --cc=quic_songchai@quicinc.com \
    --cc=quic_taozha@quicinc.com \
    --cc=quic_tingweiz@quicinc.com \
    --cc=quic_tsoni@quicinc.com \
    --cc=quic_yuanfang@quicinc.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).