linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: johlstei@codeaurora.org (Jeff Ohlstein)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] RFC: ARM: msm: re-read DMA IRQ status on each iteration
Date: Fri, 11 May 2012 18:04:58 -0700	[thread overview]
Message-ID: <4FADB73A.8050200@codeaurora.org> (raw)
In-Reply-To: <1336738791-15037-1-git-send-email-linus.walleij@stericsson.com>

On 05/11/2012 05:19 AM, Linus Walleij wrote:
> David et al: I'm uncertain about this one since the comment
> says that the read clears the IRQ, such as if the read operation
> itself will latch out the flag register and clear it. (I encountered
> this behaviour in the MOS6569 VIC raster IRQ register $D019 in the
> 1980s if I'm not mistaken.)
> ---
>   arch/arm/mach-msm/dma.c |    6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-msm/dma.c b/arch/arm/mach-msm/dma.c
> index 02cae5e..ee11afe 100644
> --- a/arch/arm/mach-msm/dma.c
> +++ b/arch/arm/mach-msm/dma.c
> @@ -147,10 +147,8 @@ static irqreturn_t msm_datamover_irq_handler(int irq, void *dev_id)
>
>   	spin_lock_irqsave(&msm_dmov_lock, irq_flags);
>
> -	int_status = readl(DMOV_ISR); /* read and clear interrupt */
> -	PRINT_FLOW("msm_datamover_irq_handler: DMOV_ISR %x\n", int_status);
> -
> -	while (int_status) {
> +	while (int_status = readl(DMOV_ISR)) {
> +		PRINT_FLOW("msm_datamover_irq_handler: DMOV_ISR %x\n", int_status);
>   		mask = int_status&  -int_status;
>   		id = fls(mask) - 1;
> PRINT_FLOW("msm_datamover_irq_handler %08x %08x id %d\n", int_status, 
> mask, id);
This is incorrect. Reading from the DMOV_ISR register there will 
actually clear it, causing us to
lose state for interrupts on channels other than the first one 
processed. If we miss some by not
re-reading the register, another interrupt will be raised so it isn't a 
problem.

Jeff

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

      reply	other threads:[~2012-05-12  1:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-11 12:19 [PATCH] RFC: ARM: msm: re-read DMA IRQ status on each iteration Linus Walleij
2012-05-12  1:04 ` Jeff Ohlstein [this message]

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=4FADB73A.8050200@codeaurora.org \
    --to=johlstei@codeaurora.org \
    --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;
as well as URLs for NNTP newsgroup(s).