From: Tao Zhang <quic_taozha@quicinc.com> To: Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Konrad Dybcio <konradybcio@gmail.com>, Mike Leach <mike.leach@linaro.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> Cc: Tao Zhang <quic_taozha@quicinc.com>, Jinlong Mao <quic_jinlmao@quicinc.com>, Leo Yan <leo.yan@linaro.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.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>, <andersson@kernel.org> Subject: [PATCH 4/4] coresight-tpda: Add support multi-port input on TPDA Date: Thu, 21 Mar 2024 16:32:07 +0800 [thread overview] Message-ID: <1711009927-17873-5-git-send-email-quic_taozha@quicinc.com> (raw) In-Reply-To: <1711009927-17873-1-git-send-email-quic_taozha@quicinc.com> Since the funnel supports multi-port output scenarios, there may be more than one TPDM connected to one TPDA input port. In this way, when reading the element size of the TPDM, TPDA driver needs to find the correct TPDM corresponding to the input port. When TPDA finds a TPDM on an input port, it read the device tree of the TPDM and finds the configured TPDA input port number. If it is the same as the input port number passed into the function, then it is the correct TPDM that needs to be found. Signed-off-by: Tao Zhang <quic_taozha@quicinc.com> --- drivers/hwtracing/coresight/coresight-tpda.c | 27 +++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-tpda.c b/drivers/hwtracing/coresight/coresight-tpda.c index 52b0201090fb..ba71e1ff18e3 100644 --- a/drivers/hwtracing/coresight/coresight-tpda.c +++ b/drivers/hwtracing/coresight/coresight-tpda.c @@ -84,6 +84,26 @@ static int tpdm_read_element_size(struct tpda_drvdata *drvdata, return rc; } +/* + * Check if the parameter of the input port number in "tpda_get_element_size" + * is the same as the property of the TPDA input port number defined in the device + * tree. + * Return true if they are the same or the property is not read. + * Otherwise, return false. + */ +static bool is_tpda_inport_matched(struct coresight_device *csdev, u32 tpda_inport) +{ + int rc = -EINVAL; + u32 inport_nr; + + rc = fwnode_property_read_u32(dev_fwnode(csdev->dev.parent), + "qcom,tpda-input-port", &inport_nr); + if (!rc) + return (inport_nr == tpda_inport); + + return true; +} + /* * Search and read element data size from the TPDM node in * the devicetree. Each input port of TPDA is connected to @@ -99,6 +119,10 @@ static int tpda_get_element_size(struct tpda_drvdata *drvdata, int rc = 0; int i; struct coresight_device *in; + static u32 tpda_inport; + + if (inport != -1) + tpda_inport = inport; for (i = 0; i < csdev->pdata->nr_inconns; i++) { in = csdev->pdata->in_conns[i]->src_dev; @@ -110,7 +134,8 @@ 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) && + (is_tpda_inport_matched(in, tpda_inport))) { if (drvdata->dsb_esize || drvdata->cmb_esize) return -EEXIST; rc = tpdm_read_element_size(drvdata, in); -- 2.17.1
WARNING: multiple messages have this Message-ID (diff)
From: Tao Zhang <quic_taozha@quicinc.com> To: Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Konrad Dybcio <konradybcio@gmail.com>, Mike Leach <mike.leach@linaro.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> Cc: Tao Zhang <quic_taozha@quicinc.com>, Jinlong Mao <quic_jinlmao@quicinc.com>, Leo Yan <leo.yan@linaro.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.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>, <andersson@kernel.org> Subject: [PATCH 4/4] coresight-tpda: Add support multi-port input on TPDA Date: Thu, 21 Mar 2024 16:32:07 +0800 [thread overview] Message-ID: <1711009927-17873-5-git-send-email-quic_taozha@quicinc.com> (raw) In-Reply-To: <1711009927-17873-1-git-send-email-quic_taozha@quicinc.com> Since the funnel supports multi-port output scenarios, there may be more than one TPDM connected to one TPDA input port. In this way, when reading the element size of the TPDM, TPDA driver needs to find the correct TPDM corresponding to the input port. When TPDA finds a TPDM on an input port, it read the device tree of the TPDM and finds the configured TPDA input port number. If it is the same as the input port number passed into the function, then it is the correct TPDM that needs to be found. Signed-off-by: Tao Zhang <quic_taozha@quicinc.com> --- drivers/hwtracing/coresight/coresight-tpda.c | 27 +++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-tpda.c b/drivers/hwtracing/coresight/coresight-tpda.c index 52b0201090fb..ba71e1ff18e3 100644 --- a/drivers/hwtracing/coresight/coresight-tpda.c +++ b/drivers/hwtracing/coresight/coresight-tpda.c @@ -84,6 +84,26 @@ static int tpdm_read_element_size(struct tpda_drvdata *drvdata, return rc; } +/* + * Check if the parameter of the input port number in "tpda_get_element_size" + * is the same as the property of the TPDA input port number defined in the device + * tree. + * Return true if they are the same or the property is not read. + * Otherwise, return false. + */ +static bool is_tpda_inport_matched(struct coresight_device *csdev, u32 tpda_inport) +{ + int rc = -EINVAL; + u32 inport_nr; + + rc = fwnode_property_read_u32(dev_fwnode(csdev->dev.parent), + "qcom,tpda-input-port", &inport_nr); + if (!rc) + return (inport_nr == tpda_inport); + + return true; +} + /* * Search and read element data size from the TPDM node in * the devicetree. Each input port of TPDA is connected to @@ -99,6 +119,10 @@ static int tpda_get_element_size(struct tpda_drvdata *drvdata, int rc = 0; int i; struct coresight_device *in; + static u32 tpda_inport; + + if (inport != -1) + tpda_inport = inport; for (i = 0; i < csdev->pdata->nr_inconns; i++) { in = csdev->pdata->in_conns[i]->src_dev; @@ -110,7 +134,8 @@ 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) && + (is_tpda_inport_matched(in, tpda_inport))) { if (drvdata->dsb_esize || drvdata->cmb_esize) return -EEXIST; rc = tpdm_read_element_size(drvdata, in); -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-03-21 8:33 UTC|newest] Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-03-21 8:32 [PATCH 0/4] Add support for multi-port output on the funnel Tao Zhang 2024-03-21 8:32 ` Tao Zhang 2024-03-21 8:32 ` [PATCH 1/4] dt-bindings: arm: qcom,coresight-funnel: Add label for multi-ouput Tao Zhang 2024-03-21 8:32 ` Tao Zhang 2024-03-21 14:42 ` Rob Herring 2024-03-21 14:42 ` Rob Herring 2024-03-21 14:52 ` Suzuki K Poulose 2024-03-21 14:52 ` Suzuki K Poulose 2024-03-22 7:02 ` Tingwei Zhang 2024-03-22 7:02 ` Tingwei Zhang 2024-03-22 9:42 ` Suzuki K Poulose 2024-03-22 9:42 ` Suzuki K Poulose 2024-03-22 10:22 ` Tingwei Zhang 2024-03-22 10:22 ` Tingwei Zhang 2024-03-21 8:32 ` [PATCH 2/4] coresight: Add support for multiple output ports on the funnel Tao Zhang 2024-03-21 8:32 ` Tao Zhang 2024-03-21 16:41 ` Suzuki K Poulose 2024-03-21 16:41 ` Suzuki K Poulose 2024-03-29 9:27 ` Tao Zhang 2024-03-29 9:27 ` Tao Zhang 2024-04-08 13:28 ` Mike Leach 2024-04-08 13:28 ` Mike Leach 2024-04-09 7:13 ` Suzuki K Poulose 2024-04-09 7:13 ` Suzuki K Poulose 2024-04-09 13:22 ` Tao Zhang 2024-04-09 13:22 ` Tao Zhang 2024-04-15 13:24 ` Suzuki K Poulose 2024-04-15 13:24 ` Suzuki K Poulose 2024-04-16 14:19 ` Mike Leach 2024-04-16 14:19 ` Mike Leach 2024-04-17 9:21 ` Suzuki K Poulose 2024-04-17 9:21 ` Suzuki K Poulose 2024-04-18 8:48 ` Mike Leach 2024-04-18 8:48 ` Mike Leach 2024-04-18 8:59 ` Suzuki K Poulose 2024-04-18 8:59 ` Suzuki K Poulose 2024-04-18 9:25 ` Mike Leach 2024-04-18 9:25 ` Mike Leach 2024-04-18 12:01 ` Tingwei Zhang 2024-04-18 12:01 ` Tingwei Zhang 2024-04-18 12:38 ` Suzuki K Poulose 2024-04-18 12:38 ` Suzuki K Poulose 2024-04-19 2:11 ` Tingwei Zhang 2024-04-19 2:11 ` Tingwei Zhang 2024-03-21 8:32 ` [PATCH 3/4] dt-bindings: arm: qcom,coresight-tpdm: Mark tpda input port number Tao Zhang 2024-03-21 8:32 ` Tao Zhang 2024-03-21 8:32 ` Tao Zhang [this message] 2024-03-21 8:32 ` [PATCH 4/4] coresight-tpda: Add support multi-port input on TPDA 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=1711009927-17873-5-git-send-email-quic_taozha@quicinc.com \ --to=quic_taozha@quicinc.com \ --cc=alexander.shishkin@linux.intel.com \ --cc=andersson@kernel.org \ --cc=coresight@lists.linaro.org \ --cc=devicetree@vger.kernel.org \ --cc=gregkh@linuxfoundation.org \ --cc=konradybcio@gmail.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_jinlmao@quicinc.com \ --cc=quic_songchai@quicinc.com \ --cc=quic_tingweiz@quicinc.com \ --cc=quic_tsoni@quicinc.com \ --cc=quic_yuanfang@quicinc.com \ --cc=robh+dt@kernel.org \ --cc=suzuki.poulose@arm.com \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.