random: remove rand_initialize_irq()
authorTheodore Ts'o <tytso@mit.edu>
Sun, 15 Jul 2012 00:27:52 +0000 (20:27 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Aug 2012 19:04:28 +0000 (12:04 -0700)
commit c5857ccf293968348e5eb4ebedc68074de3dcda6 upstream.

With the new interrupt sampling system, we are no longer using the
timer_rand_state structure in the irq descriptor, so we can stop
initializing it now.

[ Merged in fixes from Sedat to find some last missing references to
  rand_initialize_irq() ]

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/ia64/kernel/irq_ia64.c
drivers/char/random.c
drivers/mfd/ab3100-core.c
drivers/mfd/ab3550-core.c
include/linux/irqdesc.h
include/linux/random.h
kernel/irq/manage.c

index 782c3a357f24f4d4417ce4a2499e63f1a09a0e3b..3540c5e80426815cf95937cb0b8e7ef96c18c820 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/ioport.h>
 #include <linux/kernel_stat.h>
 #include <linux/ptrace.h>
-#include <linux/random.h>      /* for rand_initialize_irq() */
 #include <linux/signal.h>
 #include <linux/smp.h>
 #include <linux/threads.h>
index e70701ec3b073a5d5bf2d7407e9962c11ec08cd7..5df09b014ea1dea9a35a749f896f1d366d989e55 100644 (file)
@@ -634,43 +634,6 @@ struct timer_rand_state {
        unsigned dont_count_entropy:1;
 };
 
-#ifndef CONFIG_GENERIC_HARDIRQS
-
-static struct timer_rand_state *irq_timer_state[NR_IRQS];
-
-static struct timer_rand_state *get_timer_rand_state(unsigned int irq)
-{
-       return irq_timer_state[irq];
-}
-
-static void set_timer_rand_state(unsigned int irq,
-                                struct timer_rand_state *state)
-{
-       irq_timer_state[irq] = state;
-}
-
-#else
-
-static struct timer_rand_state *get_timer_rand_state(unsigned int irq)
-{
-       struct irq_desc *desc;
-
-       desc = irq_to_desc(irq);
-
-       return desc->timer_rand_state;
-}
-
-static void set_timer_rand_state(unsigned int irq,
-                                struct timer_rand_state *state)
-{
-       struct irq_desc *desc;
-
-       desc = irq_to_desc(irq);
-
-       desc->timer_rand_state = state;
-}
-#endif
-
 /*
  * Add device- or boot-specific data to the input and nonblocking
  * pools to help initialize them to unique values.
@@ -1133,24 +1096,6 @@ static int rand_initialize(void)
 }
 module_init(rand_initialize);
 
-void rand_initialize_irq(int irq)
-{
-       struct timer_rand_state *state;
-
-       state = get_timer_rand_state(irq);
-
-       if (state)
-               return;
-
-       /*
-        * If kzalloc returns null, we just won't use that entropy
-        * source.
-        */
-       state = kzalloc(sizeof(struct timer_rand_state), GFP_KERNEL);
-       if (state)
-               set_timer_rand_state(irq, state);
-}
-
 #ifdef CONFIG_BLOCK
 void rand_initialize_disk(struct gendisk *disk)
 {
index c0befd3ad98fab1ac2ca881e71d7094bdaba9835..ccd81b1540a2140cf49f7f5cb89b2428697d3ef0 100644 (file)
@@ -936,9 +936,6 @@ static int __devinit ab3100_probe(struct i2c_client *client,
 
        err = request_threaded_irq(client->irq, NULL, ab3100_irq_handler,
                                IRQF_ONESHOT, "ab3100-core", ab3100);
-       /* This real unpredictable IRQ is of course sampled for entropy */
-       rand_initialize_irq(client->irq);
-
        if (err)
                goto exit_no_irq;
 
index 3d7dce671b936a1affb6429c2469d56a436e8cf2..d69dc4bf8bbd03d0ff2671a7639cdb664883c152 100644 (file)
@@ -1309,8 +1309,6 @@ static int __init ab3550_probe(struct i2c_client *client,
 
        err = request_threaded_irq(client->irq, NULL, ab3550_irq_handler,
                IRQF_ONESHOT, "ab3550-core", ab);
-       /* This real unpredictable IRQ is of course sampled for entropy */
-       rand_initialize_irq(client->irq);
 
        if (err)
                goto exit_no_irq;
index 2d921b35212c42bbac394430b50fd90914439e24..d0a3100b4061640f82857fe8be80ee997057c74d 100644 (file)
@@ -38,7 +38,6 @@ struct timer_rand_state;
  */
 struct irq_desc {
        struct irq_data         irq_data;
-       struct timer_rand_state *timer_rand_state;
        unsigned int __percpu   *kstat_irqs;
        irq_flow_handler_t      handle_irq;
 #ifdef CONFIG_IRQ_PREFLOW_FASTEOI
index 29e217a7e6d0d1a51a379ded6d1379a718ee5564..ac621ce886ca13a600a879c0132ef2650113aa15 100644 (file)
@@ -48,8 +48,6 @@ struct rnd_state {
 
 #ifdef __KERNEL__
 
-extern void rand_initialize_irq(int irq);
-
 extern void add_device_randomness(const void *, unsigned int);
 extern void add_input_randomness(unsigned int type, unsigned int code,
                                 unsigned int value);
index df8136fff8cc8407d309b0aaef4cf558a51e7251..fa4a70ee2720e98df1ce74361035cbe0690f7308 100644 (file)
@@ -886,22 +886,6 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 
        if (desc->irq_data.chip == &no_irq_chip)
                return -ENOSYS;
-       /*
-        * Some drivers like serial.c use request_irq() heavily,
-        * so we have to be careful not to interfere with a
-        * running system.
-        */
-       if (new->flags & IRQF_SAMPLE_RANDOM) {
-               /*
-                * This function might sleep, we want to call it first,
-                * outside of the atomic block.
-                * Yes, this might clear the entropy pool if the wrong
-                * driver is attempted to be loaded, without actually
-                * installing a new handler, but is this really a problem,
-                * only the sysadmin is able to do this.
-                */
-               rand_initialize_irq(irq);
-       }
 
        /*
         * Check whether the interrupt nests into another interrupt
@@ -1325,7 +1309,6 @@ EXPORT_SYMBOL(free_irq);
  *     Flags:
  *
  *     IRQF_SHARED             Interrupt is shared
- *     IRQF_SAMPLE_RANDOM      The interrupt can be used for entropy
  *     IRQF_TRIGGER_*          Specify active edge(s) or level
  *
  */