On 19/04/18 02:24, Kim Phillips wrote:
On Wed, 18 Apr 2018 16:22:19 +0100 Suzuki K Poulose Suzuki.Poulose@arm.com wrote:
On 14/04/18 00:15, Kim Phillips wrote:
diff --git a/drivers/hwtracing/coresight/coresight-dynamic-replicator.c b/drivers/hwtracing/coresight/coresight-dynamic-replicator.c +MODULE_AUTHOR("Suzuki K Poulose suzuki.poulose@arm.com");
I just renamed the file, didn't author this driver. May be it was Pratik who wrote the original version.
Thanks, changed to Pratik, based on this commit:
commit 620cf787c121f39b5223e43bad3d1b7c66ecead5 Author: Pratik Patel pratikp@codeaurora.org Date: Tue May 19 10:55:21 2015 -0600
coresight: replicator: Add Qualcomm CoreSight Replicator driver
diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c +static int __exit tmc_remove(struct amba_device *adev) +{
- struct tmc_drvdata *drvdata = dev_get_drvdata(&adev->dev);
- misc_deregister(&drvdata->miscdev);
- coresight_unregister(drvdata->csdev);
- return 0;
+}
I think we may need to free the "buffer" used by the TMC-ETR if it is lying around to be collected for sysfs mode.
You mean:
misc_deregister->tmc_release->tmc_read_unprepare->tmc_read_unprepare_etr->dma_free_coherent ^ this 'release' call doesn't occur?
I think so. tmc_release would be called when somebody close() /dev/misc_dev, following an open. Similarly, now when I look at it, we do kzalloc() for tmc_etf/etb buffer. We should either free it or move it to devm_kzalloc().
OK, so something like this will hopefully fix it?:
diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c index 553885db2daa..7e7a19a22368 100644 --- a/drivers/hwtracing/coresight/coresight-tmc.c +++ b/drivers/hwtracing/coresight/coresight-tmc.c @@ -441,6 +441,10 @@ static int __exit tmc_remove(struct amba_device *adev) { struct tmc_drvdata *drvdata = dev_get_drvdata(&adev->dev);
if (drvdata->vaddr)
dma_free_coherent(drvdata->dev, drvdata->size,
drvdata->vaddr, drvdata->paddr);
That should be sufficient. But please be aware that all of this is changing with my ETR transparent buffer series, whose v2 is currenty under test.
Cheers Suzuki