random: remove rand_initialize_irq()
authorTheodore Ts'o <tytso@mit.edu>
Sun, 15 Jul 2012 00:27:52 +0000 (20:27 -0400)
committerWilly Tarreau <w@1wt.eu>
Sun, 7 Oct 2012 21:41:21 +0000 (23:41 +0200)
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>
[PG: in .34 the irqdesc.h content is in irq.h instead.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
arch/ia64/kernel/irq_ia64.c
drivers/char/random.c
include/linux/irq.h
include/linux/random.h
kernel/irq/manage.c

index dd9d7b54f1a1f59f0a04a10a3ad6386d94f16472..463b8a73c558fcdaa075965550341a4b1c08cedb 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/kernel_stat.h>
 #include <linux/slab.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 3ea1ddbb62badb4a226188dfba5a58332fc283fe..cbb63b0e3ef82c899d6d86465c2ad52bb6cca839 100644 (file)
@@ -621,43 +621,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.
@@ -1123,24 +1086,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 9e5f45a8bab494c6b4ecbdf37df50e3063401f36..23337104761e6d7e40fa1cc4b30c475e3e40a738 100644 (file)
@@ -174,7 +174,6 @@ struct irq_2_iommu;
  */
 struct irq_desc {
        unsigned int            irq;
-       struct timer_rand_state *timer_rand_state;
        unsigned int            *kstat_irqs;
 #ifdef CONFIG_INTR_REMAP
        struct irq_2_iommu      *irq_2_iommu;
index 5a376bcfbe99555da33b5da287a1cd6eccfa0732..1864957af85064e84f200a0378f632249abf6f9f 100644 (file)
@@ -44,8 +44,6 @@ struct rand_pool_info {
 
 #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 315705ca00f3db41bc6a0c26a711ab85a05142ba..5dd29f3ed46a1407cb035e7e4709e219ea5fdfad 100644 (file)
@@ -633,22 +633,6 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 
        if (desc->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);
-       }
 
        /* Oneshot interrupts are not allowed with shared */
        if ((new->flags & IRQF_ONESHOT) && (new->flags & IRQF_SHARED))
@@ -1021,7 +1005,6 @@ EXPORT_SYMBOL(free_irq);
  *
  *     IRQF_SHARED             Interrupt is shared
  *     IRQF_DISABLED   Disable local interrupts while processing
- *     IRQF_SAMPLE_RANDOM      The interrupt can be used for entropy
  *     IRQF_TRIGGER_*          Specify active edge(s) or level
  *
  */