Hi Mike,
On 09/01/2019 22:54, Mike Leach wrote:
Adds in code to the CoreSight core to prepare for the addition of the CTI driver.
Adds functionality to add cross reference association between CTI and other CoreSight devices.
Adds functionality to enable associated CTI when CoreSight devices are enabled by the trace path code.
Signed-off-by: Mike Leach mike.leach@linaro.org
drivers/hwtracing/coresight/coresight.c | 51 ++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-)
diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c index 2b0df1a0a8df..01ad708ca7a7 100644 --- a/drivers/hwtracing/coresight/coresight.c +++ b/drivers/hwtracing/coresight/coresight.c @@ -214,6 +214,36 @@ void coresight_disclaim_device(void __iomem *base) CS_LOCK(base); } +/* enable or disable an associated CTI device of the supplied CS device */ +static void +coresight_control_assoc_ectdev(struct coresight_device *csdev, int enable) +{
- int ect_ret = 0;
- struct coresight_device *ect_csdev = csdev->ect_dev;
- if (!ect_csdev)
return;
- if (enable) {
if (ect_ops(ect_csdev)->enable)
ect_ret = ect_ops(ect_csdev)->enable(ect_csdev, NULL);
- } else {
if (ect_ops(ect_csdev)->disable)
ect_ret = ect_ops(ect_csdev)->disable(ect_csdev, NULL);
- }
- dev_info(&csdev->dev, "%s assoc CTI %s for %s\n",
enable ? "Enabling" : "Disabling",
dev_name(&ect_csdev->dev), dev_name(&csdev->dev));
- /* even if the control failed - we don't want to fail possible trace
* capture.
*/
- if (ect_ret)
dev_info(&csdev->dev, "Associated ECT device (%s) %s failed\n",
dev_name(&ect_csdev->dev), enable ? "enable" : "disable");
+}
As I mentioned in the previous patch, if you make this a subtype of helper device, this should all be done automatically if it is "connected" to any of the devices that appear in the path, which I think is the way to go.
Thoughts ? Suzuki