Skip to content

Commit e6b64cd

Browse files
Jie GanSuzuki K Poulose
authored andcommitted
Coresight: Set correct cs_mode for dummy source 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 dummy source device is always set to CS_MODE_DISABLED, resulting in the check consistently failing. As a result, dummy source cannot be properly disabled. Configure CS_MODE_SYSFS/CS_MODE_PERF during the enablement. Configure CS_MODE_DISABLED during the disablement. Fixes: 9d3ba0b ("Coresight: Add coresight dummy 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 14f5fa9 commit e6b64cd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/hwtracing/coresight/coresight-dummy.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ DEFINE_CORESIGHT_DEVLIST(sink_devs, "dummy_sink");
2323
static int dummy_source_enable(struct coresight_device *csdev,
2424
struct perf_event *event, enum cs_mode mode)
2525
{
26+
if (!coresight_take_mode(csdev, mode))
27+
return -EBUSY;
28+
2629
dev_dbg(csdev->dev.parent, "Dummy source enabled\n");
2730

2831
return 0;
@@ -31,6 +34,7 @@ static int dummy_source_enable(struct coresight_device *csdev,
3134
static void dummy_source_disable(struct coresight_device *csdev,
3235
struct perf_event *event)
3336
{
37+
coresight_set_mode(csdev, CS_MODE_DISABLED);
3438
dev_dbg(csdev->dev.parent, "Dummy source disabled\n");
3539
}
3640

0 commit comments

Comments
 (0)