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 patch adds the IRQF_ONESHOT to input drivers where it is missing. Not modified by this patch are those drivers where the requested IRQ will always be a nested IRQ (e.g. because it's part of an MFD), since for this special case IRQF_ONESHOT is not required to be specified when requesting the IRQ.
Unified · Split
| @@ -281,7 +281,8 @@ static int __devinit as5011_probe(struct i2c_client *client, · 280 unmodified lines | ||
| 281 | 281 | |
| 282 | 282 | error = request_threaded_irq(as5011->button_irq, |
| 283 | 283 | NULL, as5011_button_interrupt, |
| 284 | − IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | |
| 284 | + IRQF_TRIGGER_RISING | | |
| 285 | + IRQF_TRIGGER_FALLING | IRQF_ONESHOT, | |
| 285 | 286 | "as5011_button", as5011); |
| 286 | 287 | if (error < 0) { |
| 287 | 288 | dev_err(&client->dev, |
| @@ -295,7 +296,7 @@ static int __devinit as5011_probe(struct i2c_client *client, · 7 unmodified lines | ||
| 295 | 296 | |
| 296 | 297 | error = request_threaded_irq(as5011->axis_irq, NULL, |
| 297 | 298 | as5011_axis_interrupt, |
| 298 | − plat_data->axis_irqflags, | |
| 299 | + plat_data->axis_irqflags | IRQF_ONESHOT, | |
| 299 | 300 | "as5011_joystick", as5011); |
| 300 | 301 | if (error) { |
| 301 | 302 | dev_err(&client->dev, |
| @@ -178,7 +178,8 @@ static int __devinit mcs_touchkey_probe(struct i2c_client *client, · 177 unmodified lines | ||
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | error = request_threaded_irq(client->irq, NULL, mcs_touchkey_interrupt, |
| 181 | − IRQF_TRIGGER_FALLING, client->dev.driver->name, data); | |
| 181 | + IRQF_TRIGGER_FALLING | IRQF_ONESHOT, | |
| 182 | + client->dev.driver->name, data); | |
| 182 | 183 | if (error) { |
| 183 | 184 | dev_err(&client->dev, "Failed to register interrupt\n"); |
| 184 | 185 | goto err_free_mem; |
| @@ -248,7 +248,7 @@ static int __devinit mpr_touchkey_probe(struct i2c_client *client, · 247 unmodified lines | ||
| 248 | 248 | |
| 249 | 249 | error = request_threaded_irq(client->irq, NULL, |
| 250 | 250 | mpr_touchkey_interrupt, |
| 251 | − IRQF_TRIGGER_FALLING, | |
| 251 | + IRQF_TRIGGER_FALLING | IRQF_ONESHOT, | |
| 252 | 252 | client->dev.driver->name, mpr121); |
| 253 | 253 | if (error) { |
| 254 | 254 | dev_err(&client->dev, "Failed to register interrupt\n"); |
| @@ -201,7 +201,8 @@ static int __devinit qt1070_probe(struct i2c_client *client, · 200 unmodified lines | ||
| 201 | 201 | msleep(QT1070_RESET_TIME); |
| 202 | 202 | |
| 203 | 203 | err = request_threaded_irq(client->irq, NULL, qt1070_interrupt, |
| 204 | − IRQF_TRIGGER_NONE, client->dev.driver->name, data); | |
| 204 | + IRQF_TRIGGER_NONE | IRQF_ONESHOT, | |
| 205 | + client->dev.driver->name, data); | |
| 205 | 206 | if (err) { |
| 206 | 207 | dev_err(&client->dev, "fail to request irq\n"); |
| 207 | 208 | goto err_free_mem; |
| @@ -278,7 +278,8 @@ static int __devinit tca6416_keypad_probe(struct i2c_client *client, · 277 unmodified lines | ||
| 278 | 278 | |
| 279 | 279 | error = request_threaded_irq(chip->irqnum, NULL, |
| 280 | 280 | tca6416_keys_isr, |
| 281 | − IRQF_TRIGGER_FALLING, | |
| 281 | + IRQF_TRIGGER_FALLING | | |
| 282 | + IRQF_ONESHOT, | |
| 282 | 283 | "tca6416-keypad", chip); |
| 283 | 284 | if (error) { |
| 284 | 285 | dev_dbg(&client->dev, |
| @@ -360,7 +360,7 @@ static int __devinit tca8418_keypad_probe(struct i2c_client *client, · 359 unmodified lines | ||
| 360 | 360 | client->irq = gpio_to_irq(client->irq); |
| 361 | 361 | |
| 362 | 362 | error = request_threaded_irq(client->irq, NULL, tca8418_irq_handler, |
| 363 | − IRQF_TRIGGER_FALLING, | |
| 363 | + IRQF_TRIGGER_FALLING | IRQF_ONESHOT, | |
| 364 | 364 | client->name, keypad_data); |
| 365 | 365 | if (error) { |
| 366 | 366 | dev_dbg(&client->dev, |
| @@ -227,15 +227,15 @@ static int __devinit keypad_probe(struct platform_device *pdev) · 226 unmodified lines | ||
| 227 | 227 | goto error_clk; |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | − error = request_threaded_irq(kp->irq_press, NULL, keypad_irq, 0, | |
| 231 | − dev_name(dev), kp); | |
| 230 | + error = request_threaded_irq(kp->irq_press, NULL, keypad_irq, | |
| 231 | + IRQF_ONESHOT, dev_name(dev), kp); | |
| 232 | 232 | if (error < 0) { |
| 233 | 233 | dev_err(kp->dev, "Could not allocate keypad press key irq\n"); |
| 234 | 234 | goto error_irq_press; |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | − error = request_threaded_irq(kp->irq_release, NULL, keypad_irq, 0, | |
| 238 | − dev_name(dev), kp); | |
| 237 | + error = request_threaded_irq(kp->irq_release, NULL, keypad_irq, | |
| 238 | + IRQF_ONESHOT, dev_name(dev), kp); | |
| 239 | 239 | if (error < 0) { |
| 240 | 240 | dev_err(kp->dev, "Could not allocate keypad release key irq\n"); |
| 241 | 241 | goto error_irq_release; |
| @@ -972,6 +972,7 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq, · 971 unmodified lines | ||
| 972 | 972 | struct ad714x_platform_data *plat_data = dev->platform_data; |
| 973 | 973 | struct ad714x_chip *ad714x; |
| 974 | 974 | void *drv_mem; |
| 975 | + unsigned long irqflags; | |
| 975 | 976 | |
| 976 | 977 | struct ad714x_button_drv *bt_drv; |
| 977 | 978 | struct ad714x_slider_drv *sd_drv; |
| @@ -1162,10 +1163,11 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq, · 184 unmodified lines | ||
| 1162 | 1163 | alloc_idx++; |
| 1163 | 1164 | } |
| 1164 | 1165 | |
| 1166 | + irqflags = plat_data->irqflags ?: IRQF_TRIGGER_FALLING; | |
| 1167 | + irqflags |= IRQF_ONESHOT; | |
| 1168 | + | |
| 1165 | 1169 | error = request_threaded_irq(ad714x->irq, NULL, ad714x_interrupt_thread, |
| 1166 | − plat_data->irqflags ? | |
| 1167 | − plat_data->irqflags : IRQF_TRIGGER_FALLING, | |
| 1168 | − "ad714x_captouch", ad714x); | |
| 1170 | + irqflags, "ad714x_captouch", ad714x); | |
| 1169 | 1171 | if (error) { |
| 1170 | 1172 | dev_err(dev, "can't allocate irq %d\n", ad714x->irq); |
| 1171 | 1173 | goto err_unreg_dev; |
| @@ -213,7 +213,8 @@ static int __devinit dm355evm_keys_probe(struct platform_device *pdev) · 212 unmodified lines | ||
| 213 | 213 | /* REVISIT: flush the event queue? */ |
| 214 | 214 | |
| 215 | 215 | status = request_threaded_irq(keys->irq, NULL, dm355evm_keys_irq, |
| 216 | − IRQF_TRIGGER_FALLING, dev_name(&pdev->dev), keys); | |
| 216 | + IRQF_TRIGGER_FALLING | IRQF_ONESHOT, | |
| 217 | + dev_name(&pdev->dev), keys); | |
| 217 | 218 | if (status < 0) |
| 218 | 219 | goto fail2; |
| 219 | 220 | |
| @@ -597,7 +597,7 @@ struct ad7879 *ad7879_probe(struct device *dev, u8 devid, unsigned int irq, · 596 unmodified lines | ||
| 597 | 597 | AD7879_TMR(ts->pen_down_acc_interval); |
| 598 | 598 | |
| 599 | 599 | err = request_threaded_irq(ts->irq, NULL, ad7879_irq, |
| 600 | − IRQF_TRIGGER_FALLING, | |
| 600 | + IRQF_TRIGGER_FALLING | IRQF_ONESHOT, | |
| 601 | 601 | dev_name(dev), ts); |
| 602 | 602 | if (err) { |
| 603 | 603 | dev_err(dev, "irq %d busy?\n", ts->irq); |
| @@ -1149,7 +1149,8 @@ static int __devinit mxt_probe(struct i2c_client *client, · 1148 unmodified lines | ||
| 1149 | 1149 | goto err_free_object; |
| 1150 | 1150 | |
| 1151 | 1151 | error = request_threaded_irq(client->irq, NULL, mxt_interrupt, |
| 1152 | − pdata->irqflags, client->dev.driver->name, data); | |
| 1152 | + pdata->irqflags | IRQF_ONESHOT, | |
| 1153 | + client->dev.driver->name, data); | |
| 1153 | 1154 | if (error) { |
| 1154 | 1155 | dev_err(&client->dev, "Failed to register interrupt\n"); |
| 1155 | 1156 | goto err_free_object; |
| @@ -509,7 +509,8 @@ static int __devinit bu21013_probe(struct i2c_client *client, · 508 unmodified lines | ||
| 509 | 509 | input_set_drvdata(in_dev, bu21013_data); |
| 510 | 510 | |
| 511 | 511 | error = request_threaded_irq(pdata->irq, NULL, bu21013_gpio_irq, |
| 512 | − IRQF_TRIGGER_FALLING | IRQF_SHARED, | |
| 512 | + IRQF_TRIGGER_FALLING | IRQF_SHARED | | |
| 513 | + IRQF_ONESHOT, | |
| 513 | 514 | DRIVER_TP, bu21013_data); |
| 514 | 515 | if (error) { |
| 515 | 516 | dev_err(&client->dev, "request irq %d failed\n", pdata->irq); |
| @@ -251,7 +251,8 @@ static int __devinit cy8ctmg110_probe(struct i2c_client *client, · 250 unmodified lines | ||
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | err = request_threaded_irq(client->irq, NULL, cy8ctmg110_irq_thread, |
| 254 | − IRQF_TRIGGER_RISING, "touch_reset_key", ts); | |
| 254 | + IRQF_TRIGGER_RISING | IRQF_ONESHOT, | |
| 255 | + "touch_reset_key", ts); | |
| 255 | 256 | if (err < 0) { |
| 256 | 257 | dev_err(&client->dev, |
| 257 | 258 | "irq %d busy? error %d\n", client->irq, err); |
| @@ -620,7 +620,7 @@ static int __devinit mrstouch_probe(struct platform_device *pdev) · 619 unmodified lines | ||
| 620 | 620 | MRST_PRESSURE_MIN, MRST_PRESSURE_MAX, 0, 0); |
| 621 | 621 | |
| 622 | 622 | err = request_threaded_irq(tsdev->irq, NULL, mrstouch_pendet_irq, |
| 623 | − 0, "mrstouch", tsdev); | |
| 623 | + IRQF_ONESHOT, "mrstouch", tsdev); | |
| 624 | 624 | if (err) { |
| 625 | 625 | dev_err(tsdev->dev, "unable to allocate irq\n"); |
| 626 | 626 | goto err_free_mem; |
| @@ -165,7 +165,7 @@ static int __devinit pixcir_i2c_ts_probe(struct i2c_client *client, · 164 unmodified lines | ||
| 165 | 165 | input_set_drvdata(input, tsdata); |
| 166 | 166 | |
| 167 | 167 | error = request_threaded_irq(client->irq, NULL, pixcir_ts_isr, |
| 168 | − IRQF_TRIGGER_FALLING, | |
| 168 | + IRQF_TRIGGER_FALLING | IRQF_ONESHOT, | |
| 169 | 169 | client->name, tsdata); |
| 170 | 170 | if (error) { |
| 171 | 171 | dev_err(&client->dev, "Unable to request touchscreen IRQ.\n"); |
| @@ -297,7 +297,7 @@ static int __devinit tsc_probe(struct platform_device *pdev) · 296 unmodified lines | ||
| 297 | 297 | goto error_clk; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | − error = request_threaded_irq(ts->tsc_irq, NULL, tsc_irq, 0, | |
| 300 | + error = request_threaded_irq(ts->tsc_irq, NULL, tsc_irq, IRQF_ONESHOT, | |
| 301 | 301 | dev_name(dev), ts); |
| 302 | 302 | if (error < 0) { |
| 303 | 303 | dev_err(ts->dev, "Could not allocate ts irq\n"); |
| @@ -650,7 +650,8 @@ static int __devinit tsc2005_probe(struct spi_device *spi) · 649 unmodified lines | ||
| 650 | 650 | tsc2005_stop_scan(ts); |
| 651 | 651 | |
| 652 | 652 | error = request_threaded_irq(spi->irq, NULL, tsc2005_irq_thread, |
| 653 | − IRQF_TRIGGER_RISING, "tsc2005", ts); | |
| 653 | + IRQF_TRIGGER_RISING | IRQF_ONESHOT, | |
| 654 | + "tsc2005", ts); | |
| 654 | 655 | if (error) { |
| 655 | 656 | dev_err(&spi->dev, "Failed to request irq, err: %d\n", error); |
| 656 | 657 | goto err_free_mem; |