coresight: replicator: Reset replicator if context is lost
Subsystems (3)
PATCH 1/1 coresight: replicator: Reset replicator if context is lost
On some QCOM SoCs, replicators in Always-On domain loses its context as soon as the clock is disabled. Currently as a part of pm_runtime workqueue, clock is disabled after the replicator is initialized by amba_pm_runtime_suspend assuming that context is not lost which is not true for replicators with such limitations. Hence check the replicator idfilter registers in dynamic_replicator_enable() and reset again.
---
More info here - https://lore.kernel.org/patchwork/patch/1231182/
--- drivers/hwtracing/coresight/coresight-replicator.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/hwtracing/coresight/coresight-replicator.c +11 -0
@@ -68,6 +68,17 @@ static int dynamic_replicator_enable(struct replicator_drvdata *drvdata,int rc =0 ;u32 reg; +/* +* On some QCOM SoCs with replicators in Always-On domain, disabling +* clock will result in replicator losing its context. Currently +* as a part of pm_runtime workqueue, amba_pm_runtime_suspend disables +* clock assuming the context is not lost which is not true for cases +* with hardware limitations as the above. +*/ +if ((readl_relaxed (drvdata->base +REPLICATOR_IDFILTER0 ) ==0 ) && + (readl_relaxed (drvdata->base +REPLICATOR_IDFILTER1 ) ==0 )) +dynamic_replicator_reset (drvdata); +switch (outport) {case 0 : reg =REPLICATOR_IDFILTER0 ;
Signature · 7 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi Sai,
Quoted 27 lines · Sai Prakash Ranjan
On some QCOM SoCs, replicators in Always-On domain loses its context as soon as the clock is disabled. Currently as a part of
pm_runtimeworkqueue, clock is disabled after the replicator is initialized byamba_pm_runtime_suspendassuming that context is not lost which is not true for replicators with such limitations. Hence check the replicator idfilter registers indynamic_replicator_enable()and reset again.Signed-off-by Sai Prakash Ranjan <[email protected]>---
More info here - https://lore.kernel.org/patchwork/patch/1231182/
--- drivers/hwtracing/coresight/coresight-replicator.c | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/hwtracing/coresight/coresight-replicator.c +1
-0@@ -68,6 +68,17 @@ static int dynamic_replicator_enable(struct replicator_drvdata *drvdata,int rc =0 ;u32 reg; +/*
drivers/hwtracing/coresight/coresight-replicator.c static int dynamic_replicator_enable(struct replicator_drvdata *drvdata, · line 81
Quoted 10 lines
drivers/hwtracing/coresight/coresight-replicator.c +10
-0+* On some QCOM SoCs with replicators in Always-On domain, disabling +* clock will result in replicator losing its context. Currently +* as a part of pm_runtime workqueue, amba_pm_runtime_suspend disables +* clock assuming the context is not lost which is not true for cases +* with hardware limitations as the above. +*/ +if ((readl_relaxed (drvdata->base +REPLICATOR_IDFILTER0 ) ==0 ) && + (readl_relaxed (drvdata->base +REPLICATOR_IDFILTER1 ) ==0 )) +dynamic_replicator_reset (drvdata); +
Based on your comment here[1] and the ongoing conversation, I will wait for a V2.
Thanks,
Mathieu
Quoted 11 lines
drivers/hwtracing/coresight/coresight-replicator.c +0
-1switch (outport) {case 0 : reg =REPLICATOR_IDFILTER0 ; --QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi Mathieu,
Quoted 52 lines · Mathieu Poirier
Hi Sai,
Quoted 42 lines · Sai Prakash Ranjan
On some QCOM SoCs, replicators in Always-On domain loses its context as soon as the clock is disabled. Currently as a part of
pm_runtimeworkqueue, clock is disabled after the replicator is initialized byamba_pm_runtime_suspendassuming that context is not lost which is not true for replicators with such limitations. Hence check the replicator idfilter registers indynamic_replicator_enable()and reset again.Signed-off-by Sai Prakash Ranjan <[email protected]>---
More info here - https://lore.kernel.org/patchwork/patch/1231182/
--- drivers/hwtracing/coresight/coresight-replicator.c | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/hwtracing/coresight/coresight-replicator.c +2
-0@@ -68,6 +68,17 @@ static int dynamic_replicator_enable(structreplicator_drvdata *drvdata, int rc = 0;u32 reg; +/* +* On some QCOM SoCs with replicators in Always-On domain, disabling
+ * clock will result in replicator losing its context.
Currently
+ * as a part ofpm_runtimeworkqueue,amba_pm_runtime_suspend
disables
+ * clock assuming the context is not lost which is not true
for casesdrivers/hwtracing/coresight/coresight-replicator.c +3
-0+* with hardware limitations as the above. +*/ + if ((readl_relaxed(drvdata->base + REPLICATOR_IDFILTER0) == 0)&&
+ (readl_relaxed(drvdata->base + REPLICATOR_IDFILTER1)==
0))drivers/hwtracing/coresight/coresight-replicator.c static int dynamic_replicator_enable(struct replicator_drvdata *drvdata, · line 81
Quoted 2 lines
drivers/hwtracing/coresight/coresight-replicator.c +2
-0+dynamic_replicator_reset (drvdata); +Based on your comment here[1] and the ongoing conversation, I will wait for a V2.
Quoted 5 lines
Thanks,
Mathieu
Yes, I will post a v2 once we have consensus regarding which way we need to add a workaround for such QCOM SoCs.
Thanks,
Sai
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation