diff options
author | Theodore Ts'o <tytso@mit.edu> | 2012-07-14 20:27:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-15 15:04:28 -0400 |
commit | b6b847a93be87fc9974d8232984668a5a59754df (patch) | |
tree | ae0c3cb7fe98627cd7e61d5f8fbae68fd3704d95 | |
parent | f99ef862a7235bb06e963bd99e3c4287f5b8f6fd (diff) |
random: remove rand_initialize_irq()
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>
-rw-r--r-- | arch/ia64/kernel/irq_ia64.c | 1 | ||||
-rw-r--r-- | drivers/char/random.c | 55 | ||||
-rw-r--r-- | drivers/mfd/ab3100-core.c | 3 | ||||
-rw-r--r-- | drivers/mfd/ab3550-core.c | 2 | ||||
-rw-r--r-- | include/linux/irqdesc.h | 1 | ||||
-rw-r--r-- | include/linux/random.h | 2 | ||||
-rw-r--r-- | kernel/irq/manage.c | 17 |
7 files changed, 0 insertions, 81 deletions
diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c index 782c3a357f2..3540c5e8042 100644 --- a/arch/ia64/kernel/irq_ia64.c +++ b/arch/ia64/kernel/irq_ia64.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/ioport.h> | 23 | #include <linux/ioport.h> |
24 | #include <linux/kernel_stat.h> | 24 | #include <linux/kernel_stat.h> |
25 | #include <linux/ptrace.h> | 25 | #include <linux/ptrace.h> |
26 | #include <linux/random.h> /* for rand_initialize_irq() */ | ||
27 | #include <linux/signal.h> | 26 | #include <linux/signal.h> |
28 | #include <linux/smp.h> | 27 | #include <linux/smp.h> |
29 | #include <linux/threads.h> | 28 | #include <linux/threads.h> |
diff --git a/drivers/char/random.c b/drivers/char/random.c index e70701ec3b0..5df09b014ea 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -634,43 +634,6 @@ struct timer_rand_state { | |||
634 | unsigned dont_count_entropy:1; | 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 | * Add device- or boot-specific data to the input and nonblocking | 638 | * Add device- or boot-specific data to the input and nonblocking |
676 | * pools to help initialize them to unique values. | 639 | * pools to help initialize them to unique values. |
@@ -1133,24 +1096,6 @@ static int rand_initialize(void) | |||
1133 | } | 1096 | } |
1134 | module_init(rand_initialize); | 1097 | module_init(rand_initialize); |
1135 | 1098 | ||
1136 | void rand_initialize_irq(int irq) | ||
1137 | { | ||
1138 | struct timer_rand_state *state; | ||
1139 | |||
1140 | state = get_timer_rand_state(irq); | ||
1141 | |||
1142 | if (state) | ||
1143 | return; | ||
1144 | |||
1145 | /* | ||
1146 | * If kzalloc returns null, we just won't use that entropy | ||
1147 | * source. | ||
1148 | */ | ||
1149 | state = kzalloc(sizeof(struct timer_rand_state), GFP_KERNEL); | ||
1150 | if (state) | ||
1151 | set_timer_rand_state(irq, state); | ||
1152 | } | ||
1153 | |||
1154 | #ifdef CONFIG_BLOCK | 1099 | #ifdef CONFIG_BLOCK |
1155 | void rand_initialize_disk(struct gendisk *disk) | 1100 | void rand_initialize_disk(struct gendisk *disk) |
1156 | { | 1101 | { |
diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c index c0befd3ad98..ccd81b1540a 100644 --- a/drivers/mfd/ab3100-core.c +++ b/drivers/mfd/ab3100-core.c | |||
@@ -936,9 +936,6 @@ static int __devinit ab3100_probe(struct i2c_client *client, | |||
936 | 936 | ||
937 | err = request_threaded_irq(client->irq, NULL, ab3100_irq_handler, | 937 | err = request_threaded_irq(client->irq, NULL, ab3100_irq_handler, |
938 | IRQF_ONESHOT, "ab3100-core", ab3100); | 938 | IRQF_ONESHOT, "ab3100-core", ab3100); |
939 | /* This real unpredictable IRQ is of course sampled for entropy */ | ||
940 | rand_initialize_irq(client->irq); | ||
941 | |||
942 | if (err) | 939 | if (err) |
943 | goto exit_no_irq; | 940 | goto exit_no_irq; |
944 | 941 | ||
diff --git a/drivers/mfd/ab3550-core.c b/drivers/mfd/ab3550-core.c index 3d7dce671b9..d69dc4bf8bb 100644 --- a/drivers/mfd/ab3550-core.c +++ b/drivers/mfd/ab3550-core.c | |||
@@ -1309,8 +1309,6 @@ static int __init ab3550_probe(struct i2c_client *client, | |||
1309 | 1309 | ||
1310 | err = request_threaded_irq(client->irq, NULL, ab3550_irq_handler, | 1310 | err = request_threaded_irq(client->irq, NULL, ab3550_irq_handler, |
1311 | IRQF_ONESHOT, "ab3550-core", ab); | 1311 | IRQF_ONESHOT, "ab3550-core", ab); |
1312 | /* This real unpredictable IRQ is of course sampled for entropy */ | ||
1313 | rand_initialize_irq(client->irq); | ||
1314 | 1312 | ||
1315 | if (err) | 1313 | if (err) |
1316 | goto exit_no_irq; | 1314 | goto exit_no_irq; |
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index 2d921b35212..d0a3100b406 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h | |||
@@ -38,7 +38,6 @@ struct timer_rand_state; | |||
38 | */ | 38 | */ |
39 | struct irq_desc { | 39 | struct irq_desc { |
40 | struct irq_data irq_data; | 40 | struct irq_data irq_data; |
41 | struct timer_rand_state *timer_rand_state; | ||
42 | unsigned int __percpu *kstat_irqs; | 41 | unsigned int __percpu *kstat_irqs; |
43 | irq_flow_handler_t handle_irq; | 42 | irq_flow_handler_t handle_irq; |
44 | #ifdef CONFIG_IRQ_PREFLOW_FASTEOI | 43 | #ifdef CONFIG_IRQ_PREFLOW_FASTEOI |
diff --git a/include/linux/random.h b/include/linux/random.h index 29e217a7e6d..ac621ce886c 100644 --- a/include/linux/random.h +++ b/include/linux/random.h | |||
@@ -48,8 +48,6 @@ struct rnd_state { | |||
48 | 48 | ||
49 | #ifdef __KERNEL__ | 49 | #ifdef __KERNEL__ |
50 | 50 | ||
51 | extern void rand_initialize_irq(int irq); | ||
52 | |||
53 | extern void add_device_randomness(const void *, unsigned int); | 51 | extern void add_device_randomness(const void *, unsigned int); |
54 | extern void add_input_randomness(unsigned int type, unsigned int code, | 52 | extern void add_input_randomness(unsigned int type, unsigned int code, |
55 | unsigned int value); | 53 | unsigned int value); |
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index df8136fff8c..fa4a70ee272 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -886,22 +886,6 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) | |||
886 | 886 | ||
887 | if (desc->irq_data.chip == &no_irq_chip) | 887 | if (desc->irq_data.chip == &no_irq_chip) |
888 | return -ENOSYS; | 888 | return -ENOSYS; |
889 | /* | ||
890 | * Some drivers like serial.c use request_irq() heavily, | ||
891 | * so we have to be careful not to interfere with a | ||
892 | * running system. | ||
893 | */ | ||
894 | if (new->flags & IRQF_SAMPLE_RANDOM) { | ||
895 | /* | ||
896 | * This function might sleep, we want to call it first, | ||
897 | * outside of the atomic block. | ||
898 | * Yes, this might clear the entropy pool if the wrong | ||
899 | * driver is attempted to be loaded, without actually | ||
900 | * installing a new handler, but is this really a problem, | ||
901 | * only the sysadmin is able to do this. | ||
902 | */ | ||
903 | rand_initialize_irq(irq); | ||
904 | } | ||
905 | 889 | ||
906 | /* | 890 | /* |
907 | * Check whether the interrupt nests into another interrupt | 891 | * Check whether the interrupt nests into another interrupt |
@@ -1325,7 +1309,6 @@ EXPORT_SYMBOL(free_irq); | |||
1325 | * Flags: | 1309 | * Flags: |
1326 | * | 1310 | * |
1327 | * IRQF_SHARED Interrupt is shared | 1311 | * IRQF_SHARED Interrupt is shared |
1328 | * IRQF_SAMPLE_RANDOM The interrupt can be used for entropy | ||
1329 | * IRQF_TRIGGER_* Specify active edge(s) or level | 1312 | * IRQF_TRIGGER_* Specify active edge(s) or level |
1330 | * | 1313 | * |
1331 | */ | 1314 | */ |