Commit c5ff7344 authored by Mathieu Poirier's avatar Mathieu Poirier Committed by Greg Kroah-Hartman

coresight: tmc-etr: Introduce the notion of IDR to ETR devices

In CPU-wide scenarios with an N:1 source/sink topology, sources share
the same sink.  In order to reuse the same sink for all sources an
IDR is needed to archive events that have already been accounted for.
Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Tested-by: default avatarLeo Yan <leo.yan@linaro.org>
Tested-by: default avatarRobert Walker <robert.walker@arm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 57549999
...@@ -8,10 +8,12 @@ ...@@ -8,10 +8,12 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/idr.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/mutex.h>
#include <linux/property.h> #include <linux/property.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -450,6 +452,8 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -450,6 +452,8 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id)
coresight_get_uci_data(id)); coresight_get_uci_data(id));
if (ret) if (ret)
goto out; goto out;
idr_init(&drvdata->idr);
mutex_init(&drvdata->idr_mutex);
break; break;
case TMC_CONFIG_TYPE_ETF: case TMC_CONFIG_TYPE_ETF:
desc.type = CORESIGHT_DEV_TYPE_LINKSINK; desc.type = CORESIGHT_DEV_TYPE_LINKSINK;
......
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
#define _CORESIGHT_TMC_H #define _CORESIGHT_TMC_H
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/idr.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/mutex.h>
#include <linux/refcount.h> #include <linux/refcount.h>
#define TMC_RSZ 0x004 #define TMC_RSZ 0x004
...@@ -173,6 +175,8 @@ struct etr_buf { ...@@ -173,6 +175,8 @@ struct etr_buf {
* @trigger_cntr: amount of words to store after a trigger. * @trigger_cntr: amount of words to store after a trigger.
* @etr_caps: Bitmask of capabilities of the TMC ETR, inferred from the * @etr_caps: Bitmask of capabilities of the TMC ETR, inferred from the
* device configuration register (DEVID) * device configuration register (DEVID)
* @idr: Holds etr_bufs allocated for this ETR.
* @idr_mutex: Access serialisation for idr.
* @perf_data: PERF buffer for ETR. * @perf_data: PERF buffer for ETR.
* @sysfs_data: SYSFS buffer for ETR. * @sysfs_data: SYSFS buffer for ETR.
*/ */
...@@ -194,6 +198,8 @@ struct tmc_drvdata { ...@@ -194,6 +198,8 @@ struct tmc_drvdata {
enum tmc_mem_intf_width memwidth; enum tmc_mem_intf_width memwidth;
u32 trigger_cntr; u32 trigger_cntr;
u32 etr_caps; u32 etr_caps;
struct idr idr;
struct mutex idr_mutex;
struct etr_buf *sysfs_buf; struct etr_buf *sysfs_buf;
void *perf_data; void *perf_data;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment