@@ -56,7 +56,7 @@ static int replicator_enable(struct coresight_device *csdev, int inport,
CS_LOCK(drvdata->base);
- dev_dbg(drvdata->dev, "REPLICATOR enabled\n");
+ coresight_dev_dbg(drvdata->dev, mode, "REPLICATOR enabled\n");
return 0;
}
@@ -75,7 +75,7 @@ static void replicator_disable(struct coresight_device *csdev, int inport,
CS_LOCK(drvdata->base);
- dev_dbg(drvdata->dev, "REPLICATOR disabled\n");
+ coresight_dev_dbg(drvdata->dev, mode, "REPLICATOR disabled\n");
}
static const struct coresight_ops_link replicator_link_ops = {
@@ -211,7 +211,7 @@ static int etb_enable(struct coresight_device *csdev, u32 mode, void *data)
if (ret)
return ret;
- dev_dbg(drvdata->dev, "ETB enabled\n");
+ coresight_dev_dbg(drvdata->dev, mode, "ETB enabled\n");
return 0;
}
@@ -320,7 +320,7 @@ static void etb_disable(struct coresight_device *csdev, u32 mode)
}
spin_unlock_irqrestore(&drvdata->spinlock, flags);
- dev_dbg(drvdata->dev, "ETB disabled\n");
+ coresight_dev_dbg(drvdata->dev, mode, "ETB disabled\n");
}
static void *etb_alloc_buffer(struct coresight_device *csdev, int cpu,
@@ -532,7 +532,7 @@ static void etb_dump(struct etb_drvdata *drvdata)
}
spin_unlock_irqrestore(&drvdata->spinlock, flags);
- dev_dbg(drvdata->dev, "ETB dumped\n");
+ coresight_dev_dbg(drvdata->dev, drvdata->mode, "ETB dumped\n");
}
static int etb_open(struct inode *inode, struct file *file)
@@ -358,10 +358,12 @@ static int etm_parse_event_config(struct etm_drvdata *drvdata,
static void etm_enable_hw(void *info)
{
int i;
- u32 etmcr;
+ u32 etmcr, mode;
struct etm_drvdata *drvdata = info;
struct etm_config *config = &drvdata->config;
+ mode = local_read(&drvdata->mode);
+
CS_UNLOCK(drvdata->base);
/* Turn engine on */
@@ -420,7 +422,8 @@ static void etm_enable_hw(void *info)
etm_clr_prog(drvdata);
CS_LOCK(drvdata->base);
- dev_dbg(drvdata->dev, "cpu: %d enable smp call done\n", drvdata->cpu);
+ coresight_dev_dbg(drvdata->dev, mode,
+ "cpu: %d enable smp call done\n", drvdata->cpu);
}
static int etm_cpu_id(struct coresight_device *csdev)
@@ -83,6 +83,7 @@ static void etm4_enable_hw(void *info)
int i;
struct etmv4_drvdata *drvdata = info;
struct etmv4_config *config = &drvdata->config;
+ u32 mode = local_read(&drvdata->mode);
CS_UNLOCK(drvdata->base);
@@ -177,7 +178,8 @@ static void etm4_enable_hw(void *info)
CS_LOCK(drvdata->base);
- dev_dbg(drvdata->dev, "cpu: %d enable smp call done\n", drvdata->cpu);
+ coresight_dev_dbg(drvdata->dev, mode,
+ "cpu: %d enable smp call done\n", drvdata->cpu);
}
static int etm4_parse_event_config(struct etmv4_drvdata *drvdata,
@@ -311,6 +313,7 @@ static void etm4_disable_hw(void *info)
{
u32 control;
struct etmv4_drvdata *drvdata = info;
+ u32 mode = local_read(&drvdata->mode);
CS_UNLOCK(drvdata->base);
@@ -331,7 +334,8 @@ static void etm4_disable_hw(void *info)
CS_LOCK(drvdata->base);
- dev_dbg(drvdata->dev, "cpu: %d disable smp call done\n", drvdata->cpu);
+ coresight_dev_dbg(drvdata->dev, mode,
+ "cpu: %d disable smp call done\n", drvdata->cpu);
}
static int etm4_disable_perf(struct coresight_device *csdev,
@@ -65,7 +65,8 @@ static int funnel_enable(struct coresight_device *csdev, int inport,
funnel_enable_hw(drvdata, inport);
- dev_dbg(drvdata->dev, "FUNNEL inport %d enabled\n", inport);
+ coresight_dev_dbg(drvdata->dev, mode,
+ "FUNNEL inport %d enabled\n", inport);
return 0;
}
@@ -89,7 +90,8 @@ static void funnel_disable(struct coresight_device *csdev, int inport,
funnel_disable_hw(drvdata, inport);
- dev_dbg(drvdata->dev, "FUNNEL inport %d disabled\n", inport);
+ coresight_dev_dbg(drvdata->dev, mode,
+ "FUNNEL inport %d disabled\n", inport);
}
static const struct coresight_ops_link funnel_link_ops = {
@@ -35,7 +35,7 @@ static int replicator_enable(struct coresight_device *csdev, int inport,
{
struct replicator_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
- dev_dbg(drvdata->dev, "REPLICATOR enabled\n");
+ coresight_dev_dbg(drvdata->dev, mode, "REPLICATOR enabled\n");
return 0;
}
@@ -44,7 +44,7 @@ static void replicator_disable(struct coresight_device *csdev, int inport,
{
struct replicator_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
- dev_dbg(drvdata->dev, "REPLICATOR disabled\n");
+ coresight_dev_dbg(drvdata->dev, mode, "REPLICATOR disabled\n");
}
static const struct coresight_ops_link replicator_link_ops = {
@@ -211,7 +211,7 @@ static int stm_enable(struct coresight_device *csdev,
stm_enable_hw(drvdata);
spin_unlock(&drvdata->spinlock);
- dev_dbg(drvdata->dev, "STM tracing enabled\n");
+ coresight_dev_dbg(drvdata->dev, mode, "STM tracing enabled\n");
return 0;
}
@@ -242,7 +242,7 @@ static int tmc_enable_etf_sink(struct coresight_device *csdev,
if (ret)
return ret;
- dev_dbg(drvdata->dev, "TMC-ETB/ETF enabled\n");
+ coresight_dev_dbg(drvdata->dev, mode, "TMC-ETB/ETF enabled\n");
return 0;
}
@@ -265,7 +265,7 @@ static void tmc_disable_etf_sink(struct coresight_device *csdev, u32 mode)
spin_unlock_irqrestore(&drvdata->spinlock, flags);
- dev_dbg(drvdata->dev, "TMC-ETB/ETF disabled\n");
+ coresight_dev_dbg(drvdata->dev, mode, "TMC-ETB/ETF disabled\n");
}
static int tmc_enable_etf_link(struct coresight_device *csdev,
@@ -284,7 +284,7 @@ static int tmc_enable_etf_link(struct coresight_device *csdev,
drvdata->mode = CS_MODE_SYSFS;
spin_unlock_irqrestore(&drvdata->spinlock, flags);
- dev_dbg(drvdata->dev, "TMC-ETF enabled\n");
+ coresight_dev_dbg(drvdata->dev, mode, "TMC-ETF enabled\n");
return 0;
}
@@ -304,7 +304,7 @@ static void tmc_disable_etf_link(struct coresight_device *csdev,
drvdata->mode = CS_MODE_DISABLED;
spin_unlock_irqrestore(&drvdata->spinlock, flags);
- dev_dbg(drvdata->dev, "TMC-ETF disabled\n");
+ coresight_dev_dbg(drvdata->dev, mode, "TMC-ETF disabled\n");
}
static void *tmc_alloc_etf_buffer(struct coresight_device *csdev, int cpu,
@@ -1383,7 +1383,7 @@ static void tmc_disable_etr_sink(struct coresight_device *csdev, u32 mode)
spin_unlock_irqrestore(&drvdata->spinlock, flags);
- dev_dbg(drvdata->dev, "TMC-ETR disabled\n");
+ coresight_dev_dbg(drvdata->dev, mode, "TMC-ETR disabled\n");
}
static const struct coresight_ops_sink tmc_etr_sink_ops = {
@@ -74,7 +74,7 @@ static int tpiu_enable(struct coresight_device *csdev, u32 mode, void *__unused)
tpiu_enable_hw(drvdata);
- dev_dbg(drvdata->dev, "TPIU enabled\n");
+ coresight_dev_dbg(drvdata->dev, mode, "TPIU enabled\n");
return 0;
}
@@ -100,7 +100,7 @@ static void tpiu_disable(struct coresight_device *csdev, u32 mode)
tpiu_disable_hw(drvdata);
- dev_dbg(drvdata->dev, "TPIU disabled\n");
+ coresight_dev_dbg(drvdata->dev, mode, "TPIU disabled\n");
}
static const struct coresight_ops_sink tpiu_sink_ops = {
Debug messages emitted during perf sessions are useless and have an habit of triggering the lockdep mechanic. As such this patch confines driver output to the sysFS mode where the establishement of paths between source and sink happens outside of an atomic context. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> --- drivers/hwtracing/coresight/coresight-dynamic-replicator.c | 4 ++-- drivers/hwtracing/coresight/coresight-etb10.c | 6 +++--- drivers/hwtracing/coresight/coresight-etm3x.c | 7 +++++-- drivers/hwtracing/coresight/coresight-etm4x.c | 8 ++++++-- drivers/hwtracing/coresight/coresight-funnel.c | 6 ++++-- drivers/hwtracing/coresight/coresight-replicator.c | 4 ++-- drivers/hwtracing/coresight/coresight-stm.c | 2 +- drivers/hwtracing/coresight/coresight-tmc-etf.c | 8 ++++---- drivers/hwtracing/coresight/coresight-tmc-etr.c | 2 +- drivers/hwtracing/coresight/coresight-tpiu.c | 4 ++-- 10 files changed, 30 insertions(+), 21 deletions(-) -- 2.7.4