[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201103081123.119969-1-xuqiang36@huawei.com>
Date: Tue, 3 Nov 2020 08:11:23 +0000
From: Xu Qiang <xuqiang36@...wei.com>
To: <tglx@...utronix.de>, <jason@...edaemon.net>, <maz@...nel.org>,
<linux-kernel@...r.kernel.org>
CC: <rui.xiang@...wei.com>
Subject: [PATCH -next] irq-chip/gic-v3-its: Fixed an issue where the ITS executes the residual commands in the queue again when the ITS wakes up from sleep mode.
During wakeup, the ATF restore interface restores the values of
the cbaser and cwriter registers. As a result, the ITS executes
the residual commands in the queue, which may cause memory corruption.
To solve this problem, clear all data in the command queue
in the suspend interface of the ITS driver.
Signed-off-by: Xu Qiang <xuqiang36@...wei.com>
---
drivers/irqchip/irq-gic-v3-its.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 0fec31931e11..b8487f78ac21 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -4741,6 +4741,14 @@ static int its_save_disable(void)
list_for_each_entry(its, &its_nodes, entry) {
void __iomem *base;
+ /*
+ * Clear the command queue so that the ITS will not re-execute
+ * the remaining commands in the command queue when
+ * the cwriter and cbaser registers are restored
+ * in the restore interface of the firmware.
+ */
+ memset(its->cmd_base, 0, ITS_CMD_QUEUE_SZ);
+
if (!(its->flags & ITS_FLAGS_SAVE_SUSPEND_STATE))
continue;
--
2.25.0
Powered by blists - more mailing lists