diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-05-20 01:36:52 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-05-20 01:36:52 -0400 |
commit | 880102e78547c1db158a17e36cf0cdd98e7ad710 (patch) | |
tree | 3fff9cc54c44dafe275cfabefb96c589e08d971d /arch/powerpc | |
parent | 3d07f0e83d4323d2cd45cc583f7cf1957aca3cac (diff) | |
parent | 39ab05c8e0b519ff0a04a869f065746e6e8c3d95 (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')
-rw-r--r-- | arch/powerpc/include/asm/mpic.h | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/smp.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/traps.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/interrupt.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spu_base.c | 28 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pic.c | 42 | ||||
-rw-r--r-- | arch/powerpc/sysdev/ipic.c | 36 | ||||
-rw-r--r-- | arch/powerpc/sysdev/mpic.c | 48 |
8 files changed, 67 insertions, 97 deletions
diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h index 664bee6622e7..df18989e78d4 100644 --- a/arch/powerpc/include/asm/mpic.h +++ b/arch/powerpc/include/asm/mpic.h | |||
@@ -3,7 +3,6 @@ | |||
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | 4 | ||
5 | #include <linux/irq.h> | 5 | #include <linux/irq.h> |
6 | #include <linux/sysdev.h> | ||
7 | #include <asm/dcr.h> | 6 | #include <asm/dcr.h> |
8 | #include <asm/msi_bitmap.h> | 7 | #include <asm/msi_bitmap.h> |
9 | 8 | ||
@@ -321,8 +320,6 @@ struct mpic | |||
321 | /* link */ | 320 | /* link */ |
322 | struct mpic *next; | 321 | struct mpic *next; |
323 | 322 | ||
324 | struct sys_device sysdev; | ||
325 | |||
326 | #ifdef CONFIG_PM | 323 | #ifdef CONFIG_PM |
327 | struct mpic_irq_save *save_data; | 324 | struct mpic_irq_save *save_data; |
328 | #endif | 325 | #endif |
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index dd1973fed304..4a6f2ec7e761 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
@@ -119,7 +119,7 @@ static irqreturn_t call_function_action(int irq, void *data) | |||
119 | 119 | ||
120 | static irqreturn_t reschedule_action(int irq, void *data) | 120 | static irqreturn_t reschedule_action(int irq, void *data) |
121 | { | 121 | { |
122 | /* we just need the return path side effect of checking need_resched */ | 122 | scheduler_ipi(); |
123 | return IRQ_HANDLED; | 123 | return IRQ_HANDLED; |
124 | } | 124 | } |
125 | 125 | ||
@@ -224,7 +224,7 @@ irqreturn_t smp_ipi_demux(void) | |||
224 | if (all & (1 << (24 - 8 * PPC_MSG_CALL_FUNCTION))) | 224 | if (all & (1 << (24 - 8 * PPC_MSG_CALL_FUNCTION))) |
225 | generic_smp_call_function_interrupt(); | 225 | generic_smp_call_function_interrupt(); |
226 | if (all & (1 << (24 - 8 * PPC_MSG_RESCHEDULE))) | 226 | if (all & (1 << (24 - 8 * PPC_MSG_RESCHEDULE))) |
227 | reschedule_action(0, NULL); /* upcoming sched hook */ | 227 | scheduler_ipi(); |
228 | if (all & (1 << (24 - 8 * PPC_MSG_CALL_FUNC_SINGLE))) | 228 | if (all & (1 << (24 - 8 * PPC_MSG_CALL_FUNC_SINGLE))) |
229 | generic_smp_call_function_single_interrupt(); | 229 | generic_smp_call_function_single_interrupt(); |
230 | if (all & (1 << (24 - 8 * PPC_MSG_DEBUGGER_BREAK))) | 230 | if (all & (1 << (24 - 8 * PPC_MSG_DEBUGGER_BREAK))) |
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 06b9d457d0a7..b13306b0d925 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -143,7 +143,6 @@ int die(const char *str, struct pt_regs *regs, long err) | |||
143 | #endif | 143 | #endif |
144 | printk("%s\n", ppc_md.name ? ppc_md.name : ""); | 144 | printk("%s\n", ppc_md.name ? ppc_md.name : ""); |
145 | 145 | ||
146 | sysfs_printk_last_file(); | ||
147 | if (notify_die(DIE_OOPS, str, regs, err, 255, | 146 | if (notify_die(DIE_OOPS, str, regs, err, 255, |
148 | SIGSEGV) == NOTIFY_STOP) | 147 | SIGSEGV) == NOTIFY_STOP) |
149 | return 1; | 148 | return 1; |
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 | } |
522 | EXPORT_SYMBOL_GPL(spu_init_channels); | 523 | EXPORT_SYMBOL_GPL(spu_init_channels); |
523 | 524 | ||
524 | static 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 | |||
533 | static struct sysdev_class spu_sysdev_class = { | 525 | static struct sysdev_class spu_sysdev_class = { |
534 | .name = "spu", | 526 | .name = "spu", |
535 | .shutdown = spu_shutdown, | ||
536 | }; | 527 | }; |
537 | 528 | ||
538 | int spu_add_sysdev_attr(struct sysdev_attribute *attr) | 529 | int 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 | ||
791 | static 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 | |||
803 | static struct syscore_ops spu_syscore_ops = { | ||
804 | .shutdown = spu_shutdown, | ||
805 | }; | ||
806 | |||
800 | static int __init init_spu_base(void) | 807 | static 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 | ||
677 | static int pmacpic_suspend(struct sys_device *sysdev, pm_message_t state) | 677 | static 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 | ||
698 | static int pmacpic_resume(struct sys_device *sysdev) | 698 | static 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 */ | 711 | static struct syscore_ops pmacpic_syscore_ops = { |
714 | 712 | .suspend = pmacpic_suspend, | |
715 | static struct sysdev_class pmacpic_sysclass = { | 713 | .resume = pmacpic_resume, |
716 | .name = "pmac_pic", | ||
717 | }; | 714 | }; |
718 | 715 | ||
719 | static struct sys_device device_pmacpic = { | 716 | static int __init init_pmacpic_syscore(void) |
720 | .id = 0, | ||
721 | .cls = &pmacpic_sysclass, | ||
722 | }; | ||
723 | |||
724 | static 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 | |||
731 | static 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 | } |
743 | machine_subsys_initcall(powermac, init_pmacpic_sysfs); | ||
744 | 721 | ||
722 | machine_subsys_initcall(powermac, init_pmacpic_syscore); | ||
723 | |||
724 | #endif /* CONFIG_PM && CONFIG_PPC32 */ | ||
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index f0ece79f9be5..7367d17364cb 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <linux/stddef.h> | 18 | #include <linux/stddef.h> |
19 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
20 | #include <linux/signal.h> | 20 | #include <linux/signal.h> |
21 | #include <linux/sysdev.h> | 21 | #include <linux/syscore_ops.h> |
22 | #include <linux/device.h> | 22 | #include <linux/device.h> |
23 | #include <linux/bootmem.h> | 23 | #include <linux/bootmem.h> |
24 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
@@ -900,7 +900,7 @@ static struct { | |||
900 | u32 sercr; | 900 | u32 sercr; |
901 | } ipic_saved_state; | 901 | } ipic_saved_state; |
902 | 902 | ||
903 | static int ipic_suspend(struct sys_device *sdev, pm_message_t state) | 903 | static int ipic_suspend(void) |
904 | { | 904 | { |
905 | struct ipic *ipic = primary_ipic; | 905 | struct ipic *ipic = primary_ipic; |
906 | 906 | ||
@@ -931,7 +931,7 @@ static int ipic_suspend(struct sys_device *sdev, pm_message_t state) | |||
931 | return 0; | 931 | return 0; |
932 | } | 932 | } |
933 | 933 | ||
934 | static int ipic_resume(struct sys_device *sdev) | 934 | static void ipic_resume(void) |
935 | { | 935 | { |
936 | struct ipic *ipic = primary_ipic; | 936 | struct ipic *ipic = primary_ipic; |
937 | 937 | ||
@@ -947,44 +947,26 @@ static int ipic_resume(struct sys_device *sdev) | |||
947 | ipic_write(ipic->regs, IPIC_SECNR, ipic_saved_state.secnr); | 947 | ipic_write(ipic->regs, IPIC_SECNR, ipic_saved_state.secnr); |
948 | ipic_write(ipic->regs, IPIC_SERMR, ipic_saved_state.sermr); | 948 | ipic_write(ipic->regs, IPIC_SERMR, ipic_saved_state.sermr); |
949 | ipic_write(ipic->regs, IPIC_SERCR, ipic_saved_state.sercr); | 949 | ipic_write(ipic->regs, IPIC_SERCR, ipic_saved_state.sercr); |
950 | |||
951 | return 0; | ||
952 | } | 950 | } |
953 | #else | 951 | #else |
954 | #define ipic_suspend NULL | 952 | #define ipic_suspend NULL |
955 | #define ipic_resume NULL | 953 | #define ipic_resume NULL |
956 | #endif | 954 | #endif |
957 | 955 | ||
958 | static struct sysdev_class ipic_sysclass = { | 956 | static struct syscore_ops ipic_syscore_ops = { |
959 | .name = "ipic", | ||
960 | .suspend = ipic_suspend, | 957 | .suspend = ipic_suspend, |
961 | .resume = ipic_resume, | 958 | .resume = ipic_resume, |
962 | }; | 959 | }; |
963 | 960 | ||
964 | static struct sys_device device_ipic = { | 961 | static int __init init_ipic_syscore(void) |
965 | .id = 0, | ||
966 | .cls = &ipic_sysclass, | ||
967 | }; | ||
968 | |||
969 | static int __init init_ipic_sysfs(void) | ||
970 | { | 962 | { |
971 | int rc; | ||
972 | |||
973 | if (!primary_ipic || !primary_ipic->regs) | 963 | if (!primary_ipic || !primary_ipic->regs) |
974 | return -ENODEV; | 964 | return -ENODEV; |
975 | printk(KERN_DEBUG "Registering ipic with sysfs...\n"); | ||
976 | 965 | ||
977 | rc = sysdev_class_register(&ipic_sysclass); | 966 | printk(KERN_DEBUG "Registering ipic system core operations\n"); |
978 | if (rc) { | 967 | register_syscore_ops(&ipic_syscore_ops); |
979 | printk(KERN_ERR "Failed registering ipic sys class\n"); | 968 | |
980 | return -ENODEV; | ||
981 | } | ||
982 | rc = sysdev_register(&device_ipic); | ||
983 | if (rc) { | ||
984 | printk(KERN_ERR "Failed registering ipic sys device\n"); | ||
985 | return -ENODEV; | ||
986 | } | ||
987 | return 0; | 969 | return 0; |
988 | } | 970 | } |
989 | 971 | ||
990 | subsys_initcall(init_ipic_sysfs); | 972 | subsys_initcall(init_ipic_syscore); |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 57e954142c70..3a8de5bb628a 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/spinlock.h> | 28 | #include <linux/spinlock.h> |
29 | #include <linux/pci.h> | 29 | #include <linux/pci.h> |
30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
31 | #include <linux/syscore_ops.h> | ||
31 | 32 | ||
32 | #include <asm/ptrace.h> | 33 | #include <asm/ptrace.h> |
33 | #include <asm/signal.h> | 34 | #include <asm/signal.h> |
@@ -1793,9 +1794,8 @@ void mpic_reset_core(int cpu) | |||
1793 | #endif /* CONFIG_SMP */ | 1794 | #endif /* CONFIG_SMP */ |
1794 | 1795 | ||
1795 | #ifdef CONFIG_PM | 1796 | #ifdef CONFIG_PM |
1796 | static int mpic_suspend(struct sys_device *dev, pm_message_t state) | 1797 | static void mpic_suspend_one(struct mpic *mpic) |
1797 | { | 1798 | { |
1798 | struct mpic *mpic = container_of(dev, struct mpic, sysdev); | ||
1799 | int i; | 1799 | int i; |
1800 | 1800 | ||
1801 | for (i = 0; i < mpic->num_sources; i++) { | 1801 | for (i = 0; i < mpic->num_sources; i++) { |
@@ -1804,13 +1804,22 @@ static int mpic_suspend(struct sys_device *dev, pm_message_t state) | |||
1804 | mpic->save_data[i].dest = | 1804 | mpic->save_data[i].dest = |
1805 | mpic_irq_read(i, MPIC_INFO(IRQ_DESTINATION)); | 1805 | mpic_irq_read(i, MPIC_INFO(IRQ_DESTINATION)); |
1806 | } | 1806 | } |
1807 | } | ||
1808 | |||
1809 | static int mpic_suspend(void) | ||
1810 | { | ||
1811 | struct mpic *mpic = mpics; | ||
1812 | |||
1813 | while (mpic) { | ||
1814 | mpic_suspend_one(mpic); | ||
1815 | mpic = mpic->next; | ||
1816 | } | ||
1807 | 1817 | ||
1808 | return 0; | 1818 | return 0; |
1809 | } | 1819 | } |
1810 | 1820 | ||
1811 | static int mpic_resume(struct sys_device *dev) | 1821 | static void mpic_resume_one(struct mpic *mpic) |
1812 | { | 1822 | { |
1813 | struct mpic *mpic = container_of(dev, struct mpic, sysdev); | ||
1814 | int i; | 1823 | int i; |
1815 | 1824 | ||
1816 | for (i = 0; i < mpic->num_sources; i++) { | 1825 | for (i = 0; i < mpic->num_sources; i++) { |
@@ -1837,33 +1846,28 @@ static int mpic_resume(struct sys_device *dev) | |||
1837 | } | 1846 | } |
1838 | #endif | 1847 | #endif |
1839 | } /* end for loop */ | 1848 | } /* end for loop */ |
1849 | } | ||
1840 | 1850 | ||
1841 | return 0; | 1851 | static void mpic_resume(void) |
1852 | { | ||
1853 | struct mpic *mpic = mpics; | ||
1854 | |||
1855 | while (mpic) { | ||
1856 | mpic_resume_one(mpic); | ||
1857 | mpic = mpic->next; | ||
1858 | } | ||
1842 | } | 1859 | } |
1843 | #endif | ||
1844 | 1860 | ||
1845 | static struct sysdev_class mpic_sysclass = { | 1861 | static struct syscore_ops mpic_syscore_ops = { |
1846 | #ifdef CONFIG_PM | ||
1847 | .resume = mpic_resume, | 1862 | .resume = mpic_resume, |
1848 | .suspend = mpic_suspend, | 1863 | .suspend = mpic_suspend, |
1849 | #endif | ||
1850 | .name = "mpic", | ||
1851 | }; | 1864 | }; |
1852 | 1865 | ||
1853 | static int mpic_init_sys(void) | 1866 | static int mpic_init_sys(void) |
1854 | { | 1867 | { |
1855 | struct mpic *mpic = mpics; | 1868 | register_syscore_ops(&mpic_syscore_ops); |
1856 | int error, id = 0; | 1869 | return 0; |
1857 | |||
1858 | error = sysdev_class_register(&mpic_sysclass); | ||
1859 | |||
1860 | while (mpic && !error) { | ||
1861 | mpic->sysdev.cls = &mpic_sysclass; | ||
1862 | mpic->sysdev.id = id++; | ||
1863 | error = sysdev_register(&mpic->sysdev); | ||
1864 | mpic = mpic->next; | ||
1865 | } | ||
1866 | return error; | ||
1867 | } | 1870 | } |
1868 | 1871 | ||
1869 | device_initcall(mpic_init_sys); | 1872 | device_initcall(mpic_init_sys); |
1873 | #endif | ||