Commit deed9f1b authored by Daniel Mack's avatar Daniel Mack Committed by Kleber Sacilotto de Souza

ARM: pxa: irq: fix handling of ICMR registers in suspend/resume

BugLink: https://bugs.launchpad.net/bugs/1792377

[ Upstream commit 0c1049dc ]

PXA3xx platforms have 56 interrupts that are stored in two ICMR
registers. The code in pxa_irq_suspend() and pxa_irq_resume() however
does a simple division by 32 which only leads to one register being
saved at suspend and restored at resume time. The NAND interrupt
setting, for instance, is lost.

Fix this by using DIV_ROUND_UP() instead.
Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
Signed-off-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent ca794f01
...@@ -185,7 +185,7 @@ static int pxa_irq_suspend(void) ...@@ -185,7 +185,7 @@ static int pxa_irq_suspend(void)
{ {
int i; int i;
for (i = 0; i < pxa_internal_irq_nr / 32; i++) { for (i = 0; i < DIV_ROUND_UP(pxa_internal_irq_nr, 32); i++) {
void __iomem *base = irq_base(i); void __iomem *base = irq_base(i);
saved_icmr[i] = __raw_readl(base + ICMR); saved_icmr[i] = __raw_readl(base + ICMR);
...@@ -204,7 +204,7 @@ static void pxa_irq_resume(void) ...@@ -204,7 +204,7 @@ static void pxa_irq_resume(void)
{ {
int i; int i;
for (i = 0; i < pxa_internal_irq_nr / 32; i++) { for (i = 0; i < DIV_ROUND_UP(pxa_internal_irq_nr, 32); i++) {
void __iomem *base = irq_base(i); void __iomem *base = irq_base(i);
__raw_writel(saved_icmr[i], base + ICMR); __raw_writel(saved_icmr[i], base + ICMR);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment