Skip to content

Commit 7cd6368

Browse files
james-c-linaroSuzuki K Poulose
authored andcommitted
coresight: Clear self hosted claim tag on probe
This can be left behind from a crashed kernel after a kexec so clear it when probing each device. Clearing the self hosted bit even when claimed externally is harmless, so do it unconditionally. Reviewed-by: Leo Yan <[email protected]> Reviewed-by: Yeoreum Yun <[email protected]> Signed-off-by: James Clark <[email protected]> Signed-off-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a1b0e77 commit 7cd6368

File tree

8 files changed

+11
-0
lines changed

8 files changed

+11
-0
lines changed

drivers/hwtracing/coresight/coresight-catu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ static int __catu_probe(struct device *dev, struct resource *res)
567567
catu_desc.subtype.helper_subtype = CORESIGHT_DEV_SUBTYPE_HELPER_CATU;
568568
catu_desc.ops = &catu_ops;
569569

570+
coresight_clear_self_claim_tag(&catu_desc.access);
570571
drvdata->csdev = coresight_register(&catu_desc);
571572
if (IS_ERR(drvdata->csdev))
572573
ret = PTR_ERR(drvdata->csdev);

drivers/hwtracing/coresight/coresight-cti-core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,8 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id)
931931
cti_desc.ops = &cti_ops;
932932
cti_desc.groups = drvdata->ctidev.con_groups;
933933
cti_desc.dev = dev;
934+
935+
coresight_clear_self_claim_tag(&cti_desc.access);
934936
drvdata->csdev = coresight_register(&cti_desc);
935937
if (IS_ERR(drvdata->csdev)) {
936938
ret = PTR_ERR(drvdata->csdev);

drivers/hwtracing/coresight/coresight-etb10.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,8 @@ static int etb_probe(struct amba_device *adev, const struct amba_id *id)
772772
desc.pdata = pdata;
773773
desc.dev = dev;
774774
desc.groups = coresight_etb_groups;
775+
776+
coresight_clear_self_claim_tag(&desc.access);
775777
drvdata->csdev = coresight_register(&desc);
776778
if (IS_ERR(drvdata->csdev))
777779
return PTR_ERR(drvdata->csdev);

drivers/hwtracing/coresight/coresight-etm3x-core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ static void etm_init_arch_data(void *info)
764764
drvdata->nr_ext_out = BMVAL(etmccr, 20, 22);
765765
drvdata->nr_ctxid_cmp = BMVAL(etmccr, 24, 25);
766766

767+
coresight_clear_self_claim_tag_unlocked(&drvdata->csa);
767768
etm_set_pwrdwn(drvdata);
768769
etm_clr_pwrup(drvdata);
769770
CS_LOCK(drvdata->csa.base);

drivers/hwtracing/coresight/coresight-etm4x-core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,6 +1372,8 @@ static void etm4_init_arch_data(void *info)
13721372
drvdata->nrseqstate = FIELD_GET(TRCIDR5_NUMSEQSTATE_MASK, etmidr5);
13731373
/* NUMCNTR, bits[30:28] number of counters available for tracing */
13741374
drvdata->nr_cntr = FIELD_GET(TRCIDR5_NUMCNTR_MASK, etmidr5);
1375+
1376+
coresight_clear_self_claim_tag_unlocked(csa);
13751377
etm4_cs_lock(drvdata, csa);
13761378
cpu_detect_trace_filtering(drvdata);
13771379
}

drivers/hwtracing/coresight/coresight-funnel.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ static int funnel_probe(struct device *dev, struct resource *res)
255255
drvdata->base = base;
256256
desc.groups = coresight_funnel_groups;
257257
desc.access = CSDEV_ACCESS_IOMEM(base);
258+
coresight_clear_self_claim_tag(&desc.access);
258259
}
259260

260261
dev_set_drvdata(dev, drvdata);

drivers/hwtracing/coresight/coresight-replicator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ static int replicator_probe(struct device *dev, struct resource *res)
284284
desc.pdata = dev->platform_data;
285285
desc.dev = dev;
286286

287+
coresight_clear_self_claim_tag(&desc.access);
287288
drvdata->csdev = coresight_register(&desc);
288289
if (IS_ERR(drvdata->csdev)) {
289290
ret = PTR_ERR(drvdata->csdev);

drivers/hwtracing/coresight/coresight-tmc-core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ static int __tmc_probe(struct device *dev, struct resource *res)
869869
dev->platform_data = pdata;
870870
desc.pdata = pdata;
871871

872+
coresight_clear_self_claim_tag(&desc.access);
872873
drvdata->csdev = coresight_register(&desc);
873874
if (IS_ERR(drvdata->csdev)) {
874875
ret = PTR_ERR(drvdata->csdev);

0 commit comments

Comments
 (0)