diff options
author | Milton Miller <miltonm@bga.com> | 2008-10-09 21:56:33 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-10-13 01:24:18 -0400 |
commit | a244a957ab15ddbeccf4018ef4b3ac8f5fd1566d (patch) | |
tree | 1cdfb55a37e5b8ef542fcd2108d17dd58c739e7f | |
parent | 188bdddd243e6872608099bd1142a03b70571132 (diff) |
powerpc/xics: Initialization code cleanups
We only need to check the ibm,interrupt-server#-size property once, not
once per global server and thread.
We can use !CONFIG_SMP cpu masks and hard_smp_processor_id() to avoid an ifdef.
Put the node when breaking out of the loop on lpar systems.
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/platforms/pseries/xics.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c index 3501fa1fe8c3..27327fc86055 100644 --- a/arch/powerpc/platforms/pseries/xics.c +++ b/arch/powerpc/platforms/pseries/xics.c | |||
@@ -606,21 +606,20 @@ static void xics_update_irq_servers(void) | |||
606 | if (ireg[j] == hcpuid) { | 606 | if (ireg[j] == hcpuid) { |
607 | default_server = hcpuid; | 607 | default_server = hcpuid; |
608 | default_distrib_server = ireg[j+1]; | 608 | default_distrib_server = ireg[j+1]; |
609 | |||
610 | isize = of_get_property(np, | ||
611 | "ibm,interrupt-server#-size", NULL); | ||
612 | if (isize) | ||
613 | interrupt_server_size = *isize; | ||
614 | } | 609 | } |
615 | } | 610 | } |
616 | 611 | ||
612 | /* get the bit size of server numbers */ | ||
613 | isize = of_get_property(np, "ibm,interrupt-server#-size", NULL); | ||
614 | if (isize) | ||
615 | interrupt_server_size = *isize; | ||
616 | |||
617 | of_node_put(np); | 617 | of_node_put(np); |
618 | } | 618 | } |
619 | 619 | ||
620 | static void __init xics_map_one_cpu(int hw_id, unsigned long addr, | 620 | static void __init xics_map_one_cpu(int hw_id, unsigned long addr, |
621 | unsigned long size) | 621 | unsigned long size) |
622 | { | 622 | { |
623 | #ifdef CONFIG_SMP | ||
624 | int i; | 623 | int i; |
625 | 624 | ||
626 | /* This may look gross but it's good enough for now, we don't quite | 625 | /* This may look gross but it's good enough for now, we don't quite |
@@ -634,11 +633,6 @@ static void __init xics_map_one_cpu(int hw_id, unsigned long addr, | |||
634 | return; | 633 | return; |
635 | } | 634 | } |
636 | } | 635 | } |
637 | #else | ||
638 | if (hw_id != 0) | ||
639 | return; | ||
640 | xics_per_cpu[0] = ioremap(addr, size); | ||
641 | #endif /* CONFIG_SMP */ | ||
642 | } | 636 | } |
643 | 637 | ||
644 | static void __init xics_init_one_node(struct device_node *np, | 638 | static void __init xics_init_one_node(struct device_node *np, |
@@ -700,8 +694,10 @@ void __init xics_init_IRQ(void) | |||
700 | 694 | ||
701 | for_each_node_by_type(np, "PowerPC-External-Interrupt-Presentation") { | 695 | for_each_node_by_type(np, "PowerPC-External-Interrupt-Presentation") { |
702 | found = 1; | 696 | found = 1; |
703 | if (firmware_has_feature(FW_FEATURE_LPAR)) | 697 | if (firmware_has_feature(FW_FEATURE_LPAR)) { |
698 | of_node_put(np); | ||
704 | break; | 699 | break; |
700 | } | ||
705 | xics_init_one_node(np, &indx); | 701 | xics_init_one_node(np, &indx); |
706 | } | 702 | } |
707 | if (found == 0) | 703 | if (found == 0) |