mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] coresight: tpda: fix the logic to setup the element size
@ 2025-09-05 23:53 Jie Gan
  2025-09-10 16:26 ` Suzuki K Poulose
  0 siblings, 1 reply; 2+ messages in thread
From: Jie Gan @ 2025-09-05 23:53 UTC (permalink / raw)
  To: Suzuki K Poulose, Mike Leach, James Clark, Alexander Shishkin,
	Tingwei Zhang, Mao Jinlong, Tao Zhang
  Cc: coresight, linux-arm-kernel, linux-kernel, linux-arm-msm, Jie Gan

Some TPDM devices support both CMB and DSB datasets, requiring
the system to enable the port with both corresponding element sizes.

Currently, the logic treats tpdm_read_element_size as successful if
the CMB element size is retrieved correctly, regardless of whether
the DSB element size is obtained. This behavior causes issues
when parsing data from TPDM devices that depend on both element sizes.

To address this, the function should explicitly fail if the DSB
element size cannot be read correctly.

Fixes: e6d7f5252f73 ("coresight-tpda: Add support to configure CMB element")
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Jie Gan <jie.gan@oss.qualcomm.com>
---
Changes in V2:
1. rebased the patch.
2. Add James's reviewed-by tag.
Link to V1 - https://lore.kernel.org/all/20250806080931.14322-1-jie.gan@oss.qualcomm.com/
---
 drivers/hwtracing/coresight/coresight-tpda.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/hwtracing/coresight/coresight-tpda.c b/drivers/hwtracing/coresight/coresight-tpda.c
index 0633f04beb24..333b3cb23685 100644
--- a/drivers/hwtracing/coresight/coresight-tpda.c
+++ b/drivers/hwtracing/coresight/coresight-tpda.c
@@ -71,6 +71,8 @@ static int tpdm_read_element_size(struct tpda_drvdata *drvdata,
 	if (tpdm_data->dsb) {
 		rc = fwnode_property_read_u32(dev_fwnode(csdev->dev.parent),
 				"qcom,dsb-element-bits", &drvdata->dsb_esize);
+		if (rc)
+			goto out;
 	}
 
 	if (tpdm_data->cmb) {
@@ -78,6 +80,7 @@ static int tpdm_read_element_size(struct tpda_drvdata *drvdata,
 				"qcom,cmb-element-bits", &drvdata->cmb_esize);
 	}
 
+out:
 	if (rc)
 		dev_warn_once(&csdev->dev,
 			"Failed to read TPDM Element size: %d\n", rc);

---
base-commit: 5d50cf9f7cf20a17ac469c20a2e07c29c1f6aab7
change-id: 20250906-fix_element_size_issue-e740086291fa

Best regards,
-- 
Jie Gan <jie.gan@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] coresight: tpda: fix the logic to setup the element size
  2025-09-05 23:53 [PATCH v2] coresight: tpda: fix the logic to setup the element size Jie Gan
@ 2025-09-10 16:26 ` Suzuki K Poulose
  0 siblings, 0 replies; 2+ messages in thread
From: Suzuki K Poulose @ 2025-09-10 16:26 UTC (permalink / raw)
  To: Mike Leach, James Clark, Alexander Shishkin, Tingwei Zhang,
	Mao Jinlong, Tao Zhang, Jie Gan
  Cc: Suzuki K Poulose, coresight, linux-arm-kernel, linux-kernel,
	linux-arm-msm


On Sat, 06 Sep 2025 07:53:04 +0800, Jie Gan wrote:
> Some TPDM devices support both CMB and DSB datasets, requiring
> the system to enable the port with both corresponding element sizes.
> 
> Currently, the logic treats tpdm_read_element_size as successful if
> the CMB element size is retrieved correctly, regardless of whether
> the DSB element size is obtained. This behavior causes issues
> when parsing data from TPDM devices that depend on both element sizes.
> 
> [...]

Applied, thanks!

[1/1] coresight: tpda: fix the logic to setup the element size
      https://git.kernel.org/coresight/c/fd6974c19eb3

Best regards,
-- 
Suzuki K Poulose <suzuki.poulose@arm.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-10 16:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-05 23:53 [PATCH v2] coresight: tpda: fix the logic to setup the element size Jie Gan
2025-09-10 16:26 ` Suzuki K Poulose

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®