[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b5dd9d63-fb11-e343-a0a6-4aa8217fd7b3@quicinc.com>
Date: Thu, 25 May 2023 15:20:58 +0800
From: Tao Zhang <quic_taozha@...cinc.com>
To: Suzuki K Poulose <suzuki.poulose@....com>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Konrad Dybcio <konradybcio@...il.com>,
Mike Leach <mike.leach@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>
CC: Jinlong Mao <quic_jinlmao@...cinc.com>,
Leo Yan <leo.yan@...aro.org>,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
<coresight@...ts.linaro.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>,
Tingwei Zhang <quic_tingweiz@...cinc.com>,
Yuanfang Zhang <quic_yuanfang@...cinc.com>,
Trilok Soni <quic_tsoni@...cinc.com>,
Hao Zhang <quic_hazha@...cinc.com>,
<linux-arm-msm@...r.kernel.org>, <andersson@...nel.org>
Subject: Re: [PATCH v4 02/11] coresight-tpda: Add DSB dataset support
On 5/23/2023 10:48 PM, Suzuki K Poulose wrote:
> On 23/05/2023 11:07, Suzuki K Poulose wrote:
>> On 27/04/2023 10:00, Tao Zhang wrote:
>>> Read the DSB element size from the device tree. Set the register
>>> bit that controls the DSB element size of the corresponding port.
>>>
>>> Signed-off-by: Tao Zhang <quic_taozha@...cinc.com>
>>> ---
>>> drivers/hwtracing/coresight/coresight-core.c | 1 +
>>> drivers/hwtracing/coresight/coresight-tpda.c | 92
>>> +++++++++++++++++++++++++---
>>> drivers/hwtracing/coresight/coresight-tpda.h | 4 ++
>>> drivers/hwtracing/coresight/coresight-tpdm.c | 2 +-
>>> include/linux/coresight.h | 1 +
>>> 5 files changed, 90 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/drivers/hwtracing/coresight/coresight-core.c
>>> b/drivers/hwtracing/coresight/coresight-core.c
>>> index 2af416b..f1eacbb 100644
>>> --- a/drivers/hwtracing/coresight/coresight-core.c
>>> +++ b/drivers/hwtracing/coresight/coresight-core.c
>>> @@ -1092,6 +1092,7 @@ static int coresight_validate_source(struct
>>> coresight_device *csdev,
>>> if (subtype != CORESIGHT_DEV_SUBTYPE_SOURCE_PROC &&
>>> subtype != CORESIGHT_DEV_SUBTYPE_SOURCE_SOFTWARE &&
>>> + subtype != CORESIGHT_DEV_SUBTYPE_SOURCE_TPDM &&
>>> subtype != CORESIGHT_DEV_SUBTYPE_SOURCE_OTHERS) {
>>> dev_err(&csdev->dev, "wrong device subtype in %s\n",
>>> function);
>>> return -EINVAL;
>>
>> Please see the comment at the bottom.
>>
>>> diff --git a/drivers/hwtracing/coresight/coresight-tpda.c
>>> b/drivers/hwtracing/coresight/coresight-tpda.c
>>> index 8d2b9d2..af9c72f 100644
>>> --- a/drivers/hwtracing/coresight/coresight-tpda.c
>>> +++ b/drivers/hwtracing/coresight/coresight-tpda.c
>>> @@ -21,6 +21,56 @@
>>> DEFINE_CORESIGHT_DEVLIST(tpda_devs, "tpda");
>>> +/* Search and read element data size from the TPDM node in
>>> + * the devicetree. Each input port of TPDA is connected to
>>> + * a TPDM. Different TPDM supports different types of dataset,
>>> + * and some may support more than one type of dataset.
>>> + * Parameter "inport" is used to pass in the input port number
>>> + * of TPDA, and it is set to 0 in the recursize call.
>>> + * Parameter "parent" is used to pass in the original call.
>>> + */
>>> +static int tpda_set_element_size(struct tpda_drvdata *drvdata,
>>> + struct coresight_device *csdev, int inport, bool
>>> parent)
>
> The name parent is a bit confusing. It could imply parent device ? That
> is kind of inverse ? because, parent = true, indicates the parent device
> of tpda, which is not true. Could we simply say
>
> bool match_inport => When true, the dest_port of the connection from the
> csdev must match the inport ? And ...
>
Sure, I will update this in the next patch series.
>>> +{
>>> + static int nr_inport;
>>> + int i;
>>> + static bool tpdm_found;
>>> + struct coresight_device *in_csdev;
>>> +
>>> + if (inport > (TPDA_MAX_INPORTS - 1))
>>> + return -EINVAL;
>>> +
>>> + if (parent) {
>>> + nr_inport = inport;
>>> + tpdm_found = false;
>>> + }
>>> +
>>> + for (i = 0; i < csdev->pdata->nr_inconns; i++) {
>>> + in_csdev = csdev->pdata->in_conns[i]->src_dev;
>>> + if (!in_csdev)
>>> + break;
>>> +
>>> + if (parent)
>>> + if (csdev->pdata->in_conns[i]->dest_port != inport)
>>> + continue;
>
> The above can become :
>
> if (match_inport &&
> csdev->pdata->in_conns[i]->dest_port != inport)
> continue;
Sure, I will update this in the next patch series.
Best,
Tao
>
> Suzuki
>
Powered by blists - more mailing lists