1 --- a/arch/arm/mach-omap1/board-palmz71.c
2 +++ b/arch/arm/mach-omap1/board-palmz71.c
3 @@ -291,8 +291,7 @@ palmz71_gpio_setup(int early)
5 gpio_direction_input(PALMZ71_USBDETECT_GPIO);
6 if (request_irq(gpio_to_irq(PALMZ71_USBDETECT_GPIO),
7 - palmz71_powercable, IRQF_SAMPLE_RANDOM,
9 + palmz71_powercable, 0, "palmz71-cable", 0))
11 "IRQ request for power cable failed!\n");
12 palmz71_powercable(gpio_to_irq(PALMZ71_USBDETECT_GPIO), 0);
13 --- a/arch/arm/mach-pxa/lubbock.c
14 +++ b/arch/arm/mach-pxa/lubbock.c
15 @@ -455,7 +455,7 @@ static int lubbock_mci_init(struct devic
16 init_timer(&mmc_timer);
17 mmc_timer.data = (unsigned long) data;
18 return request_irq(LUBBOCK_SD_IRQ, lubbock_detect_int,
19 - IRQF_SAMPLE_RANDOM, "lubbock-sd-detect", data);
20 + 0, "lubbock-sd-detect", data);
23 static int lubbock_mci_get_ro(struct device *dev)
24 --- a/arch/arm/mach-pxa/magician.c
25 +++ b/arch/arm/mach-pxa/magician.c
26 @@ -617,9 +617,8 @@ static struct platform_device bq24022 =
27 static int magician_mci_init(struct device *dev,
28 irq_handler_t detect_irq, void *data)
30 - return request_irq(IRQ_MAGICIAN_SD, detect_irq,
31 - IRQF_DISABLED | IRQF_SAMPLE_RANDOM,
32 - "mmc card detect", data);
33 + return request_irq(IRQ_MAGICIAN_SD, detect_irq, IRQF_DISABLED,
34 + "mmc card detect", data);
37 static void magician_mci_exit(struct device *dev, void *data)
38 --- a/arch/arm/mach-pxa/trizeps4.c
39 +++ b/arch/arm/mach-pxa/trizeps4.c
40 @@ -332,8 +332,8 @@ static int trizeps4_mci_init(struct devi
43 err = request_irq(TRIZEPS4_MMC_IRQ, mci_detect_int,
44 - IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_SAMPLE_RANDOM,
45 - "MMC card detect", data);
46 + IRQF_DISABLED | IRQF_TRIGGER_RISING,
47 + "MMC card detect", data);
49 printk(KERN_ERR "trizeps4_mci_init: MMC/SD: can't request"
50 "MMC card detect IRQ\n");
51 --- a/arch/ia64/kernel/irq_ia64.c
52 +++ b/arch/ia64/kernel/irq_ia64.c
54 #include <linux/ioport.h>
55 #include <linux/kernel_stat.h>
56 #include <linux/ptrace.h>
57 -#include <linux/random.h> /* for rand_initialize_irq() */
58 #include <linux/signal.h>
59 #include <linux/smp.h>
60 #include <linux/threads.h>
61 --- a/arch/sparc/kernel/ldc.c
62 +++ b/arch/sparc/kernel/ldc.c
63 @@ -1250,14 +1250,12 @@ int ldc_bind(struct ldc_channel *lp, con
64 snprintf(lp->rx_irq_name, LDC_IRQ_NAME_MAX, "%s RX", name);
65 snprintf(lp->tx_irq_name, LDC_IRQ_NAME_MAX, "%s TX", name);
67 - err = request_irq(lp->cfg.rx_irq, ldc_rx,
68 - IRQF_SAMPLE_RANDOM | IRQF_DISABLED,
69 + err = request_irq(lp->cfg.rx_irq, ldc_rx, IRQF_DISABLED,
74 - err = request_irq(lp->cfg.tx_irq, ldc_tx,
75 - IRQF_SAMPLE_RANDOM | IRQF_DISABLED,
76 + err = request_irq(lp->cfg.tx_irq, ldc_tx, IRQF_DISABLED,
79 free_irq(lp->cfg.rx_irq, lp);
80 --- a/arch/um/drivers/line.c
81 +++ b/arch/um/drivers/line.c
82 @@ -371,7 +371,7 @@ static irqreturn_t line_write_interrupt(
83 int line_setup_irq(int fd, int input, int output, struct line *line, void *data)
85 const struct line_driver *driver = line->driver;
86 - int err = 0, flags = IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM;
87 + int err = 0, flags = IRQF_DISABLED | IRQF_SHARED;
90 err = um_request_irq(driver->read_irq, fd, IRQ_READ,
91 @@ -807,7 +807,7 @@ void register_winch_irq(int fd, int tty_
94 if (um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt,
95 - IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM,
96 + IRQF_DISABLED | IRQF_SHARED,
97 "winch", winch) < 0) {
98 printk(KERN_ERR "register_winch_irq - failed to register "
100 --- a/arch/um/drivers/mconsole_kern.c
101 +++ b/arch/um/drivers/mconsole_kern.c
102 @@ -773,7 +773,7 @@ static int __init mconsole_init(void)
103 register_reboot_notifier(&reboot_notifier);
105 err = um_request_irq(MCONSOLE_IRQ, sock, IRQ_READ, mconsole_interrupt,
106 - IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM,
107 + IRQF_DISABLED | IRQF_SHARED,
108 "mconsole", (void *)sock);
110 printk(KERN_ERR "Failed to get IRQ for management console\n");
111 --- a/arch/um/drivers/port_kern.c
112 +++ b/arch/um/drivers/port_kern.c
113 @@ -100,7 +100,7 @@ static int port_accept(struct port_list
116 if (um_request_irq(TELNETD_IRQ, socket[0], IRQ_READ, pipe_interrupt,
117 - IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM,
118 + IRQF_DISABLED | IRQF_SHARED,
120 printk(KERN_ERR "port_accept : failed to get IRQ for "
122 @@ -184,7 +184,7 @@ void *port_data(int port_num)
125 if (um_request_irq(ACCEPT_IRQ, fd, IRQ_READ, port_interrupt,
126 - IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM,
127 + IRQF_DISABLED | IRQF_SHARED,
129 printk(KERN_ERR "Failed to get IRQ for port %d\n", port_num);
131 --- a/arch/um/drivers/random.c
132 +++ b/arch/um/drivers/random.c
133 @@ -131,8 +131,7 @@ static int __init rng_init (void)
136 err = um_request_irq(RANDOM_IRQ, random_fd, IRQ_READ, random_interrupt,
137 - IRQF_DISABLED | IRQF_SAMPLE_RANDOM, "random",
139 + IRQF_DISABLED, "random", NULL);
141 goto err_out_cleanup_hw;
143 --- a/arch/um/drivers/xterm_kern.c
144 +++ b/arch/um/drivers/xterm_kern.c
145 @@ -50,8 +50,7 @@ int xterm_fd(int socket, int *pid_out)
146 init_completion(&data->ready);
148 err = um_request_irq(XTERM_IRQ, socket, IRQ_READ, xterm_interrupt,
149 - IRQF_DISABLED | IRQF_SHARED | IRQF_SAMPLE_RANDOM,
151 + IRQF_DISABLED | IRQF_SHARED, "xterm", data);
153 printk(KERN_ERR "xterm_fd : failed to get IRQ for xterm, "
155 --- a/arch/um/kernel/sigio.c
156 +++ b/arch/um/kernel/sigio.c
157 @@ -25,8 +25,7 @@ int write_sigio_irq(int fd)
160 err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt,
161 - IRQF_DISABLED|IRQF_SAMPLE_RANDOM, "write sigio",
163 + IRQF_DISABLED, "write sigio", NULL);
165 printk(KERN_ERR "write_sigio_irq : um_request_irq failed, "
167 --- a/Documentation/feature-removal-schedule.txt
168 +++ b/Documentation/feature-removal-schedule.txt
169 @@ -71,20 +71,6 @@ Who: Luis R. Rodriguez <lrodriguez@ather
171 ---------------------------
173 -What: IRQF_SAMPLE_RANDOM
174 -Check: IRQF_SAMPLE_RANDOM
177 -Why: Many of IRQF_SAMPLE_RANDOM users are technically bogus as entropy
178 - sources in the kernel's current entropy model. To resolve this, every
179 - input point to the kernel's entropy pool needs to better document the
180 - type of entropy source it actually is. This will be replaced with
181 - additional add_*_randomness functions in drivers/char/random.c
183 -Who: Robin Getz <rgetz@blackfin.uclinux.org> & Matt Mackall <mpm@selenic.com>
185 ----------------------------
187 What: The ieee80211_regdom module parameter
188 When: March 2010 / desktop catchup
190 --- a/drivers/block/xen-blkfront.c
191 +++ b/drivers/block/xen-blkfront.c
192 @@ -852,9 +852,8 @@ static int setup_blkring(struct xenbus_d
196 - err = bind_evtchn_to_irqhandler(info->evtchn,
198 - IRQF_SAMPLE_RANDOM, "blkif", info);
199 + err = bind_evtchn_to_irqhandler(info->evtchn, blkif_interrupt, 0,
202 xenbus_dev_fatal(dev, err,
203 "bind_evtchn_to_irqhandler failed");
204 --- a/drivers/char/random.c
205 +++ b/drivers/char/random.c
206 @@ -633,43 +633,6 @@ struct timer_rand_state {
207 unsigned dont_count_entropy:1;
210 -#ifndef CONFIG_GENERIC_HARDIRQS
212 -static struct timer_rand_state *irq_timer_state[NR_IRQS];
214 -static struct timer_rand_state *get_timer_rand_state(unsigned int irq)
216 - return irq_timer_state[irq];
219 -static void set_timer_rand_state(unsigned int irq,
220 - struct timer_rand_state *state)
222 - irq_timer_state[irq] = state;
227 -static struct timer_rand_state *get_timer_rand_state(unsigned int irq)
229 - struct irq_desc *desc;
231 - desc = irq_to_desc(irq);
233 - return desc->timer_rand_state;
236 -static void set_timer_rand_state(unsigned int irq,
237 - struct timer_rand_state *state)
239 - struct irq_desc *desc;
241 - desc = irq_to_desc(irq);
243 - desc->timer_rand_state = state;
248 * Add device- or boot-specific data to the input and nonblocking
249 * pools to help initialize them to unique values.
250 @@ -1131,24 +1094,6 @@ static int rand_initialize(void)
252 module_init(rand_initialize);
254 -void rand_initialize_irq(int irq)
256 - struct timer_rand_state *state;
258 - state = get_timer_rand_state(irq);
264 - * If kzalloc returns null, we just won't use that entropy
267 - state = kzalloc(sizeof(struct timer_rand_state), GFP_KERNEL);
269 - set_timer_rand_state(irq, state);
273 void rand_initialize_disk(struct gendisk *disk)
275 --- a/drivers/crypto/n2_core.c
276 +++ b/drivers/crypto/n2_core.c
277 @@ -1607,8 +1607,7 @@ static int spu_map_ino(struct platform_d
279 sprintf(p->irq_name, "%s-%d", irq_name, index);
281 - return request_irq(p->irq, handler, IRQF_SAMPLE_RANDOM,
283 + return request_irq(p->irq, handler, 0, p->irq_name, p);
286 static struct kmem_cache *queue_cache[2];
287 --- a/drivers/hv/vmbus_drv.c
288 +++ b/drivers/hv/vmbus_drv.c
289 @@ -545,8 +545,7 @@ static int vmbus_bus_init(int irq)
293 - ret = request_irq(irq, vmbus_isr, IRQF_SAMPLE_RANDOM,
294 - driver_name, hv_acpi_dev);
295 + ret = request_irq(irq, vmbus_isr, 0, driver_name, hv_acpi_dev);
298 pr_err("Unable to request IRQ %d\n",
299 --- a/drivers/i2c/busses/i2c-pmcmsp.c
300 +++ b/drivers/i2c/busses/i2c-pmcmsp.c
301 @@ -306,8 +306,7 @@ static int __devinit pmcmsptwi_probe(str
302 pmcmsptwi_data.irq = platform_get_irq(pldev, 0);
303 if (pmcmsptwi_data.irq) {
304 rc = request_irq(pmcmsptwi_data.irq, &pmcmsptwi_interrupt,
305 - IRQF_SHARED | IRQF_SAMPLE_RANDOM,
306 - pldev->name, &pmcmsptwi_data);
307 + IRQF_SHARED, pldev->name, &pmcmsptwi_data);
310 * Enable 'DONE' interrupt only.
311 --- a/drivers/input/serio/hp_sdc.c
312 +++ b/drivers/input/serio/hp_sdc.c
313 @@ -879,7 +879,7 @@ static int __init hp_sdc_init(void)
316 errstr = "IRQ not available for";
317 - if (request_irq(hp_sdc.irq, &hp_sdc_isr, IRQF_SHARED|IRQF_SAMPLE_RANDOM,
318 + if (request_irq(hp_sdc.irq, &hp_sdc_isr, IRQF_SHARED,
322 --- a/drivers/mfd/ab3100-core.c
323 +++ b/drivers/mfd/ab3100-core.c
324 @@ -937,9 +937,6 @@ static int __devinit ab3100_probe(struct
326 err = request_threaded_irq(client->irq, NULL, ab3100_irq_handler,
327 IRQF_ONESHOT, "ab3100-core", ab3100);
328 - /* This real unpredictable IRQ is of course sampled for entropy */
329 - rand_initialize_irq(client->irq);
334 --- a/drivers/mfd/tps65010.c
335 +++ b/drivers/mfd/tps65010.c
336 @@ -563,8 +563,7 @@ static int tps65010_probe(struct i2c_cli
338 if (client->irq > 0) {
339 status = request_irq(client->irq, tps65010_irq,
340 - IRQF_SAMPLE_RANDOM | IRQF_TRIGGER_FALLING,
342 + IRQF_TRIGGER_FALLING, DRIVER_NAME, tps);
344 dev_dbg(&client->dev, "can't get IRQ %d, err %d\n",
345 client->irq, status);
346 --- a/drivers/net/ethernet/broadcom/tg3.c
347 +++ b/drivers/net/ethernet/broadcom/tg3.c
348 @@ -9415,7 +9415,7 @@ static int tg3_test_interrupt(struct tg3
351 err = request_irq(tnapi->irq_vec, tg3_test_isr,
352 - IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, tnapi);
353 + IRQF_SHARED, dev->name, tnapi);
357 --- a/drivers/power/pda_power.c
358 +++ b/drivers/power/pda_power.c
361 static inline unsigned int get_irq_flags(struct resource *res)
363 - unsigned int flags = IRQF_SAMPLE_RANDOM | IRQF_SHARED;
365 - flags |= res->flags & IRQF_TRIGGER_MASK;
368 + return IRQF_SHARED | (res->flags & IRQF_TRIGGER_MASK);
371 static struct device *dev;
372 --- a/drivers/tty/serial/uartlite.c
373 +++ b/drivers/tty/serial/uartlite.c
374 @@ -216,8 +216,7 @@ static int ulite_startup(struct uart_por
378 - ret = request_irq(port->irq, ulite_isr,
379 - IRQF_SHARED | IRQF_SAMPLE_RANDOM, "uartlite", port);
380 + ret = request_irq(port->irq, ulite_isr, IRQF_SHARED, "uartlite", port);
384 --- a/drivers/usb/gadget/goku_udc.c
385 +++ b/drivers/usb/gadget/goku_udc.c
386 @@ -1839,7 +1839,7 @@ static int goku_probe(struct pci_dev *pd
387 /* init to known state, then setup irqs */
390 - if (request_irq(pdev->irq, goku_irq, IRQF_SHARED/*|IRQF_SAMPLE_RANDOM*/,
391 + if (request_irq(pdev->irq, goku_irq, IRQF_SHARED,
392 driver_name, dev) != 0) {
393 DBG(dev, "request interrupt %d failed\n", pdev->irq);
395 --- a/drivers/usb/gadget/omap_udc.c
396 +++ b/drivers/usb/gadget/omap_udc.c
397 @@ -2943,7 +2943,7 @@ known:
399 /* USB general purpose IRQ: ep0, state changes, dma, etc */
400 status = request_irq(pdev->resource[1].start, omap_udc_irq,
401 - IRQF_SAMPLE_RANDOM, driver_name, udc);
402 + 0, driver_name, udc);
404 ERR("can't get irq %d, err %d\n",
405 (int) pdev->resource[1].start, status);
406 @@ -2952,7 +2952,7 @@ known:
408 /* USB "non-iso" IRQ (PIO for all but ep0) */
409 status = request_irq(pdev->resource[2].start, omap_udc_pio_irq,
410 - IRQF_SAMPLE_RANDOM, "omap_udc pio", udc);
411 + 0, "omap_udc pio", udc);
413 ERR("can't get irq %d, err %d\n",
414 (int) pdev->resource[2].start, status);
415 --- a/drivers/usb/gadget/pxa25x_udc.c
416 +++ b/drivers/usb/gadget/pxa25x_udc.c
417 @@ -2202,19 +2202,15 @@ static int __init pxa25x_udc_probe(struc
419 #ifdef CONFIG_ARCH_LUBBOCK
420 if (machine_is_lubbock()) {
421 - retval = request_irq(LUBBOCK_USB_DISC_IRQ,
423 - IRQF_SAMPLE_RANDOM,
425 + retval = request_irq(LUBBOCK_USB_DISC_IRQ, lubbock_vbus_irq,
426 + 0, driver_name, dev);
428 pr_err("%s: can't get irq %i, err %d\n",
429 driver_name, LUBBOCK_USB_DISC_IRQ, retval);
432 - retval = request_irq(LUBBOCK_USB_IRQ,
434 - IRQF_SAMPLE_RANDOM,
436 + retval = request_irq(LUBBOCK_USB_IRQ, lubbock_vbus_irq,
437 + 0, driver_name, dev);
439 pr_err("%s: can't get irq %i, err %d\n",
440 driver_name, LUBBOCK_USB_IRQ, retval);
441 --- a/drivers/usb/otg/gpio_vbus.c
442 +++ b/drivers/usb/otg/gpio_vbus.c
443 @@ -51,8 +51,7 @@ struct gpio_vbus_data {
444 * edges might be workable.
446 #define VBUS_IRQ_FLAGS \
447 - ( IRQF_SAMPLE_RANDOM | IRQF_SHARED \
448 - | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING )
449 + ( IRQF_SHARED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING )
452 /* interface to regulator framework */
453 @@ -253,7 +252,7 @@ static int __init gpio_vbus_probe(struct
456 res->flags &= IRQF_TRIGGER_MASK;
457 - res->flags |= IRQF_SAMPLE_RANDOM | IRQF_SHARED;
458 + res->flags |= IRQF_SHARED;
460 irq = gpio_to_irq(gpio);
462 --- a/drivers/usb/otg/isp1301_omap.c
463 +++ b/drivers/usb/otg/isp1301_omap.c
464 @@ -1567,7 +1567,6 @@ isp1301_probe(struct i2c_client *i2c, co
465 isp->irq_type = IRQF_TRIGGER_FALLING;
468 - isp->irq_type |= IRQF_SAMPLE_RANDOM;
469 status = request_irq(i2c->irq, isp1301_irq,
470 isp->irq_type, DRIVER_NAME, isp);
472 --- a/include/linux/interrupt.h
473 +++ b/include/linux/interrupt.h
476 * IRQF_DISABLED - keep irqs disabled when calling the action handler.
477 * DEPRECATED. This flag is a NOOP and scheduled to be removed
478 - * IRQF_SAMPLE_RANDOM - irq is used to feed the random generator
479 * IRQF_SHARED - allow sharing the irq among several devices
480 * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur
481 * IRQF_TIMER - Flag to mark this interrupt as timer interrupt
485 #define IRQF_DISABLED 0x00000020
486 -#define IRQF_SAMPLE_RANDOM 0x00000040
487 #define IRQF_SHARED 0x00000080
488 #define IRQF_PROBE_SHARED 0x00000100
489 #define __IRQF_TIMER 0x00000200
490 --- a/include/linux/irqdesc.h
491 +++ b/include/linux/irqdesc.h
492 @@ -39,7 +39,6 @@ struct module;
495 struct irq_data irq_data;
496 - struct timer_rand_state *timer_rand_state;
497 unsigned int __percpu *kstat_irqs;
498 irq_flow_handler_t handle_irq;
499 #ifdef CONFIG_IRQ_PREFLOW_FASTEOI
500 --- a/include/linux/random.h
501 +++ b/include/linux/random.h
502 @@ -48,8 +48,6 @@ struct rnd_state {
506 -extern void rand_initialize_irq(int irq);
508 extern void add_device_randomness(const void *, unsigned int);
509 extern void add_input_randomness(unsigned int type, unsigned int code,
511 --- a/kernel/irq/manage.c
512 +++ b/kernel/irq/manage.c
513 @@ -891,22 +891,6 @@ __setup_irq(unsigned int irq, struct irq
515 if (!try_module_get(desc->owner))
518 - * Some drivers like serial.c use request_irq() heavily,
519 - * so we have to be careful not to interfere with a
522 - if (new->flags & IRQF_SAMPLE_RANDOM) {
524 - * This function might sleep, we want to call it first,
525 - * outside of the atomic block.
526 - * Yes, this might clear the entropy pool if the wrong
527 - * driver is attempted to be loaded, without actually
528 - * installing a new handler, but is this really a problem,
529 - * only the sysadmin is able to do this.
531 - rand_initialize_irq(irq);
535 * Check whether the interrupt nests into another interrupt
536 @@ -1342,7 +1326,6 @@ EXPORT_SYMBOL(free_irq);
539 * IRQF_SHARED Interrupt is shared
540 - * IRQF_SAMPLE_RANDOM The interrupt can be used for entropy
541 * IRQF_TRIGGER_* Specify active edge(s) or level