mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 05:17:10 +09:00
UPSTREAM: coresight: tmc-etr: Introduce the notion of IDR to ETR devices
(Upstream commit c5ff734462).
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: Mathieu Poirier <mathieu.poirier@linaro.org>
Tested-by: Leo Yan <leo.yan@linaro.org>
Tested-by: Robert Walker <robert.walker@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 140266694
Change-Id: I09fb662438059a858e4208cbb065bee3b1181d94
Signed-off-by: Yabin Cui <yabinc@google.com>
This commit is contained in:
committed by
Yabin Cui
parent
e6bc81eab3
commit
39e1830cfc
@@ -8,10 +8,12 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/idr.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/slab.h>
|
||||
@@ -449,6 +451,8 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id)
|
||||
ret = tmc_etr_setup_caps(drvdata, devid, id->data);
|
||||
if (ret)
|
||||
goto out;
|
||||
idr_init(&drvdata->idr);
|
||||
mutex_init(&drvdata->idr_mutex);
|
||||
break;
|
||||
case TMC_CONFIG_TYPE_ETF:
|
||||
desc.type = CORESIGHT_DEV_TYPE_LINKSINK;
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
#define _CORESIGHT_TMC_H
|
||||
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/idr.h>
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/refcount.h>
|
||||
|
||||
#define TMC_RSZ 0x004
|
||||
@@ -173,6 +175,8 @@ struct etr_buf {
|
||||
* @trigger_cntr: amount of words to store after a trigger.
|
||||
* @etr_caps: Bitmask of capabilities of the TMC ETR, inferred from the
|
||||
* device configuration register (DEVID)
|
||||
* @idr: Holds etr_bufs allocated for this ETR.
|
||||
* @idr_mutex: Access serialisation for idr.
|
||||
* @perf_data: PERF buffer for ETR.
|
||||
* @sysfs_data: SYSFS buffer for ETR.
|
||||
*/
|
||||
@@ -194,6 +198,8 @@ struct tmc_drvdata {
|
||||
enum tmc_mem_intf_width memwidth;
|
||||
u32 trigger_cntr;
|
||||
u32 etr_caps;
|
||||
struct idr idr;
|
||||
struct mutex idr_mutex;
|
||||
struct etr_buf *sysfs_buf;
|
||||
void *perf_data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user