Re: [PATCH v5 4/7] coresight-tgu: Add TGU decode support
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Date: 2025-05-29 11:32:09
Also in:
linux-arm-msm, linux-devicetree, lkml
On Thu, 29 May 2025 16:19:45 +0800 Songwei Chai [off-list ref] wrote:
Decoding is when all the potential pieces for creating a trigger are brought together for a given step. Example - there may be a counter keeping track of some occurrences and a priority-group that is being used to detect a pattern on the sense inputs. These 2 inputs to condition_decode must be programmed, for a given step, to establish the condition for the trigger, or movement to another steps. Signed-off-by: Songwei Chai <redacted>
quoted hunk ↗ jump to hunk
diff --git a/drivers/hwtracing/coresight/coresight-tgu.c b/drivers/hwtracing/coresight/coresight-tgu.c index 6dbfd4c604b1..8dbe8ab30174 100644 --- a/drivers/hwtracing/coresight/coresight-tgu.c +++ b/drivers/hwtracing/coresight/coresight-tgu.c@@ -21,13 +21,35 @@ static int calculate_array_location(struct tgu_drvdata *drvdata,
+
static int tgu_enable(struct coresight_device *csdev, enum cs_mode mode,
void *data)
{
+ int ret = 0;From what can be seen here, looks like ret is always set, so no need to init.
quoted hunk ↗ jump to hunk
struct tgu_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); spin_lock(&drvdata->spinlock);@@ -150,11 +264,15 @@ static int tgu_enable(struct coresight_device *csdev, enum cs_mode mode, spin_unlock(&drvdata->spinlock); return -EBUSY; } - tgu_write_all_hw_regs(drvdata); + ret = tgu_write_all_hw_regs(drvdata); + + if (ret == -EINVAL) + goto exit; drvdata->enable = true; +exit: spin_unlock(&drvdata->spinlock); - return 0; + return ret; }
quoted hunk ↗ jump to hunk
diff --git a/drivers/hwtracing/coresight/coresight-tgu.h b/drivers/hwtracing/coresight/coresight-tgu.h index f07ead505365..691da393ffa3 100644 --- a/drivers/hwtracing/coresight/coresight-tgu.h +++ b/drivers/hwtracing/coresight/coresight-tgu.h
enum operation_index {
TGU_PRIORITY0,
TGU_PRIORITY1,
TGU_PRIORITY2,
- TGU_PRIORITY3
+ TGU_PRIORITY3,And here is why the previous patch should definitely have had the ,
+ TGU_CONDITION_DECODE };