Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

random: remove rand_initialize_irq()

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>

-79
-1
arch/ia64/kernel/irq_ia64.c
··· 23 23 #include <linux/ioport.h> 24 24 #include <linux/kernel_stat.h> 25 25 #include <linux/ptrace.h> 26 - #include <linux/random.h> /* for rand_initialize_irq() */ 27 26 #include <linux/signal.h> 28 27 #include <linux/smp.h> 29 28 #include <linux/threads.h>
-55
drivers/char/random.c
··· 634 634 unsigned dont_count_entropy:1; 635 635 }; 636 636 637 - #ifndef CONFIG_GENERIC_HARDIRQS 638 - 639 - static struct timer_rand_state *irq_timer_state[NR_IRQS]; 640 - 641 - static struct timer_rand_state *get_timer_rand_state(unsigned int irq) 642 - { 643 - return irq_timer_state[irq]; 644 - } 645 - 646 - static void set_timer_rand_state(unsigned int irq, 647 - struct timer_rand_state *state) 648 - { 649 - irq_timer_state[irq] = state; 650 - } 651 - 652 - #else 653 - 654 - static struct timer_rand_state *get_timer_rand_state(unsigned int irq) 655 - { 656 - struct irq_desc *desc; 657 - 658 - desc = irq_to_desc(irq); 659 - 660 - return desc->timer_rand_state; 661 - } 662 - 663 - static void set_timer_rand_state(unsigned int irq, 664 - struct timer_rand_state *state) 665 - { 666 - struct irq_desc *desc; 667 - 668 - desc = irq_to_desc(irq); 669 - 670 - desc->timer_rand_state = state; 671 - } 672 - #endif 673 - 674 637 /* 675 638 * Add device- or boot-specific data to the input and nonblocking 676 639 * pools to help initialize them to unique values. ··· 1095 1132 return 0; 1096 1133 } 1097 1134 module_init(rand_initialize); 1098 - 1099 - void rand_initialize_irq(int irq) 1100 - { 1101 - struct timer_rand_state *state; 1102 - 1103 - state = get_timer_rand_state(irq); 1104 - 1105 - if (state) 1106 - return; 1107 - 1108 - /* 1109 - * If kzalloc returns null, we just won't use that entropy 1110 - * source. 1111 - */ 1112 - state = kzalloc(sizeof(struct timer_rand_state), GFP_KERNEL); 1113 - if (state) 1114 - set_timer_rand_state(irq, state); 1115 - } 1116 1135 1117 1136 #ifdef CONFIG_BLOCK 1118 1137 void rand_initialize_disk(struct gendisk *disk)
-3
drivers/mfd/ab3100-core.c
··· 931 931 932 932 err = request_threaded_irq(client->irq, NULL, ab3100_irq_handler, 933 933 IRQF_ONESHOT, "ab3100-core", ab3100); 934 - /* This real unpredictable IRQ is of course sampled for entropy */ 935 - rand_initialize_irq(client->irq); 936 - 937 934 if (err) 938 935 goto exit_no_irq; 939 936
-1
include/linux/irqdesc.h
··· 39 39 */ 40 40 struct irq_desc { 41 41 struct irq_data irq_data; 42 - struct timer_rand_state *timer_rand_state; 43 42 unsigned int __percpu *kstat_irqs; 44 43 irq_flow_handler_t handle_irq; 45 44 #ifdef CONFIG_IRQ_PREFLOW_FASTEOI
-2
include/linux/random.h
··· 48 48 49 49 #ifdef __KERNEL__ 50 50 51 - extern void rand_initialize_irq(int irq); 52 - 53 51 extern void add_device_randomness(const void *, unsigned int); 54 52 extern void add_input_randomness(unsigned int type, unsigned int code, 55 53 unsigned int value);
-17
kernel/irq/manage.c
··· 893 893 return -ENOSYS; 894 894 if (!try_module_get(desc->owner)) 895 895 return -ENODEV; 896 - /* 897 - * Some drivers like serial.c use request_irq() heavily, 898 - * so we have to be careful not to interfere with a 899 - * running system. 900 - */ 901 - if (new->flags & IRQF_SAMPLE_RANDOM) { 902 - /* 903 - * This function might sleep, we want to call it first, 904 - * outside of the atomic block. 905 - * Yes, this might clear the entropy pool if the wrong 906 - * driver is attempted to be loaded, without actually 907 - * installing a new handler, but is this really a problem, 908 - * only the sysadmin is able to do this. 909 - */ 910 - rand_initialize_irq(irq); 911 - } 912 896 913 897 /* 914 898 * Check whether the interrupt nests into another interrupt ··· 1338 1354 * Flags: 1339 1355 * 1340 1356 * IRQF_SHARED Interrupt is shared 1341 - * IRQF_SAMPLE_RANDOM The interrupt can be used for entropy 1342 1357 * IRQF_TRIGGER_* Specify active edge(s) or level 1343 1358 * 1344 1359 */