blob: b421150a2effcd925e83758bbf609d038e67ac1b [file] [log] [blame]
Fabio Estevam9473a622015-05-24 17:45:54 -03001/// Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests")
2/// threaded IRQs without a primary handler need to be requested with
3/// IRQF_ONESHOT, otherwise the request will fail.
4///
5/// So pass the IRQF_ONESHOT flag in this case.
Lars-Peter Clausenf1f45502012-07-01 13:17:07 +02006///
7//
8// Confidence: Good
9// Comments:
10// Options: --no-includes
11
12virtual patch
13virtual context
14virtual org
15virtual report
16
17@r1@
Valentin Rothberg2c2b9132015-03-04 09:32:32 +010018expression dev;
Lars-Peter Clausenf1f45502012-07-01 13:17:07 +020019expression irq;
20expression thread_fn;
21expression flags;
22position p;
23@@
Valentin Rothberg2c2b9132015-03-04 09:32:32 +010024(
Lars-Peter Clausenf1f45502012-07-01 13:17:07 +020025request_threaded_irq@p(irq, NULL, thread_fn,
26(
27flags | IRQF_ONESHOT
28|
29IRQF_ONESHOT
30)
31, ...)
Valentin Rothberg2c2b9132015-03-04 09:32:32 +010032|
33devm_request_threaded_irq@p(dev, irq, NULL, thread_fn,
34(
35flags | IRQF_ONESHOT
36|
37IRQF_ONESHOT
38)
39, ...)
40)
Lars-Peter Clausenf1f45502012-07-01 13:17:07 +020041
42@depends on patch@
Valentin Rothberg2c2b9132015-03-04 09:32:32 +010043expression dev;
Lars-Peter Clausenf1f45502012-07-01 13:17:07 +020044expression irq;
45expression thread_fn;
46expression flags;
47position p != r1.p;
48@@
Valentin Rothberg2c2b9132015-03-04 09:32:32 +010049(
Lars-Peter Clausenf1f45502012-07-01 13:17:07 +020050request_threaded_irq@p(irq, NULL, thread_fn,
51(
52-0
53+IRQF_ONESHOT
54|
55-flags
56+flags | IRQF_ONESHOT
57)
58, ...)
Valentin Rothberg2c2b9132015-03-04 09:32:32 +010059|
60devm_request_threaded_irq@p(dev, irq, NULL, thread_fn,
61(
62-0
63+IRQF_ONESHOT
64|
65-flags
66+flags | IRQF_ONESHOT
67)
68, ...)
69)
Lars-Peter Clausenf1f45502012-07-01 13:17:07 +020070
71@depends on context@
72position p != r1.p;
73@@
74*request_threaded_irq@p(...)
75
76@match depends on report || org@
77expression irq;
78position p != r1.p;
79@@
80request_threaded_irq@p(irq, NULL, ...)
81
82@script:python depends on org@
83p << match.p;
84@@
85msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT"
86coccilib.org.print_todo(p[0],msg)
87
88@script:python depends on report@
89p << match.p;
90@@
91msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT"
92coccilib.report.print_report(p[0],msg)