Skip to content

Commit 43e0a92

Browse files
jiegan0107Suzuki K Poulose
authored andcommitted
coresight: tpda: fix the logic to setup the element size
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: e6d7f52 ("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> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lore.kernel.org/r/20250906-fix_element_size_issue-v2-1-dbb0ac2541a9@oss.qualcomm.com
1 parent 8a55c16 commit 43e0a92

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/hwtracing/coresight/coresight-tpda.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,16 @@ static int tpdm_read_element_size(struct tpda_drvdata *drvdata,
7171
if (tpdm_data->dsb) {
7272
rc = fwnode_property_read_u32(dev_fwnode(csdev->dev.parent),
7373
"qcom,dsb-element-bits", &drvdata->dsb_esize);
74+
if (rc)
75+
goto out;
7476
}
7577

7678
if (tpdm_data->cmb) {
7779
rc = fwnode_property_read_u32(dev_fwnode(csdev->dev.parent),
7880
"qcom,cmb-element-bits", &drvdata->cmb_esize);
7981
}
8082

83+
out:
8184
if (rc)
8285
dev_warn_once(&csdev->dev,
8386
"Failed to read TPDM Element size: %d\n", rc);

0 commit comments

Comments
 (0)