Fabio Estevam | 9473a62 | 2015-05-24 17:45:54 -0300 | [diff] [blame^] | 1 | /// 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 Clausen | f1f4550 | 2012-07-01 13:17:07 +0200 | [diff] [blame] | 6 | /// |
| 7 | // |
| 8 | // Confidence: Good |
| 9 | // Comments: |
| 10 | // Options: --no-includes |
| 11 | |
| 12 | virtual patch |
| 13 | virtual context |
| 14 | virtual org |
| 15 | virtual report |
| 16 | |
| 17 | @r1@ |
Valentin Rothberg | 2c2b913 | 2015-03-04 09:32:32 +0100 | [diff] [blame] | 18 | expression dev; |
Lars-Peter Clausen | f1f4550 | 2012-07-01 13:17:07 +0200 | [diff] [blame] | 19 | expression irq; |
| 20 | expression thread_fn; |
| 21 | expression flags; |
| 22 | position p; |
| 23 | @@ |
Valentin Rothberg | 2c2b913 | 2015-03-04 09:32:32 +0100 | [diff] [blame] | 24 | ( |
Lars-Peter Clausen | f1f4550 | 2012-07-01 13:17:07 +0200 | [diff] [blame] | 25 | request_threaded_irq@p(irq, NULL, thread_fn, |
| 26 | ( |
| 27 | flags | IRQF_ONESHOT |
| 28 | | |
| 29 | IRQF_ONESHOT |
| 30 | ) |
| 31 | , ...) |
Valentin Rothberg | 2c2b913 | 2015-03-04 09:32:32 +0100 | [diff] [blame] | 32 | | |
| 33 | devm_request_threaded_irq@p(dev, irq, NULL, thread_fn, |
| 34 | ( |
| 35 | flags | IRQF_ONESHOT |
| 36 | | |
| 37 | IRQF_ONESHOT |
| 38 | ) |
| 39 | , ...) |
| 40 | ) |
Lars-Peter Clausen | f1f4550 | 2012-07-01 13:17:07 +0200 | [diff] [blame] | 41 | |
| 42 | @depends on patch@ |
Valentin Rothberg | 2c2b913 | 2015-03-04 09:32:32 +0100 | [diff] [blame] | 43 | expression dev; |
Lars-Peter Clausen | f1f4550 | 2012-07-01 13:17:07 +0200 | [diff] [blame] | 44 | expression irq; |
| 45 | expression thread_fn; |
| 46 | expression flags; |
| 47 | position p != r1.p; |
| 48 | @@ |
Valentin Rothberg | 2c2b913 | 2015-03-04 09:32:32 +0100 | [diff] [blame] | 49 | ( |
Lars-Peter Clausen | f1f4550 | 2012-07-01 13:17:07 +0200 | [diff] [blame] | 50 | request_threaded_irq@p(irq, NULL, thread_fn, |
| 51 | ( |
| 52 | -0 |
| 53 | +IRQF_ONESHOT |
| 54 | | |
| 55 | -flags |
| 56 | +flags | IRQF_ONESHOT |
| 57 | ) |
| 58 | , ...) |
Valentin Rothberg | 2c2b913 | 2015-03-04 09:32:32 +0100 | [diff] [blame] | 59 | | |
| 60 | devm_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 Clausen | f1f4550 | 2012-07-01 13:17:07 +0200 | [diff] [blame] | 70 | |
| 71 | @depends on context@ |
| 72 | position p != r1.p; |
| 73 | @@ |
| 74 | *request_threaded_irq@p(...) |
| 75 | |
| 76 | @match depends on report || org@ |
| 77 | expression irq; |
| 78 | position p != r1.p; |
| 79 | @@ |
| 80 | request_threaded_irq@p(irq, NULL, ...) |
| 81 | |
| 82 | @script:python depends on org@ |
| 83 | p << match.p; |
| 84 | @@ |
| 85 | msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT" |
| 86 | coccilib.org.print_todo(p[0],msg) |
| 87 | |
| 88 | @script:python depends on report@ |
| 89 | p << match.p; |
| 90 | @@ |
| 91 | msg = "ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT" |
| 92 | coccilib.report.print_report(p[0],msg) |