aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-20 01:36:52 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-20 01:36:52 -0400
commit880102e78547c1db158a17e36cf0cdd98e7ad710 (patch)
tree3fff9cc54c44dafe275cfabefb96c589e08d971d /arch/powerpc/platforms
parent3d07f0e83d4323d2cd45cc583f7cf1957aca3cac (diff)
parent39ab05c8e0b519ff0a04a869f065746e6e8c3d95 (diff)
Merge remote branch 'origin/master' into merge
Manual merge of arch/powerpc/kernel/smp.c and add missing scheduler_ipi() call to arch/powerpc/platforms/cell/interrupt.c Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c2
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c28
-rw-r--r--arch/powerpc/platforms/powermac/pic.c42
3 files changed, 30 insertions, 42 deletions
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 6a58744d66c3..449c08c15862 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -201,7 +201,7 @@ static irqreturn_t iic_ipi_action(int irq, void *dev_id)
201 generic_smp_call_function_interrupt(); 201 generic_smp_call_function_interrupt();
202 break; 202 break;
203 case PPC_MSG_RESCHEDULE: 203 case PPC_MSG_RESCHEDULE:
204 /* Upcoming sched hook */ 204 scheduler_ipi();
205 break; 205 break;
206 case PPC_MSG_CALL_FUNC_SINGLE: 206 case PPC_MSG_CALL_FUNC_SINGLE:
207 generic_smp_call_function_single_interrupt(); 207 generic_smp_call_function_single_interrupt();
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index acfaccea5f4f..3675da73623f 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -32,6 +32,7 @@
32#include <linux/io.h> 32#include <linux/io.h>
33#include <linux/mutex.h> 33#include <linux/mutex.h>
34#include <linux/linux_logo.h> 34#include <linux/linux_logo.h>
35#include <linux/syscore_ops.h>
35#include <asm/spu.h> 36#include <asm/spu.h>
36#include <asm/spu_priv1.h> 37#include <asm/spu_priv1.h>
37#include <asm/spu_csa.h> 38#include <asm/spu_csa.h>
@@ -521,18 +522,8 @@ void spu_init_channels(struct spu *spu)
521} 522}
522EXPORT_SYMBOL_GPL(spu_init_channels); 523EXPORT_SYMBOL_GPL(spu_init_channels);
523 524
524static int spu_shutdown(struct sys_device *sysdev)
525{
526 struct spu *spu = container_of(sysdev, struct spu, sysdev);
527
528 spu_free_irqs(spu);
529 spu_destroy_spu(spu);
530 return 0;
531}
532
533static struct sysdev_class spu_sysdev_class = { 525static struct sysdev_class spu_sysdev_class = {
534 .name = "spu", 526 .name = "spu",
535 .shutdown = spu_shutdown,
536}; 527};
537 528
538int spu_add_sysdev_attr(struct sysdev_attribute *attr) 529int spu_add_sysdev_attr(struct sysdev_attribute *attr)
@@ -797,6 +788,22 @@ static inline void crash_register_spus(struct list_head *list)
797} 788}
798#endif 789#endif
799 790
791static void spu_shutdown(void)
792{
793 struct spu *spu;
794
795 mutex_lock(&spu_full_list_mutex);
796 list_for_each_entry(spu, &spu_full_list, full_list) {
797 spu_free_irqs(spu);
798 spu_destroy_spu(spu);
799 }
800 mutex_unlock(&spu_full_list_mutex);
801}
802
803static struct syscore_ops spu_syscore_ops = {
804 .shutdown = spu_shutdown,
805};
806
800static int __init init_spu_base(void) 807static int __init init_spu_base(void)
801{ 808{
802 int i, ret = 0; 809 int i, ret = 0;
@@ -830,6 +837,7 @@ static int __init init_spu_base(void)
830 crash_register_spus(&spu_full_list); 837 crash_register_spus(&spu_full_list);
831 mutex_unlock(&spu_full_list_mutex); 838 mutex_unlock(&spu_full_list_mutex);
832 spu_add_sysdev_attr(&attr_stat); 839 spu_add_sysdev_attr(&attr_stat);
840 register_syscore_ops(&spu_syscore_ops);
833 841
834 spu_init_affinity(); 842 spu_init_affinity();
835 843
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 360260d1352d..9089b0421191 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -21,7 +21,7 @@
21#include <linux/signal.h> 21#include <linux/signal.h>
22#include <linux/pci.h> 22#include <linux/pci.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/sysdev.h> 24#include <linux/syscore_ops.h>
25#include <linux/adb.h> 25#include <linux/adb.h>
26#include <linux/pmu.h> 26#include <linux/pmu.h>
27#include <linux/module.h> 27#include <linux/module.h>
@@ -674,7 +674,7 @@ not_found:
674 return viaint; 674 return viaint;
675} 675}
676 676
677static int pmacpic_suspend(struct sys_device *sysdev, pm_message_t state) 677static int pmacpic_suspend(void)
678{ 678{
679 int viaint = pmacpic_find_viaint(); 679 int viaint = pmacpic_find_viaint();
680 680
@@ -695,7 +695,7 @@ static int pmacpic_suspend(struct sys_device *sysdev, pm_message_t state)
695 return 0; 695 return 0;
696} 696}
697 697
698static int pmacpic_resume(struct sys_device *sysdev) 698static void pmacpic_resume(void)
699{ 699{
700 int i; 700 int i;
701 701
@@ -706,39 +706,19 @@ static int pmacpic_resume(struct sys_device *sysdev)
706 for (i = 0; i < max_real_irqs; ++i) 706 for (i = 0; i < max_real_irqs; ++i)
707 if (test_bit(i, sleep_save_mask)) 707 if (test_bit(i, sleep_save_mask))
708 pmac_unmask_irq(irq_get_irq_data(i)); 708 pmac_unmask_irq(irq_get_irq_data(i));
709
710 return 0;
711} 709}
712 710
713#endif /* CONFIG_PM && CONFIG_PPC32 */ 711static struct syscore_ops pmacpic_syscore_ops = {
714 712 .suspend = pmacpic_suspend,
715static struct sysdev_class pmacpic_sysclass = { 713 .resume = pmacpic_resume,
716 .name = "pmac_pic",
717}; 714};
718 715
719static struct sys_device device_pmacpic = { 716static int __init init_pmacpic_syscore(void)
720 .id = 0,
721 .cls = &pmacpic_sysclass,
722};
723
724static struct sysdev_driver driver_pmacpic = {
725#if defined(CONFIG_PM) && defined(CONFIG_PPC32)
726 .suspend = &pmacpic_suspend,
727 .resume = &pmacpic_resume,
728#endif /* CONFIG_PM && CONFIG_PPC32 */
729};
730
731static int __init init_pmacpic_sysfs(void)
732{ 717{
733#ifdef CONFIG_PPC32 718 register_syscore_ops(&pmacpic_syscore_ops);
734 if (max_irqs == 0)
735 return -ENODEV;
736#endif
737 printk(KERN_DEBUG "Registering pmac pic with sysfs...\n");
738 sysdev_class_register(&pmacpic_sysclass);
739 sysdev_register(&device_pmacpic);
740 sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic);
741 return 0; 719 return 0;
742} 720}
743machine_subsys_initcall(powermac, init_pmacpic_sysfs);
744 721
722machine_subsys_initcall(powermac, init_pmacpic_syscore);
723
724#endif /* CONFIG_PM && CONFIG_PPC32 */