mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-07 18:40:10 +00:00
Coresight: Set correct cs_mode for TPDM to fix disable issue
[ Upstream commit14f5fa9b5f] 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:b3c71626a9("Coresight: Add coresight TPDM source driver") Signed-off-by: Jie Gan <quic_jiegan@quicinc.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lore.kernel.org/r/20240812043043.2890694-1-quic_jiegan@quicinc.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ca6c500b59
commit
03b2956ce1
@@ -449,6 +449,11 @@ static int tpdm_enable(struct coresight_device *csdev, struct perf_event *event,
|
|||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!coresight_take_mode(csdev, mode)) {
|
||||||
|
spin_unlock(&drvdata->spinlock);
|
||||||
|
return -EBUSY;
|
||||||
|
}
|
||||||
|
|
||||||
__tpdm_enable(drvdata);
|
__tpdm_enable(drvdata);
|
||||||
drvdata->enable = true;
|
drvdata->enable = true;
|
||||||
spin_unlock(&drvdata->spinlock);
|
spin_unlock(&drvdata->spinlock);
|
||||||
@@ -506,6 +511,7 @@ static void tpdm_disable(struct coresight_device *csdev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
__tpdm_disable(drvdata);
|
__tpdm_disable(drvdata);
|
||||||
|
coresight_set_mode(csdev, CS_MODE_DISABLED);
|
||||||
drvdata->enable = false;
|
drvdata->enable = false;
|
||||||
spin_unlock(&drvdata->spinlock);
|
spin_unlock(&drvdata->spinlock);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user