From: Julia Lawall <julia.lawall@lip6.fr>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Michal Marek <mmarek@suse.cz>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: [Cocci] [PATCH] scripts/coccinelle: Find threaded IRQs requests which are missing IRQF_ONESHOT
Date: Sun, 1 Jul 2012 07:39:24 -0400 (EDT) [thread overview]
Message-ID: <alpine.DEB.2.02.1207010736160.1873@hadrien> (raw)
In-Reply-To: <1341141427-14424-1-git-send-email-lars@metafoo.de>
On Sun, 1 Jul 2012, Lars-Peter Clausen wrote:
> Since commit 1c6c69525b ("genirq: Reject bogus threaded irq requests") threaded
> IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise
> the request will fail. This semantic patch will help to statically identify
> (and fix) such cases.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> ---
> scripts/coccinelle/misc/irqf_oneshot.cocci | 65 ++++++++++++++++++++++++++++
> 1 file changed, 65 insertions(+)
> create mode 100644 scripts/coccinelle/misc/irqf_oneshot.cocci
>
> diff --git a/scripts/coccinelle/misc/irqf_oneshot.cocci b/scripts/coccinelle/misc/irqf_oneshot.cocci
> new file mode 100644
> index 0000000..6cfde94
> --- /dev/null
> +++ b/scripts/coccinelle/misc/irqf_oneshot.cocci
> @@ -0,0 +1,65 @@
> +/// Make sure threaded IRQs without a primary handler are always request with
> +/// IRQF_ONESHOT
> +///
> +//
> +// Confidence: Good
> +// Comments:
> +// Options: --no-includes
> +
> +virtual patch
> +virtual context
> +virtual org
> +virtual report
> +
> +@r1@
> +expression irq;
> +expression thread_fn;
> +expression flags;
> +position p;
> +@@
> +request_threaded_irq@p(irq, NULL, thread_fn,
> +(
> +flags | IRQF_ONESHOT
> +|
> +IRQF_ONESHOT
> +)
> +, ...)
> +
> +@depends on patch@
> +expression irq;
> +expression thread_fn;
> +expression flags;
> +position p != r1.p;
> +@@
> +request_threaded_irq@p(irq, NULL, thread_fn,
> +(
> +-0
> ++IRQF_ONESHOT
> +|
> +-flags
> ++flags | IRQF_ONESHOT
> +)
> +, ...)
> +
> +@depends on context@
> +position p != r1.p;
> +@@
> +*request_threaded_irq@p(...)
> +
> +@match depends on report || org@
> +expression irq;
> +position p != r1.p;
> +@@
> +request_threaded_irq@p(irq, NULL, ...)
> +
> +@script:python depends on org@
> +p << match.p;
> +@@
> +msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT"
> +coccilib.org.print_todo(p[0],msg)
> +
> +@script:python depends on report@
> +p << match.p;
> +@@
> +msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT"
> +coccilib.report.print_report(p[0],msg)
> --
> 1.7.10
>
> _______________________________________________
> Cocci mailing list
> Cocci@diku.dk
> http://lists.diku.dk/mailman/listinfo/cocci
> (Web access from inside DIKUs LAN only)
>
prev parent reply other threads:[~2012-07-01 11:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-01 11:17 Lars-Peter Clausen
2012-07-01 11:39 ` Julia Lawall [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=alpine.DEB.2.02.1207010736160.1873@hadrien \
--to=julia.lawall@lip6.fr \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®