public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: robert.jarzmik@free.fr (Robert Jarzmik)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: pxa: irq: fix handling of ICMR registers in suspend/resume
Date: Fri, 06 Jul 2018 23:28:15 +0200	[thread overview]
Message-ID: <87zhz4f40g.fsf@belgarion.home> (raw)
In-Reply-To: <20180706201500.2000-1-daniel@zonque.org> (Daniel Mack's message of "Fri, 6 Jul 2018 22:15:00 +0200")

Daniel Mack <daniel@zonque.org> writes:

> 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>
> ---
>  arch/arm/mach-pxa/irq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
> index 9c10248fadcc..4e8c2116808e 100644
> --- a/arch/arm/mach-pxa/irq.c
> +++ b/arch/arm/mach-pxa/irq.c
> @@ -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++) {
Okay, I get it.  Still, something tells me saved_icmr deserves some love too,
even if the result in the end won't change, it's just for corectness sake.

Of course, while@it I wonder if we couldn't have :
 - pxa_init_irq_common()
 - a kmalloc_array() or similar for saved_icmr[] and saved_ipr[]
That could be in this patch or another one ...

Cheers.

-- 
Robert

  reply	other threads:[~2018-07-06 21:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-06 20:15 [PATCH] ARM: pxa: irq: fix handling of ICMR registers in suspend/resume Daniel Mack
2018-07-06 21:28 ` Robert Jarzmik [this message]
2018-07-06 22:08   ` Daniel Mack
2018-07-07 19:29     ` Robert Jarzmik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zhz4f40g.fsf@belgarion.home \
    --to=robert.jarzmik@free.fr \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox