* [PATCH v2 0/2] bus: omap_l3_noc: Add resume hook to restore mask registers
@ 2014-11-10 18:19 Keerthy
2014-11-10 18:19 ` [PATCH v2 1/2] bus: omap_l3_noc: Add resume hook to restore context Keerthy
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Keerthy @ 2014-11-10 18:19 UTC (permalink / raw)
To: linux-omap; +Cc: j-keerthy, nm, afzal, tony
l3_noc module loses context during both DS0 and RTC+DDR in self refresh modes.
This causes the previously masked l3 interrupts to trigger and the software
book keeping assumes the interrupts are masked and does nothing to mask.
This software/hardware out of sync leads to back to back l3 interrupts
and eventually causes a hang. Hence adding resume hook to restore the
mask registers based on the book keeping variables
Keerthy (2):
bus: omap_l3_noc: Add resume hook to restore context
bus: omap_l3_noc: Correct returning IRQ_HANDLED unconditionally in
the irq handler
drivers/bus/omap_l3_noc.c | 63 +++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 61 insertions(+), 2 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/2] bus: omap_l3_noc: Add resume hook to restore context
2014-11-10 18:19 [PATCH v2 0/2] bus: omap_l3_noc: Add resume hook to restore mask registers Keerthy
@ 2014-11-10 18:19 ` Keerthy
2014-11-10 18:19 ` [PATCH v2 2/2] bus: omap_l3_noc: Correct returning IRQ_HANDLED unconditionally in the irq handler Keerthy
2014-11-12 15:17 ` [PATCH v2 0/2] bus: omap_l3_noc: Add resume hook to restore mask registers Tony Lindgren
2 siblings, 0 replies; 5+ messages in thread
From: Keerthy @ 2014-11-10 18:19 UTC (permalink / raw)
To: linux-omap; +Cc: j-keerthy, nm, afzal, tony
On certain SoCs such as AM437x SoC, L3_noc error registers are
maintained in power domain such as per domain which looses context as part
of low power state such as RTC+DDR mode. On these platforms when we
mask interrupts which we cannot handle, the source of these interrupts
still remain on resume, however, the flag mux registers now contain
their reset value (unmasked) - this breaks the system with infinite
interrupts since we do not these interrupts to take place ever again.
To handle this: restore the masking of interrupts which we have
already recorded in the system as ones we cannot handle.
Fixes: 2100b595b7 ("bus: omap_l3_noc: ignore masked out unclearable targets")
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
---
Changes from v1:
* Fixed the commit log with the right commit ID of the patch that is fixed
drivers/bus/omap_l3_noc.c | 55 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c
index 531ae59..b5eac29 100644
--- a/drivers/bus/omap_l3_noc.c
+++ b/drivers/bus/omap_l3_noc.c
@@ -296,11 +296,66 @@ static int omap_l3_probe(struct platform_device *pdev)
return ret;
}
+#ifdef CONFIG_PM
+
+/**
+ * l3_resume_noirq() - resume function for l3_noc
+ * @dev: pointer to l3_noc device structure
+ *
+ * We only have the resume handler only since we
+ * have already maintained the delta register
+ * configuration as part of configuring the system
+ */
+static int l3_resume_noirq(struct device *dev)
+{
+ struct omap_l3 *l3 = dev_get_drvdata(dev);
+ int i;
+ struct l3_flagmux_data *flag_mux;
+ void __iomem *base, *mask_regx = NULL;
+ u32 mask_val;
+
+ for (i = 0; i < l3->num_modules; i++) {
+ base = l3->l3_base[i];
+ flag_mux = l3->l3_flagmux[i];
+ if (!flag_mux->mask_app_bits && !flag_mux->mask_dbg_bits)
+ continue;
+
+ mask_regx = base + flag_mux->offset + L3_FLAGMUX_MASK0 +
+ (L3_APPLICATION_ERROR << 3);
+ mask_val = readl_relaxed(mask_regx);
+ mask_val &= ~(flag_mux->mask_app_bits);
+
+ writel_relaxed(mask_val, mask_regx);
+ mask_regx = base + flag_mux->offset + L3_FLAGMUX_MASK0 +
+ (L3_DEBUG_ERROR << 3);
+ mask_val = readl_relaxed(mask_regx);
+ mask_val &= ~(flag_mux->mask_dbg_bits);
+
+ writel_relaxed(mask_val, mask_regx);
+ }
+
+ /* Dummy read to force OCP barrier */
+ if (mask_regx)
+ (void)readl(mask_regx);
+
+ return 0;
+}
+
+static const struct dev_pm_ops l3_dev_pm_ops = {
+ .resume_noirq = l3_resume_noirq,
+};
+
+#define L3_DEV_PM_OPS (&l3_dev_pm_ops)
+#else
+#define L3_DEV_PM_OPS NULL
+#endif
+
static struct platform_driver omap_l3_driver = {
.probe = omap_l3_probe,
.driver = {
.name = "omap_l3_noc",
.owner = THIS_MODULE,
+ .pm = L3_DEV_PM_OPS,
.of_match_table = of_match_ptr(l3_noc_match),
},
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] bus: omap_l3_noc: Correct returning IRQ_HANDLED unconditionally in the irq handler
2014-11-10 18:19 [PATCH v2 0/2] bus: omap_l3_noc: Add resume hook to restore mask registers Keerthy
2014-11-10 18:19 ` [PATCH v2 1/2] bus: omap_l3_noc: Add resume hook to restore context Keerthy
@ 2014-11-10 18:19 ` Keerthy
2014-11-12 15:17 ` [PATCH v2 0/2] bus: omap_l3_noc: Add resume hook to restore mask registers Tony Lindgren
2 siblings, 0 replies; 5+ messages in thread
From: Keerthy @ 2014-11-10 18:19 UTC (permalink / raw)
To: linux-omap; +Cc: j-keerthy, nm, afzal, tony
Correct returning IRQ_HANDLED unconditionally in the irq handler.
Return IRQ_NONE for some interrupt which we do not expect to be
handled in this handler. This prevents kernel stalling with back
to back spurious interrupts.
Fixes: 2722e56de6 ("OMAP4: l3: Introduce l3-interconnect error handling driver")
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
---
Changes from v1:
* Added the Fixes tag to the commit log with the right commit ID of the
patch that is fixed.
drivers/bus/omap_l3_noc.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c
index b5eac29..17d8659 100644
--- a/drivers/bus/omap_l3_noc.c
+++ b/drivers/bus/omap_l3_noc.c
@@ -222,10 +222,14 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
}
/* Error found so break the for loop */
- break;
+ return IRQ_HANDLED;
}
}
- return IRQ_HANDLED;
+
+ dev_err(l3->dev, "L3 %s IRQ not handled!!\n",
+ inttype ? "debug" : "application");
+
+ return IRQ_NONE;
}
static const struct of_device_id l3_noc_match[] = {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/2] bus: omap_l3_noc: Add resume hook to restore mask registers
2014-11-10 18:19 [PATCH v2 0/2] bus: omap_l3_noc: Add resume hook to restore mask registers Keerthy
2014-11-10 18:19 ` [PATCH v2 1/2] bus: omap_l3_noc: Add resume hook to restore context Keerthy
2014-11-10 18:19 ` [PATCH v2 2/2] bus: omap_l3_noc: Correct returning IRQ_HANDLED unconditionally in the irq handler Keerthy
@ 2014-11-12 15:17 ` Tony Lindgren
2014-11-12 16:27 ` Keerthy
2 siblings, 1 reply; 5+ messages in thread
From: Tony Lindgren @ 2014-11-12 15:17 UTC (permalink / raw)
To: Keerthy; +Cc: linux-omap, nm, afzal
* Keerthy <j-keerthy@ti.com> [141110 10:25]:
> l3_noc module loses context during both DS0 and RTC+DDR in self refresh modes.
> This causes the previously masked l3 interrupts to trigger and the software
> book keeping assumes the interrupts are masked and does nothing to mask.
> This software/hardware out of sync leads to back to back l3 interrupts
> and eventually causes a hang. Hence adding resume hook to restore the
> mask registers based on the book keeping variables
Applying both into omap-for-v3.19/drivers-v2 branch thanks.
Tony
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/2] bus: omap_l3_noc: Add resume hook to restore mask registers
2014-11-12 15:17 ` [PATCH v2 0/2] bus: omap_l3_noc: Add resume hook to restore mask registers Tony Lindgren
@ 2014-11-12 16:27 ` Keerthy
0 siblings, 0 replies; 5+ messages in thread
From: Keerthy @ 2014-11-12 16:27 UTC (permalink / raw)
To: Tony Lindgren; +Cc: Keerthy, linux-omap, nm, afzal
On Wednesday 12 November 2014 08:47 PM, Tony Lindgren wrote:
> * Keerthy <j-keerthy@ti.com> [141110 10:25]:
>> l3_noc module loses context during both DS0 and RTC+DDR in self refresh modes.
>> This causes the previously masked l3 interrupts to trigger and the software
>> book keeping assumes the interrupts are masked and does nothing to mask.
>> This software/hardware out of sync leads to back to back l3 interrupts
>> and eventually causes a hang. Hence adding resume hook to restore the
>> mask registers based on the book keeping variables
> Applying both into omap-for-v3.19/drivers-v2 branch thanks.
Thanks Tony.
>
> Tony
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-11-12 16:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-10 18:19 [PATCH v2 0/2] bus: omap_l3_noc: Add resume hook to restore mask registers Keerthy
2014-11-10 18:19 ` [PATCH v2 1/2] bus: omap_l3_noc: Add resume hook to restore context Keerthy
2014-11-10 18:19 ` [PATCH v2 2/2] bus: omap_l3_noc: Correct returning IRQ_HANDLED unconditionally in the irq handler Keerthy
2014-11-12 15:17 ` [PATCH v2 0/2] bus: omap_l3_noc: Add resume hook to restore mask registers Tony Lindgren
2014-11-12 16:27 ` Keerthy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).