aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-06-30 01:23:59 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-06-30 01:23:59 -0400
commit6da49a292534d31ca391928ea97f8225774dc1e0 (patch)
tree060c5f5f40dceb10d4528763bc7fc1ccc88210d9 /arch/powerpc
parent17bdc6c0e979ae61879806e4dd93ec3b169d0931 (diff)
parentca56a95eedcc95f8fea7b49c87565cd961d74fe2 (diff)
Merge remote branch 'origin/master' into next
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/boot/.gitignore1
-rw-r--r--arch/powerpc/boot/dtc-src/.gitignore3
-rw-r--r--arch/powerpc/boot/dts/p1022ds.dts9
-rw-r--r--arch/powerpc/configs/52xx/pcm030_defconfig2
-rw-r--r--arch/powerpc/configs/ps3_defconfig2
-rw-r--r--arch/powerpc/configs/pseries_defconfig1
-rw-r--r--arch/powerpc/include/asm/mmzone.h7
-rw-r--r--arch/powerpc/include/asm/rio.h2
-rw-r--r--arch/powerpc/kernel/cputable.c2
-rw-r--r--arch/powerpc/kernel/prom.c27
-rw-r--r--arch/powerpc/kernel/rtas-rtc.c29
-rw-r--r--arch/powerpc/kernel/signal_32.c57
-rw-r--r--arch/powerpc/kernel/signal_64.c17
-rw-r--r--arch/powerpc/kernel/traps.c24
-rw-r--r--arch/powerpc/mm/fault.c10
-rw-r--r--arch/powerpc/mm/init_32.c15
-rw-r--r--arch/powerpc/mm/init_64.c14
-rw-r--r--arch/powerpc/mm/mem.c19
-rw-r--r--arch/powerpc/sysdev/fsl_lbc.c6
-rw-r--r--arch/powerpc/sysdev/fsl_rio.c35
-rw-r--r--arch/powerpc/sysdev/mpic.c11
21 files changed, 152 insertions, 141 deletions
diff --git a/arch/powerpc/boot/.gitignore b/arch/powerpc/boot/.gitignore
index 3d80c3e9cf6..12da77ec022 100644
--- a/arch/powerpc/boot/.gitignore
+++ b/arch/powerpc/boot/.gitignore
@@ -1,5 +1,4 @@
1addnote 1addnote
2dtc
3empty.c 2empty.c
4hack-coff 3hack-coff
5infblock.c 4infblock.c
diff --git a/arch/powerpc/boot/dtc-src/.gitignore b/arch/powerpc/boot/dtc-src/.gitignore
deleted file mode 100644
index a7c3f94e5e7..00000000000
--- a/arch/powerpc/boot/dtc-src/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
1dtc-lexer.lex.c
2dtc-parser.tab.c
3dtc-parser.tab.h
diff --git a/arch/powerpc/boot/dts/p1022ds.dts b/arch/powerpc/boot/dts/p1022ds.dts
index 4f685a779f4..98d9426d4b8 100644
--- a/arch/powerpc/boot/dts/p1022ds.dts
+++ b/arch/powerpc/boot/dts/p1022ds.dts
@@ -209,8 +209,10 @@
209 wm8776:codec@1a { 209 wm8776:codec@1a {
210 compatible = "wlf,wm8776"; 210 compatible = "wlf,wm8776";
211 reg = <0x1a>; 211 reg = <0x1a>;
212 /* MCLK source is a stand-alone oscillator */ 212 /*
213 clock-frequency = <12288000>; 213 * clock-frequency will be set by U-Boot if
214 * the clock is enabled.
215 */
214 }; 216 };
215 }; 217 };
216 218
@@ -280,7 +282,8 @@
280 codec-handle = <&wm8776>; 282 codec-handle = <&wm8776>;
281 fsl,playback-dma = <&dma00>; 283 fsl,playback-dma = <&dma00>;
282 fsl,capture-dma = <&dma01>; 284 fsl,capture-dma = <&dma01>;
283 fsl,fifo-depth = <16>; 285 fsl,fifo-depth = <15>;
286 fsl,ssi-asynchronous;
284 }; 287 };
285 288
286 dma@c300 { 289 dma@c300 {
diff --git a/arch/powerpc/configs/52xx/pcm030_defconfig b/arch/powerpc/configs/52xx/pcm030_defconfig
index 7f7e4a87860..22e719575c6 100644
--- a/arch/powerpc/configs/52xx/pcm030_defconfig
+++ b/arch/powerpc/configs/52xx/pcm030_defconfig
@@ -85,7 +85,7 @@ CONFIG_USB_OHCI_HCD=m
85CONFIG_USB_OHCI_HCD_PPC_OF_BE=y 85CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
86# CONFIG_USB_OHCI_HCD_PCI is not set 86# CONFIG_USB_OHCI_HCD_PCI is not set
87CONFIG_USB_STORAGE=m 87CONFIG_USB_STORAGE=m
88CONFIG_RTC_CLASS=m 88CONFIG_RTC_CLASS=y
89CONFIG_RTC_DRV_PCF8563=m 89CONFIG_RTC_DRV_PCF8563=m
90CONFIG_EXT2_FS=m 90CONFIG_EXT2_FS=m
91CONFIG_EXT3_FS=m 91CONFIG_EXT3_FS=m
diff --git a/arch/powerpc/configs/ps3_defconfig b/arch/powerpc/configs/ps3_defconfig
index 6472322bf13..185c292b0f1 100644
--- a/arch/powerpc/configs/ps3_defconfig
+++ b/arch/powerpc/configs/ps3_defconfig
@@ -141,7 +141,7 @@ CONFIG_USB_EHCI_TT_NEWSCHED=y
141# CONFIG_USB_EHCI_HCD_PPC_OF is not set 141# CONFIG_USB_EHCI_HCD_PPC_OF is not set
142CONFIG_USB_OHCI_HCD=m 142CONFIG_USB_OHCI_HCD=m
143CONFIG_USB_STORAGE=m 143CONFIG_USB_STORAGE=m
144CONFIG_RTC_CLASS=m 144CONFIG_RTC_CLASS=y
145CONFIG_RTC_DRV_PS3=m 145CONFIG_RTC_DRV_PS3=m
146CONFIG_EXT2_FS=m 146CONFIG_EXT2_FS=m
147CONFIG_EXT3_FS=m 147CONFIG_EXT3_FS=m
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
index c9f212b5f3d..80bc5de7ee1 100644
--- a/arch/powerpc/configs/pseries_defconfig
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -148,7 +148,6 @@ CONFIG_SCSI_SAS_ATTRS=m
148CONFIG_SCSI_CXGB3_ISCSI=m 148CONFIG_SCSI_CXGB3_ISCSI=m
149CONFIG_SCSI_CXGB4_ISCSI=m 149CONFIG_SCSI_CXGB4_ISCSI=m
150CONFIG_SCSI_BNX2_ISCSI=m 150CONFIG_SCSI_BNX2_ISCSI=m
151CONFIG_SCSI_BNX2_ISCSI=m
152CONFIG_BE2ISCSI=m 151CONFIG_BE2ISCSI=m
153CONFIG_SCSI_IBMVSCSI=y 152CONFIG_SCSI_IBMVSCSI=y
154CONFIG_SCSI_IBMVFC=m 153CONFIG_SCSI_IBMVFC=m
diff --git a/arch/powerpc/include/asm/mmzone.h b/arch/powerpc/include/asm/mmzone.h
index fd3fd58bad8..7b589178be4 100644
--- a/arch/powerpc/include/asm/mmzone.h
+++ b/arch/powerpc/include/asm/mmzone.h
@@ -38,13 +38,6 @@ u64 memory_hotplug_max(void);
38#define memory_hotplug_max() memblock_end_of_DRAM() 38#define memory_hotplug_max() memblock_end_of_DRAM()
39#endif 39#endif
40 40
41/*
42 * Following are macros that each numa implmentation must define.
43 */
44
45#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
46#define node_end_pfn(nid) (NODE_DATA(nid)->node_end_pfn)
47
48#else 41#else
49#define memory_hotplug_max() memblock_end_of_DRAM() 42#define memory_hotplug_max() memblock_end_of_DRAM()
50#endif /* CONFIG_NEED_MULTIPLE_NODES */ 43#endif /* CONFIG_NEED_MULTIPLE_NODES */
diff --git a/arch/powerpc/include/asm/rio.h b/arch/powerpc/include/asm/rio.h
index d902abd3399..b1d2deceeed 100644
--- a/arch/powerpc/include/asm/rio.h
+++ b/arch/powerpc/include/asm/rio.h
@@ -14,7 +14,7 @@
14#define ASM_PPC_RIO_H 14#define ASM_PPC_RIO_H
15 15
16extern void platform_rio_init(void); 16extern void platform_rio_init(void);
17#ifdef CONFIG_RAPIDIO 17#ifdef CONFIG_FSL_RIO
18extern int fsl_rio_mcheck_exception(struct pt_regs *); 18extern int fsl_rio_mcheck_exception(struct pt_regs *);
19#else 19#else
20static inline int fsl_rio_mcheck_exception(struct pt_regs *regs) {return 0; } 20static inline int fsl_rio_mcheck_exception(struct pt_regs *regs) {return 0; }
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 34d2722b945..9fb933248ab 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1979,7 +1979,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
1979 .pvr_value = 0x80240000, 1979 .pvr_value = 0x80240000,
1980 .cpu_name = "e5500", 1980 .cpu_name = "e5500",
1981 .cpu_features = CPU_FTRS_E5500, 1981 .cpu_features = CPU_FTRS_E5500,
1982 .cpu_user_features = COMMON_USER_BOOKE, 1982 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1983 .mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS | 1983 .mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS |
1984 MMU_FTR_USE_TLBILX, 1984 MMU_FTR_USE_TLBILX,
1985 .icache_bsize = 64, 1985 .icache_bsize = 64,
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index b8e6189298f..174e1e96175 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -83,11 +83,29 @@ static int __init early_parse_mem(char *p)
83} 83}
84early_param("mem", early_parse_mem); 84early_param("mem", early_parse_mem);
85 85
86/*
87 * overlaps_initrd - check for overlap with page aligned extension of
88 * initrd.
89 */
90static inline int overlaps_initrd(unsigned long start, unsigned long size)
91{
92#ifdef CONFIG_BLK_DEV_INITRD
93 if (!initrd_start)
94 return 0;
95
96 return (start + size) > _ALIGN_DOWN(initrd_start, PAGE_SIZE) &&
97 start <= _ALIGN_UP(initrd_end, PAGE_SIZE);
98#else
99 return 0;
100#endif
101}
102
86/** 103/**
87 * move_device_tree - move tree to an unused area, if needed. 104 * move_device_tree - move tree to an unused area, if needed.
88 * 105 *
89 * The device tree may be allocated beyond our memory limit, or inside the 106 * The device tree may be allocated beyond our memory limit, or inside the
90 * crash kernel region for kdump. If so, move it out of the way. 107 * crash kernel region for kdump, or within the page aligned range of initrd.
108 * If so, move it out of the way.
91 */ 109 */
92static void __init move_device_tree(void) 110static void __init move_device_tree(void)
93{ 111{
@@ -100,7 +118,8 @@ static void __init move_device_tree(void)
100 size = be32_to_cpu(initial_boot_params->totalsize); 118 size = be32_to_cpu(initial_boot_params->totalsize);
101 119
102 if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) || 120 if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
103 overlaps_crashkernel(start, size)) { 121 overlaps_crashkernel(start, size) ||
122 overlaps_initrd(start, size)) {
104 p = __va(memblock_alloc(size, PAGE_SIZE)); 123 p = __va(memblock_alloc(size, PAGE_SIZE));
105 memcpy(p, initial_boot_params, size); 124 memcpy(p, initial_boot_params, size);
106 initial_boot_params = (struct boot_param_header *)p; 125 initial_boot_params = (struct boot_param_header *)p;
@@ -556,7 +575,9 @@ static void __init early_reserve_mem(void)
556#ifdef CONFIG_BLK_DEV_INITRD 575#ifdef CONFIG_BLK_DEV_INITRD
557 /* then reserve the initrd, if any */ 576 /* then reserve the initrd, if any */
558 if (initrd_start && (initrd_end > initrd_start)) 577 if (initrd_start && (initrd_end > initrd_start))
559 memblock_reserve(__pa(initrd_start), initrd_end - initrd_start); 578 memblock_reserve(_ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE),
579 _ALIGN_UP(initrd_end, PAGE_SIZE) -
580 _ALIGN_DOWN(initrd_start, PAGE_SIZE));
560#endif /* CONFIG_BLK_DEV_INITRD */ 581#endif /* CONFIG_BLK_DEV_INITRD */
561 582
562#ifdef CONFIG_PPC32 583#ifdef CONFIG_PPC32
diff --git a/arch/powerpc/kernel/rtas-rtc.c b/arch/powerpc/kernel/rtas-rtc.c
index 77578c093dd..c57c19358a2 100644
--- a/arch/powerpc/kernel/rtas-rtc.c
+++ b/arch/powerpc/kernel/rtas-rtc.c
@@ -4,6 +4,7 @@
4#include <linux/init.h> 4#include <linux/init.h>
5#include <linux/rtc.h> 5#include <linux/rtc.h>
6#include <linux/delay.h> 6#include <linux/delay.h>
7#include <linux/ratelimit.h>
7#include <asm/prom.h> 8#include <asm/prom.h>
8#include <asm/rtas.h> 9#include <asm/rtas.h>
9#include <asm/time.h> 10#include <asm/time.h>
@@ -29,9 +30,10 @@ unsigned long __init rtas_get_boot_time(void)
29 } 30 }
30 } while (wait_time && (get_tb() < max_wait_tb)); 31 } while (wait_time && (get_tb() < max_wait_tb));
31 32
32 if (error != 0 && printk_ratelimit()) { 33 if (error != 0) {
33 printk(KERN_WARNING "error: reading the clock failed (%d)\n", 34 printk_ratelimited(KERN_WARNING
34 error); 35 "error: reading the clock failed (%d)\n",
36 error);
35 return 0; 37 return 0;
36 } 38 }
37 39
@@ -55,19 +57,21 @@ void rtas_get_rtc_time(struct rtc_time *rtc_tm)
55 57
56 wait_time = rtas_busy_delay_time(error); 58 wait_time = rtas_busy_delay_time(error);
57 if (wait_time) { 59 if (wait_time) {
58 if (in_interrupt() && printk_ratelimit()) { 60 if (in_interrupt()) {
59 memset(rtc_tm, 0, sizeof(struct rtc_time)); 61 memset(rtc_tm, 0, sizeof(struct rtc_time));
60 printk(KERN_WARNING "error: reading clock" 62 printk_ratelimited(KERN_WARNING
61 " would delay interrupt\n"); 63 "error: reading clock "
64 "would delay interrupt\n");
62 return; /* delay not allowed */ 65 return; /* delay not allowed */
63 } 66 }
64 msleep(wait_time); 67 msleep(wait_time);
65 } 68 }
66 } while (wait_time && (get_tb() < max_wait_tb)); 69 } while (wait_time && (get_tb() < max_wait_tb));
67 70
68 if (error != 0 && printk_ratelimit()) { 71 if (error != 0) {
69 printk(KERN_WARNING "error: reading the clock failed (%d)\n", 72 printk_ratelimited(KERN_WARNING
70 error); 73 "error: reading the clock failed (%d)\n",
74 error);
71 return; 75 return;
72 } 76 }
73 77
@@ -99,9 +103,10 @@ int rtas_set_rtc_time(struct rtc_time *tm)
99 } 103 }
100 } while (wait_time && (get_tb() < max_wait_tb)); 104 } while (wait_time && (get_tb() < max_wait_tb));
101 105
102 if (error != 0 && printk_ratelimit()) 106 if (error != 0)
103 printk(KERN_WARNING "error: setting the clock failed (%d)\n", 107 printk_ratelimited(KERN_WARNING
104 error); 108 "error: setting the clock failed (%d)\n",
109 error);
105 110
106 return 0; 111 return 0;
107} 112}
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index b96a3a010c2..78b76dc54df 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -25,6 +25,7 @@
25#include <linux/errno.h> 25#include <linux/errno.h>
26#include <linux/elf.h> 26#include <linux/elf.h>
27#include <linux/ptrace.h> 27#include <linux/ptrace.h>
28#include <linux/ratelimit.h>
28#ifdef CONFIG_PPC64 29#ifdef CONFIG_PPC64
29#include <linux/syscalls.h> 30#include <linux/syscalls.h>
30#include <linux/compat.h> 31#include <linux/compat.h>
@@ -892,11 +893,12 @@ badframe:
892 printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n", 893 printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n",
893 regs, frame, newsp); 894 regs, frame, newsp);
894#endif 895#endif
895 if (show_unhandled_signals && printk_ratelimit()) 896 if (show_unhandled_signals)
896 printk(KERN_INFO "%s[%d]: bad frame in handle_rt_signal32: " 897 printk_ratelimited(KERN_INFO
897 "%p nip %08lx lr %08lx\n", 898 "%s[%d]: bad frame in handle_rt_signal32: "
898 current->comm, current->pid, 899 "%p nip %08lx lr %08lx\n",
899 addr, regs->nip, regs->link); 900 current->comm, current->pid,
901 addr, regs->nip, regs->link);
900 902
901 force_sigsegv(sig, current); 903 force_sigsegv(sig, current);
902 return 0; 904 return 0;
@@ -1058,11 +1060,12 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
1058 return 0; 1060 return 0;
1059 1061
1060 bad: 1062 bad:
1061 if (show_unhandled_signals && printk_ratelimit()) 1063 if (show_unhandled_signals)
1062 printk(KERN_INFO "%s[%d]: bad frame in sys_rt_sigreturn: " 1064 printk_ratelimited(KERN_INFO
1063 "%p nip %08lx lr %08lx\n", 1065 "%s[%d]: bad frame in sys_rt_sigreturn: "
1064 current->comm, current->pid, 1066 "%p nip %08lx lr %08lx\n",
1065 rt_sf, regs->nip, regs->link); 1067 current->comm, current->pid,
1068 rt_sf, regs->nip, regs->link);
1066 1069
1067 force_sig(SIGSEGV, current); 1070 force_sig(SIGSEGV, current);
1068 return 0; 1071 return 0;
@@ -1149,12 +1152,12 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
1149 * We kill the task with a SIGSEGV in this situation. 1152 * We kill the task with a SIGSEGV in this situation.
1150 */ 1153 */
1151 if (do_setcontext(ctx, regs, 1)) { 1154 if (do_setcontext(ctx, regs, 1)) {
1152 if (show_unhandled_signals && printk_ratelimit()) 1155 if (show_unhandled_signals)
1153 printk(KERN_INFO "%s[%d]: bad frame in " 1156 printk_ratelimited(KERN_INFO "%s[%d]: bad frame in "
1154 "sys_debug_setcontext: %p nip %08lx " 1157 "sys_debug_setcontext: %p nip %08lx "
1155 "lr %08lx\n", 1158 "lr %08lx\n",
1156 current->comm, current->pid, 1159 current->comm, current->pid,
1157 ctx, regs->nip, regs->link); 1160 ctx, regs->nip, regs->link);
1158 1161
1159 force_sig(SIGSEGV, current); 1162 force_sig(SIGSEGV, current);
1160 goto out; 1163 goto out;
@@ -1236,11 +1239,12 @@ badframe:
1236 printk("badframe in handle_signal, regs=%p frame=%p newsp=%lx\n", 1239 printk("badframe in handle_signal, regs=%p frame=%p newsp=%lx\n",
1237 regs, frame, newsp); 1240 regs, frame, newsp);
1238#endif 1241#endif
1239 if (show_unhandled_signals && printk_ratelimit()) 1242 if (show_unhandled_signals)
1240 printk(KERN_INFO "%s[%d]: bad frame in handle_signal32: " 1243 printk_ratelimited(KERN_INFO
1241 "%p nip %08lx lr %08lx\n", 1244 "%s[%d]: bad frame in handle_signal32: "
1242 current->comm, current->pid, 1245 "%p nip %08lx lr %08lx\n",
1243 frame, regs->nip, regs->link); 1246 current->comm, current->pid,
1247 frame, regs->nip, regs->link);
1244 1248
1245 force_sigsegv(sig, current); 1249 force_sigsegv(sig, current);
1246 return 0; 1250 return 0;
@@ -1288,11 +1292,12 @@ long sys_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
1288 return 0; 1292 return 0;
1289 1293
1290badframe: 1294badframe:
1291 if (show_unhandled_signals && printk_ratelimit()) 1295 if (show_unhandled_signals)
1292 printk(KERN_INFO "%s[%d]: bad frame in sys_sigreturn: " 1296 printk_ratelimited(KERN_INFO
1293 "%p nip %08lx lr %08lx\n", 1297 "%s[%d]: bad frame in sys_sigreturn: "
1294 current->comm, current->pid, 1298 "%p nip %08lx lr %08lx\n",
1295 addr, regs->nip, regs->link); 1299 current->comm, current->pid,
1300 addr, regs->nip, regs->link);
1296 1301
1297 force_sig(SIGSEGV, current); 1302 force_sig(SIGSEGV, current);
1298 return 0; 1303 return 0;
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index da989fff19c..e91c736cc84 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -24,6 +24,7 @@
24#include <linux/elf.h> 24#include <linux/elf.h>
25#include <linux/ptrace.h> 25#include <linux/ptrace.h>
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/ratelimit.h>
27 28
28#include <asm/sigcontext.h> 29#include <asm/sigcontext.h>
29#include <asm/ucontext.h> 30#include <asm/ucontext.h>
@@ -380,10 +381,10 @@ badframe:
380 printk("badframe in sys_rt_sigreturn, regs=%p uc=%p &uc->uc_mcontext=%p\n", 381 printk("badframe in sys_rt_sigreturn, regs=%p uc=%p &uc->uc_mcontext=%p\n",
381 regs, uc, &uc->uc_mcontext); 382 regs, uc, &uc->uc_mcontext);
382#endif 383#endif
383 if (show_unhandled_signals && printk_ratelimit()) 384 if (show_unhandled_signals)
384 printk(regs->msr & MSR_64BIT ? fmt64 : fmt32, 385 printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
385 current->comm, current->pid, "rt_sigreturn", 386 current->comm, current->pid, "rt_sigreturn",
386 (long)uc, regs->nip, regs->link); 387 (long)uc, regs->nip, regs->link);
387 388
388 force_sig(SIGSEGV, current); 389 force_sig(SIGSEGV, current);
389 return 0; 390 return 0;
@@ -468,10 +469,10 @@ badframe:
468 printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n", 469 printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n",
469 regs, frame, newsp); 470 regs, frame, newsp);
470#endif 471#endif
471 if (show_unhandled_signals && printk_ratelimit()) 472 if (show_unhandled_signals)
472 printk(regs->msr & MSR_64BIT ? fmt64 : fmt32, 473 printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
473 current->comm, current->pid, "setup_rt_frame", 474 current->comm, current->pid, "setup_rt_frame",
474 (long)frame, regs->nip, regs->link); 475 (long)frame, regs->nip, regs->link);
475 476
476 force_sigsegv(signr, current); 477 force_sigsegv(signr, current);
477 return 0; 478 return 0;
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 0ff4ab98d50..1a0141426cd 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -34,6 +34,7 @@
34#include <linux/bug.h> 34#include <linux/bug.h>
35#include <linux/kdebug.h> 35#include <linux/kdebug.h>
36#include <linux/debugfs.h> 36#include <linux/debugfs.h>
37#include <linux/ratelimit.h>
37 38
38#include <asm/emulated_ops.h> 39#include <asm/emulated_ops.h>
39#include <asm/pgtable.h> 40#include <asm/pgtable.h>
@@ -197,12 +198,11 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
197 if (die("Exception in kernel mode", regs, signr)) 198 if (die("Exception in kernel mode", regs, signr))
198 return; 199 return;
199 } else if (show_unhandled_signals && 200 } else if (show_unhandled_signals &&
200 unhandled_signal(current, signr) && 201 unhandled_signal(current, signr)) {
201 printk_ratelimit()) { 202 printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
202 printk(regs->msr & MSR_64BIT ? fmt64 : fmt32, 203 current->comm, current->pid, signr,
203 current->comm, current->pid, signr, 204 addr, regs->nip, regs->link, code);
204 addr, regs->nip, regs->link, code); 205 }
205 }
206 206
207 memset(&info, 0, sizeof(info)); 207 memset(&info, 0, sizeof(info));
208 info.si_signo = signr; 208 info.si_signo = signr;
@@ -425,7 +425,7 @@ int machine_check_e500mc(struct pt_regs *regs)
425 unsigned long reason = mcsr; 425 unsigned long reason = mcsr;
426 int recoverable = 1; 426 int recoverable = 1;
427 427
428 if (reason & MCSR_BUS_RBERR) { 428 if (reason & MCSR_LD) {
429 recoverable = fsl_rio_mcheck_exception(regs); 429 recoverable = fsl_rio_mcheck_exception(regs);
430 if (recoverable == 1) 430 if (recoverable == 1)
431 goto silent_out; 431 goto silent_out;
@@ -1342,9 +1342,8 @@ void altivec_assist_exception(struct pt_regs *regs)
1342 } else { 1342 } else {
1343 /* didn't recognize the instruction */ 1343 /* didn't recognize the instruction */
1344 /* XXX quick hack for now: set the non-Java bit in the VSCR */ 1344 /* XXX quick hack for now: set the non-Java bit in the VSCR */
1345 if (printk_ratelimit()) 1345 printk_ratelimited(KERN_ERR "Unrecognized altivec instruction "
1346 printk(KERN_ERR "Unrecognized altivec instruction " 1346 "in %s at %lx\n", current->comm, regs->nip);
1347 "in %s at %lx\n", current->comm, regs->nip);
1348 current->thread.vscr.u[3] |= 0x10000; 1347 current->thread.vscr.u[3] |= 0x10000;
1349 } 1348 }
1350} 1349}
@@ -1548,9 +1547,8 @@ u32 ppc_warn_emulated;
1548 1547
1549void ppc_warn_emulated_print(const char *type) 1548void ppc_warn_emulated_print(const char *type)
1550{ 1549{
1551 if (printk_ratelimit()) 1550 pr_warn_ratelimited("%s used emulated %s instruction\n", current->comm,
1552 pr_warning("%s used emulated %s instruction\n", current->comm, 1551 type);
1553 type);
1554} 1552}
1555 1553
1556static int __init ppc_warn_emulated_init(void) 1554static int __init ppc_warn_emulated_init(void)
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 54f4fb994e9..ad35f66c69e 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -31,6 +31,7 @@
31#include <linux/kdebug.h> 31#include <linux/kdebug.h>
32#include <linux/perf_event.h> 32#include <linux/perf_event.h>
33#include <linux/magic.h> 33#include <linux/magic.h>
34#include <linux/ratelimit.h>
34 35
35#include <asm/firmware.h> 36#include <asm/firmware.h>
36#include <asm/page.h> 37#include <asm/page.h>
@@ -346,11 +347,10 @@ bad_area_nosemaphore:
346 return 0; 347 return 0;
347 } 348 }
348 349
349 if (is_exec && (error_code & DSISR_PROTFAULT) 350 if (is_exec && (error_code & DSISR_PROTFAULT))
350 && printk_ratelimit()) 351 printk_ratelimited(KERN_CRIT "kernel tried to execute NX-protected"
351 printk(KERN_CRIT "kernel tried to execute NX-protected" 352 " page (%lx) - exploit attempt? (uid: %d)\n",
352 " page (%lx) - exploit attempt? (uid: %d)\n", 353 address, current_uid());
353 address, current_uid());
354 354
355 return SIGSEGV; 355 return SIGSEGV;
356 356
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index d65b591e555..5de0f254dbb 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -223,21 +223,6 @@ void free_initmem(void)
223#undef FREESEC 223#undef FREESEC
224} 224}
225 225
226#ifdef CONFIG_BLK_DEV_INITRD
227void free_initrd_mem(unsigned long start, unsigned long end)
228{
229 if (start < end)
230 printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
231 for (; start < end; start += PAGE_SIZE) {
232 ClearPageReserved(virt_to_page(start));
233 init_page_count(virt_to_page(start));
234 free_page(start);
235 totalram_pages++;
236 }
237}
238#endif
239
240
241#ifdef CONFIG_8xx /* No 8xx specific .c file to put that in ... */ 226#ifdef CONFIG_8xx /* No 8xx specific .c file to put that in ... */
242void setup_initial_memory_limit(phys_addr_t first_memblock_base, 227void setup_initial_memory_limit(phys_addr_t first_memblock_base,
243 phys_addr_t first_memblock_size) 228 phys_addr_t first_memblock_size)
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index 6374b2196a1..f6dbb4c20e6 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -99,20 +99,6 @@ void free_initmem(void)
99 ((unsigned long)__init_end - (unsigned long)__init_begin) >> 10); 99 ((unsigned long)__init_end - (unsigned long)__init_begin) >> 10);
100} 100}
101 101
102#ifdef CONFIG_BLK_DEV_INITRD
103void free_initrd_mem(unsigned long start, unsigned long end)
104{
105 if (start < end)
106 printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
107 for (; start < end; start += PAGE_SIZE) {
108 ClearPageReserved(virt_to_page(start));
109 init_page_count(virt_to_page(start));
110 free_page(start);
111 totalram_pages++;
112 }
113}
114#endif
115
116static void pgd_ctor(void *addr) 102static void pgd_ctor(void *addr)
117{ 103{
118 memset(addr, 0, PGD_TABLE_SIZE); 104 memset(addr, 0, PGD_TABLE_SIZE);
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 097b288779e..89cbfef5a7d 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -383,6 +383,25 @@ void __init mem_init(void)
383 mem_init_done = 1; 383 mem_init_done = 1;
384} 384}
385 385
386#ifdef CONFIG_BLK_DEV_INITRD
387void __init free_initrd_mem(unsigned long start, unsigned long end)
388{
389 if (start >= end)
390 return;
391
392 start = _ALIGN_DOWN(start, PAGE_SIZE);
393 end = _ALIGN_UP(end, PAGE_SIZE);
394 pr_info("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
395
396 for (; start < end; start += PAGE_SIZE) {
397 ClearPageReserved(virt_to_page(start));
398 init_page_count(virt_to_page(start));
399 free_page(start);
400 totalram_pages++;
401 }
402}
403#endif
404
386/* 405/*
387 * This is called when a page has been modified by the kernel. 406 * This is called when a page has been modified by the kernel.
388 * It just marks the page as not i-cache clean. We do the i-cache 407 * It just marks the page as not i-cache clean. We do the i-cache
diff --git a/arch/powerpc/sysdev/fsl_lbc.c b/arch/powerpc/sysdev/fsl_lbc.c
index 0608b1657da..d917573cf1a 100644
--- a/arch/powerpc/sysdev/fsl_lbc.c
+++ b/arch/powerpc/sysdev/fsl_lbc.c
@@ -196,9 +196,6 @@ static int __devinit fsl_lbc_ctrl_init(struct fsl_lbc_ctrl *ctrl,
196 out_be32(&lbc->lteccr, LTECCR_CLEAR); 196 out_be32(&lbc->lteccr, LTECCR_CLEAR);
197 out_be32(&lbc->ltedr, LTEDR_ENABLE); 197 out_be32(&lbc->ltedr, LTEDR_ENABLE);
198 198
199 /* Enable interrupts for any detected events */
200 out_be32(&lbc->lteir, LTEIR_ENABLE);
201
202 /* Set the monitor timeout value to the maximum for erratum A001 */ 199 /* Set the monitor timeout value to the maximum for erratum A001 */
203 if (of_device_is_compatible(node, "fsl,elbc")) 200 if (of_device_is_compatible(node, "fsl,elbc"))
204 clrsetbits_be32(&lbc->lbcr, LBCR_BMT, LBCR_BMTPS); 201 clrsetbits_be32(&lbc->lbcr, LBCR_BMT, LBCR_BMTPS);
@@ -322,6 +319,9 @@ static int __devinit fsl_lbc_ctrl_probe(struct platform_device *dev)
322 goto err; 319 goto err;
323 } 320 }
324 321
322 /* Enable interrupts for any detected events */
323 out_be32(&fsl_lbc_ctrl_dev->regs->lteir, LTEIR_ENABLE);
324
325 return 0; 325 return 0;
326 326
327err: 327err:
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 5b206a2fe17..b3fd081d56f 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -283,23 +283,24 @@ static void __iomem *rio_regs_win;
283#ifdef CONFIG_E500 283#ifdef CONFIG_E500
284int fsl_rio_mcheck_exception(struct pt_regs *regs) 284int fsl_rio_mcheck_exception(struct pt_regs *regs)
285{ 285{
286 const struct exception_table_entry *entry = NULL; 286 const struct exception_table_entry *entry;
287 unsigned long reason = mfspr(SPRN_MCSR); 287 unsigned long reason;
288 288
289 if (reason & MCSR_BUS_RBERR) { 289 if (!rio_regs_win)
290 reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR)); 290 return 0;
291 if (reason & (RIO_LTLEDCSR_IER | RIO_LTLEDCSR_PRT)) { 291
292 /* Check if we are prepared to handle this fault */ 292 reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR));
293 entry = search_exception_tables(regs->nip); 293 if (reason & (RIO_LTLEDCSR_IER | RIO_LTLEDCSR_PRT)) {
294 if (entry) { 294 /* Check if we are prepared to handle this fault */
295 pr_debug("RIO: %s - MC Exception handled\n", 295 entry = search_exception_tables(regs->nip);
296 __func__); 296 if (entry) {
297 out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR), 297 pr_debug("RIO: %s - MC Exception handled\n",
298 0); 298 __func__);
299 regs->msr |= MSR_RI; 299 out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR),
300 regs->nip = entry->fixup; 300 0);
301 return 1; 301 regs->msr |= MSR_RI;
302 } 302 regs->nip = entry->fixup;
303 return 1;
303 } 304 }
304 } 305 }
305 306
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index d3bc7e595d0..d5d3ff3d757 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -29,6 +29,7 @@
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#include <linux/syscore_ops.h>
32#include <linux/ratelimit.h>
32 33
33#include <asm/ptrace.h> 34#include <asm/ptrace.h>
34#include <asm/signal.h> 35#include <asm/signal.h>
@@ -1612,9 +1613,8 @@ static unsigned int _mpic_get_one_irq(struct mpic *mpic, int reg)
1612 return NO_IRQ; 1613 return NO_IRQ;
1613 } 1614 }
1614 if (unlikely(mpic->protected && test_bit(src, mpic->protected))) { 1615 if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
1615 if (printk_ratelimit()) 1616 printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n",
1616 printk(KERN_WARNING "%s: Got protected source %d !\n", 1617 mpic->name, (int)src);
1617 mpic->name, (int)src);
1618 mpic_eoi(mpic); 1618 mpic_eoi(mpic);
1619 return NO_IRQ; 1619 return NO_IRQ;
1620 } 1620 }
@@ -1652,9 +1652,8 @@ unsigned int mpic_get_coreint_irq(void)
1652 return NO_IRQ; 1652 return NO_IRQ;
1653 } 1653 }
1654 if (unlikely(mpic->protected && test_bit(src, mpic->protected))) { 1654 if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
1655 if (printk_ratelimit()) 1655 printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n",
1656 printk(KERN_WARNING "%s: Got protected source %d !\n", 1656 mpic->name, (int)src);
1657 mpic->name, (int)src);
1658 return NO_IRQ; 1657 return NO_IRQ;
1659 } 1658 }
1660 1659