2015-05-25 04:45:54 +08:00
|
|
|
/// Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests")
|
|
|
|
/// threaded IRQs without a primary handler need to be requested with
|
|
|
|
/// IRQF_ONESHOT, otherwise the request will fail.
|
|
|
|
///
|
|
|
|
/// So pass the IRQF_ONESHOT flag in this case.
|
2012-07-01 19:17:07 +08:00
|
|
|
///
|
|
|
|
//
|
2016-11-23 16:46:42 +08:00
|
|
|
// Confidence: Moderate
|
2012-07-01 19:17:07 +08:00
|
|
|
// Comments:
|
|
|
|
// Options: --no-includes
|
|
|
|
|
|
|
|
virtual patch
|
|
|
|
virtual context
|
|
|
|
virtual org
|
|
|
|
virtual report
|
|
|
|
|
|
|
|
@r1@
|
2016-11-23 16:46:39 +08:00
|
|
|
expression dev, irq, thread_fn;
|
2012-07-01 19:17:07 +08:00
|
|
|
position p;
|
|
|
|
@@
|
2015-03-04 16:32:32 +08:00
|
|
|
(
|
2012-07-01 19:17:07 +08:00
|
|
|
request_threaded_irq@p(irq, NULL, thread_fn,
|
|
|
|
(
|
2016-11-23 16:46:39 +08:00
|
|
|
IRQF_ONESHOT | ...
|
2012-07-01 19:17:07 +08:00
|
|
|
|
|
|
|
|
IRQF_ONESHOT
|
|
|
|
)
|
|
|
|
, ...)
|
2015-03-04 16:32:32 +08:00
|
|
|
|
|
|
|
|
devm_request_threaded_irq@p(dev, irq, NULL, thread_fn,
|
|
|
|
(
|
2016-11-23 16:46:39 +08:00
|
|
|
IRQF_ONESHOT | ...
|
2015-03-04 16:32:32 +08:00
|
|
|
|
|
|
|
|
IRQF_ONESHOT
|
|
|
|
)
|
|
|
|
, ...)
|
|
|
|
)
|
2012-07-01 19:17:07 +08:00
|
|
|
|
2016-11-23 16:46:39 +08:00
|
|
|
@r2@
|
|
|
|
expression dev, irq, thread_fn, flags, e;
|
2012-07-01 19:17:07 +08:00
|
|
|
position p != r1.p;
|
|
|
|
@@
|
2015-03-04 16:32:32 +08:00
|
|
|
(
|
2016-11-23 16:46:39 +08:00
|
|
|
flags = IRQF_ONESHOT | ...
|
|
|
|
|
|
|
|
|
flags |= IRQF_ONESHOT | ...
|
|
|
|
)
|
|
|
|
... when != flags = e
|
|
|
|
(
|
|
|
|
request_threaded_irq@p(irq, NULL, thread_fn, flags, ...);
|
|
|
|
|
|
|
|
|
devm_request_threaded_irq@p(dev, irq, NULL, thread_fn, flags, ...);
|
|
|
|
)
|
|
|
|
|
|
|
|
@depends on patch@
|
|
|
|
expression dev, irq, thread_fn, flags;
|
|
|
|
position p != {r1.p,r2.p};
|
|
|
|
@@
|
|
|
|
(
|
2012-07-01 19:17:07 +08:00
|
|
|
request_threaded_irq@p(irq, NULL, thread_fn,
|
|
|
|
(
|
|
|
|
-0
|
|
|
|
+IRQF_ONESHOT
|
|
|
|
|
|
|
|
|
-flags
|
|
|
|
+flags | IRQF_ONESHOT
|
|
|
|
)
|
|
|
|
, ...)
|
2015-03-04 16:32:32 +08:00
|
|
|
|
|
|
|
|
devm_request_threaded_irq@p(dev, irq, NULL, thread_fn,
|
|
|
|
(
|
|
|
|
-0
|
|
|
|
+IRQF_ONESHOT
|
|
|
|
|
|
|
|
|
-flags
|
|
|
|
+flags | IRQF_ONESHOT
|
|
|
|
)
|
|
|
|
, ...)
|
|
|
|
)
|
2012-07-01 19:17:07 +08:00
|
|
|
|
|
|
|
@depends on context@
|
2016-11-23 16:46:42 +08:00
|
|
|
expression dev, irq;
|
2016-11-23 16:46:39 +08:00
|
|
|
position p != {r1.p,r2.p};
|
2012-07-01 19:17:07 +08:00
|
|
|
@@
|
2016-11-23 16:46:42 +08:00
|
|
|
(
|
2016-11-23 16:46:46 +08:00
|
|
|
*request_threaded_irq@p(irq, NULL, ...)
|
2016-11-23 16:46:42 +08:00
|
|
|
|
|
|
|
|
*devm_request_threaded_irq@p(dev, irq, NULL, ...)
|
|
|
|
)
|
|
|
|
|
2012-07-01 19:17:07 +08:00
|
|
|
|
|
|
|
@match depends on report || org@
|
2016-11-23 16:46:42 +08:00
|
|
|
expression dev, irq;
|
2016-11-23 16:46:39 +08:00
|
|
|
position p != {r1.p,r2.p};
|
2012-07-01 19:17:07 +08:00
|
|
|
@@
|
2016-11-23 16:46:42 +08:00
|
|
|
(
|
2012-07-01 19:17:07 +08:00
|
|
|
request_threaded_irq@p(irq, NULL, ...)
|
2016-11-23 16:46:42 +08:00
|
|
|
|
|
|
|
|
devm_request_threaded_irq@p(dev, irq, NULL, ...)
|
|
|
|
)
|
2012-07-01 19:17:07 +08:00
|
|
|
|
|
|
|
@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)
|