lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdbA58UiNLZRPWe1yGckGFrXqtJ3ddqjLLzLntC6+Cin3g@mail.gmail.com>
Date:	Thu, 10 May 2012 14:16:56 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:	linux-kernel@...r.kernel.org, grant.likely@...retlab.ca,
	linus.walleij@...ricsson.com, Julia Lawall <Julia.Lawall@...6.fr>
Subject: Re: [PATCH] gpio/langwell: re-read the IRQ status register after each iteration

On Thu, May 10, 2012 at 12:01 PM, Mika Westerberg
<mika.westerberg@...ux.intel.com> wrote:

> Spotted by Grant Likely. The IRQ status register should be re-read after
> each iteration. Otherwise the loop misses the interrupt if it gets raised
> immediately after handled.
>
> Signed-off-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
> ---
> This patch applies on top of my previous patch ("gpio: langwell: convert to
> use irq_domain").

Oh yeah that thing I recognize!
Acked-by: Linus Walleij <linus.walleij@...aro.org>

If someone has  time I think it would be a good idea to
conjure a cocienelle sematic patch to catch this pattern, because
I suspect it might exist in more IRQ handlers.

-               pending = readl(gedr);
-               while (pending) {
+               while ((pending = readl(gedr))) {
                       gpio = __ffs(pending);
                       mask = BIT(gpio);
-                       pending &= ~mask;

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ