diff options
author | Joachim Fenkes <fenkes@de.ibm.com> | 2007-03-22 11:52:13 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-03-22 17:40:16 -0400 |
commit | 73b9e9870f5780cb554b68bbcfa47782b27a3e04 (patch) | |
tree | 969b5f43087afad492be7b12f19933ed872a7acb /drivers/infiniband | |
parent | d60134718820892853e8be7141ef7f6cdb455ea6 (diff) |
IB/ehca: Make scaling code work without CPU hotplug
eHCA scaling code must not depend on register_cpu_notifier() if
CONFIG_HOTPLUG_CPU is not set, so put all related code into #ifdefs.
Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_irq.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c index 20f36bf8b2b6..f284be1c9166 100644 --- a/drivers/infiniband/hw/ehca/ehca_irq.c +++ b/drivers/infiniband/hw/ehca/ehca_irq.c | |||
@@ -66,7 +66,9 @@ | |||
66 | static void queue_comp_task(struct ehca_cq *__cq); | 66 | static void queue_comp_task(struct ehca_cq *__cq); |
67 | 67 | ||
68 | static struct ehca_comp_pool* pool; | 68 | static struct ehca_comp_pool* pool; |
69 | #ifdef CONFIG_HOTPLUG_CPU | ||
69 | static struct notifier_block comp_pool_callback_nb; | 70 | static struct notifier_block comp_pool_callback_nb; |
71 | #endif | ||
70 | 72 | ||
71 | static inline void comp_event_callback(struct ehca_cq *cq) | 73 | static inline void comp_event_callback(struct ehca_cq *cq) |
72 | { | 74 | { |
@@ -733,6 +735,7 @@ static void take_over_work(struct ehca_comp_pool *pool, | |||
733 | 735 | ||
734 | } | 736 | } |
735 | 737 | ||
738 | #ifdef CONFIG_HOTPLUG_CPU | ||
736 | static int comp_pool_callback(struct notifier_block *nfb, | 739 | static int comp_pool_callback(struct notifier_block *nfb, |
737 | unsigned long action, | 740 | unsigned long action, |
738 | void *hcpu) | 741 | void *hcpu) |
@@ -775,6 +778,7 @@ static int comp_pool_callback(struct notifier_block *nfb, | |||
775 | 778 | ||
776 | return NOTIFY_OK; | 779 | return NOTIFY_OK; |
777 | } | 780 | } |
781 | #endif | ||
778 | 782 | ||
779 | int ehca_create_comp_pool(void) | 783 | int ehca_create_comp_pool(void) |
780 | { | 784 | { |
@@ -805,9 +809,11 @@ int ehca_create_comp_pool(void) | |||
805 | } | 809 | } |
806 | } | 810 | } |
807 | 811 | ||
812 | #ifdef CONFIG_HOTPLUG_CPU | ||
808 | comp_pool_callback_nb.notifier_call = comp_pool_callback; | 813 | comp_pool_callback_nb.notifier_call = comp_pool_callback; |
809 | comp_pool_callback_nb.priority =0; | 814 | comp_pool_callback_nb.priority =0; |
810 | register_cpu_notifier(&comp_pool_callback_nb); | 815 | register_cpu_notifier(&comp_pool_callback_nb); |
816 | #endif | ||
811 | 817 | ||
812 | printk(KERN_INFO "eHCA scaling code enabled\n"); | 818 | printk(KERN_INFO "eHCA scaling code enabled\n"); |
813 | 819 | ||
@@ -821,7 +827,9 @@ void ehca_destroy_comp_pool(void) | |||
821 | if (!ehca_scaling_code) | 827 | if (!ehca_scaling_code) |
822 | return; | 828 | return; |
823 | 829 | ||
830 | #ifdef CONFIG_HOTPLUG_CPU | ||
824 | unregister_cpu_notifier(&comp_pool_callback_nb); | 831 | unregister_cpu_notifier(&comp_pool_callback_nb); |
832 | #endif | ||
825 | 833 | ||
826 | for (i = 0; i < NR_CPUS; i++) { | 834 | for (i = 0; i < NR_CPUS; i++) { |
827 | if (cpu_online(i)) | 835 | if (cpu_online(i)) |