From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751851AbbCVK32 (ORCPT ); Sun, 22 Mar 2015 06:29:28 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:6765 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751685AbbCVK3Y (ORCPT ); Sun, 22 Mar 2015 06:29:24 -0400 X-IronPort-AV: E=Sophos;i="5.11,445,1422918000"; d="scan'208";a="127760614" Date: Sun, 22 Mar 2015 11:29:13 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Valentin Rothberg cc: Peter Senna Tschudin , Julia Lawall , Gilles Muller , Nicolas Palix , Michal Marek , cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org Subject: Re: [PATCH] irqf_oneshot.cocci: add check of devm_request_threaded_irq() In-Reply-To: <1425457959-9308-1-git-send-email-valentinrothberg@gmail.com> Message-ID: References: <1425457959-9308-1-git-send-email-valentinrothberg@gmail.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Acked-by: Julia Lawall Good fix, thanks! On Wed, 4 Mar 2015, Valentin Rothberg wrote: > Since commit 1c6c69525b40eb76de8adf039409722015927dc3 ("genirq: Reject > bogus threaded irq requests") threaded IRQs without a primary handler > need to be requested with IRQF_ONESHOT, otherwise the request will fail. > > Until now, this coccinelle script only checked request_threaded_irq(). > However, the counterpart devm function (see kernel/irq/devres.c) is also > affected by the missing flag which can be detected with this patch. > > Signed-off-by: Valentin Rothberg > Signed-off-by: Peter Senna Tschudin > --- > scripts/coccinelle/misc/irqf_oneshot.cocci | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/scripts/coccinelle/misc/irqf_oneshot.cocci b/scripts/coccinelle/misc/irqf_oneshot.cocci > index 6cfde94..a24a754 100644 > --- a/scripts/coccinelle/misc/irqf_oneshot.cocci > +++ b/scripts/coccinelle/misc/irqf_oneshot.cocci > @@ -12,11 +12,13 @@ virtual org > virtual report > > @r1@ > +expression dev; > expression irq; > expression thread_fn; > expression flags; > position p; > @@ > +( > request_threaded_irq@p(irq, NULL, thread_fn, > ( > flags | IRQF_ONESHOT > @@ -24,13 +26,24 @@ flags | IRQF_ONESHOT > IRQF_ONESHOT > ) > , ...) > +| > +devm_request_threaded_irq@p(dev, irq, NULL, thread_fn, > +( > +flags | IRQF_ONESHOT > +| > +IRQF_ONESHOT > +) > +, ...) > +) > > @depends on patch@ > +expression dev; > expression irq; > expression thread_fn; > expression flags; > position p != r1.p; > @@ > +( > request_threaded_irq@p(irq, NULL, thread_fn, > ( > -0 > @@ -40,6 +53,17 @@ request_threaded_irq@p(irq, NULL, thread_fn, > +flags | IRQF_ONESHOT > ) > , ...) > +| > +devm_request_threaded_irq@p(dev, irq, NULL, thread_fn, > +( > +-0 > ++IRQF_ONESHOT > +| > +-flags > ++flags | IRQF_ONESHOT > +) > +, ...) > +) > > @depends on context@ > position p != r1.p; > -- > 1.9.1 > >