On 05/04/2020 08:08 PM, Mathieu Poirier wrote:
On Fri, May 01, 2020 at 03:02:23PM +0100, Mike Leach wrote:
Add in the priority values for automatic default sink selection.
ETR are set to the highest priority, ETB and ETF a lower priority.
This will ensure the first ETR found is selected in preference to the first ETB / ETF found. ETB / ETF only used if no ETR present.
Signed-off-by: Mike Leach mike.leach@linaro.org
drivers/hwtracing/coresight/coresight-tmc.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c index 1cf82fa58289..99296b061279 100644 --- a/drivers/hwtracing/coresight/coresight-tmc.c +++ b/drivers/hwtracing/coresight/coresight-tmc.c @@ -442,6 +442,8 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) struct resource *res = &adev->res; struct coresight_desc desc = { 0 }; struct coresight_dev_list *dev_list = NULL;
- /* default sink select priority to low priority value */
- int select_priority = CORESIGHT_SINK_SELECT_PRIORITY_HI + 1;
ret = -ENOMEM; drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); @@ -493,6 +495,8 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) idr_init(&drvdata->idr); mutex_init(&drvdata->idr_mutex); dev_list = &etr_devs;
/* set ETR to highest default sink select priority */
select_priority = CORESIGHT_SINK_SELECT_PRIORITY_HI;
Like Mathieu said, we should allow room for future IPs, which may be better than ETR. So inverting the priority interpretation is better.
Suzuki