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: <alpine.DEB.2.02.1205102211060.1957@localhost6.localdomain6>
Date:	Thu, 10 May 2012 22:34:53 +0200 (CEST)
From:	Julia Lawall <julia.lawall@...6.fr>
To:	Linus Walleij <linus.walleij@...aro.org>
cc:	Mika Westerberg <mika.westerberg@...ux.intel.com>,
	linux-kernel@...r.kernel.org, grant.likely@...retlab.ca,
	linus.walleij@...ricsson.com
Subject: Re: [PATCH] gpio/langwell: re-read the IRQ status register after
 each iteration

On Thu, 10 May 2012, Linus Walleij wrote:

> 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;

I tried the following:

@@
expression pending,gedr,e1;
statement S;
@@

*pending = readl(gedr);
... when != pending = e1
while (pending) S

That is, a readl call followed by a while loop with no reassignment of 
pending.

Perhaps the following are suspicious:

arch/arm/mach-msm/dma.c, function msm_datamover_irq_handler
drivers/gpio/gpio-msm-v1.c, function msm_gpio_irq_handler

But I am not completely sure to understand what is wanted (or not wanted).

julia
--
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