From: David Brown <davidb@codeaurora.org>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Linus Walleij <linus.walleij@stericsson.com>,
linux-kernel@vger.kernel.org, Julia Lawall <julia.lawall@lip6.fr>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH] gpio/msm-v1: re-read IRQ flags on each iteration
Date: Tue, 15 May 2012 18:09:19 -0700 [thread overview]
Message-ID: <20120516010919.GA1295@codeaurora.org> (raw)
In-Reply-To: <20120511174112.D9EEE3E0791@localhost>
On Fri, May 11, 2012 at 11:41:12AM -0600, Grant Likely wrote:
> On Fri, 11 May 2012 14:07:12 +0200, Linus Walleij <linus.walleij@stericsson.com> wrote:
> > From: Linus Walleij <linus.walleij@linaro.org>
> >
> > We have recently found a number or erroneous IRQ handlers in
> > the kernel where the flag iterator loop miss IRQs that get
> > raised when the loop is executing. This was spotted in the
> > MSM v1 GPIO driver by Julia Lawall using this cocinelle
> > snippet:
> >
> > @@
> > expression pending,gedr,e1;
> > statement S;
> > @@
> >
> > *pending = readl(gedr);
> > ... when != pending = e1
> > while (pending) S
> >
> > Reported-by: Julia Lawall <julia.lawall@lip6.fr>
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>
> Thanks Linus,
>
> I'll need an ack from an msm developer before applying this.
I though I saw Jeff Ohlstein reply, but I'm not finding that message.
I believe this patch is actually incorrect. The register needs to
only be read once, and the bits walked through. If another interrupt
comes in during the loop, the interrupt will remain asserted, and we
will re-enter the irq handler. I suppose it could be wrapped in yet
another loop, but I'm not sure it is worth it.
I'm pretty sure the code works as it is, since it is the same as the
code in the Android kernel.
David
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
next prev parent reply other threads:[~2012-05-16 1:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-11 12:07 [PATCH] gpio/msm-v1: re-read IRQ flags on each iteration Linus Walleij
2012-05-11 17:41 ` Grant Likely
2012-05-11 21:22 ` Linus Walleij
2012-05-16 1:09 ` David Brown [this message]
2012-05-16 7:23 ` Linus Walleij
2012-05-16 18:38 ` David Brown
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=20120516010919.GA1295@codeaurora.org \
--to=davidb@codeaurora.org \
--cc=grant.likely@secretlab.ca \
--cc=julia.lawall@lip6.fr \
--cc=linus.walleij@linaro.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.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