Skip to content

Commit

Permalink
ARM: pxa: irq: fix handling of ICMR registers in suspend/resume
Browse files Browse the repository at this point in the history
[ Upstream commit 0c1049d ]

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: Daniel Mack <daniel@zonque.org>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
zonque authored and gregkh committed Aug 24, 2018
1 parent fb96d97 commit ecbef3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mach-pxa/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static int pxa_irq_suspend(void)
{
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);

saved_icmr[i] = __raw_readl(base + ICMR);
Expand All @@ -204,7 +204,7 @@ static void pxa_irq_resume(void)
{
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);

__raw_writel(saved_icmr[i], base + ICMR);
Expand Down

0 comments on commit ecbef3e

Please sign in to comment.