diff --git a/Documentation/devicetree/bindings/coresight/coresight.txt b/Documentation/devicetree/bindings/coresight/coresight.txt index b3037d8ddad..96359726e2c 100644 --- a/Documentation/devicetree/bindings/coresight/coresight.txt +++ b/Documentation/devicetree/bindings/coresight/coresight.txt @@ -33,6 +33,8 @@ Optional properties: - coresight-default-sink : represents the default compile time CoreSight sink - qcom,pc-save : program counter save implemented - qcom,blk-size : block size for tmc-etr to usb transfers +- qcom,round-robin : indicates if per core etms are allowed round-robin access + by the funnel Examples: @@ -106,4 +108,5 @@ Examples: coresight-child-list = <&funnel_kpss>; coresight-child-ports = <0>; qcom,pc-save; + qcom,round-robin; }; diff --git a/drivers/coresight/coresight-etm.c b/drivers/coresight/coresight-etm.c index 01a71e9f40c..4d77e34182b 100644 --- a/drivers/coresight/coresight-etm.c +++ b/drivers/coresight/coresight-etm.c @@ -256,6 +256,7 @@ struct etm_drvdata { bool pcsave_enable; bool pcsave_sticky_enable; bool pcsave_boot_enable; + bool round_robin; }; static struct etm_drvdata *etmdrvdata[NR_CPUS]; @@ -1845,7 +1846,7 @@ static int etm_cpu_callback(struct notifier_block *nfb, unsigned long action, etmdrvdata[cpu]->os_unlock = true; } - if (etmdrvdata[cpu]->enable) + if (etmdrvdata[cpu]->enable && etmdrvdata[cpu]->round_robin) __etm_enable(etmdrvdata[cpu]); spin_unlock(&etmdrvdata[cpu]->spinlock); break; @@ -1858,7 +1859,7 @@ static int etm_cpu_callback(struct notifier_block *nfb, unsigned long action, case CPU_DYING: spin_lock(&etmdrvdata[cpu]->spinlock); - if (etmdrvdata[cpu]->enable) + if (etmdrvdata[cpu]->enable && etmdrvdata[cpu]->round_robin) __etm_disable(etmdrvdata[cpu]); spin_unlock(&etmdrvdata[cpu]->spinlock); break; @@ -2099,6 +2100,10 @@ static int __devinit etm_probe(struct platform_device *pdev) clk_disable_unprepare(drvdata->clk); + if (pdev->dev.of_node) + drvdata->round_robin = of_property_read_bool(pdev->dev.of_node, + "qcom,round-robin"); + baddr = devm_kzalloc(dev, PAGE_SIZE + reg_size, GFP_KERNEL); if (baddr) { *(uint32_t *)(baddr + ETM_REG_DUMP_VER_OFF) = ETM_REG_DUMP_VER;