Skip to content

Commit 14f5fa9

Browse files
Jie GanSuzuki K Poulose
authored andcommitted
Coresight: Set correct cs_mode for TPDM to fix disable issue
The coresight_disable_source_sysfs function should verify the mode of the coresight device before disabling the source. However, the mode for the TPDM device is always set to CS_MODE_DISABLED, resulting in the check consistently failing. As a result, TPDM cannot be properly disabled. Configure CS_MODE_SYSFS/CS_MODE_PERF during the enablement. Configure CS_MODE_DISABLED during the disablement. Fixes: b3c7162 ("Coresight: Add coresight TPDM source driver") Signed-off-by: Jie Gan <[email protected]> Signed-off-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent daca644 commit 14f5fa9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/hwtracing/coresight/coresight-tpdm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,11 @@ static int tpdm_enable(struct coresight_device *csdev, struct perf_event *event,
449449
return -EBUSY;
450450
}
451451

452+
if (!coresight_take_mode(csdev, mode)) {
453+
spin_unlock(&drvdata->spinlock);
454+
return -EBUSY;
455+
}
456+
452457
__tpdm_enable(drvdata);
453458
drvdata->enable = true;
454459
spin_unlock(&drvdata->spinlock);
@@ -506,6 +511,7 @@ static void tpdm_disable(struct coresight_device *csdev,
506511
}
507512

508513
__tpdm_disable(drvdata);
514+
coresight_set_mode(csdev, CS_MODE_DISABLED);
509515
drvdata->enable = false;
510516
spin_unlock(&drvdata->spinlock);
511517

0 commit comments

Comments
 (0)