aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-11-25 20:55:04 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-11-25 20:55:04 -0500
commitc2a65d3d85a08b6c93da7b8664c89d1cd0682adf (patch)
tree0c207d8628b3c518ec0849208eb2023d297937b3 /arch
parent194d9831f0419b5125dc94ec0ece4434d8ef74f0 (diff)
parenta3cea9894157c20a5b1ec08b7e0b5f2019740c10 (diff)
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS fixes from Ralf Baechle: "Three issues fixed accross the field: - Some functions that were recently outlined as part of a preemption fix were causing problems with function tracing. - The recently merged in-kernel MPI library uses very outdated headers that contain MIPS-specific code which won't build on with gcc 4.4 or newer. - The MIPS non-NUMA memory initialization was making only a very half-baked attempt at merging adjacent memory ranges. This kept the code simple enough but is now causing issues with kexec." * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: MPI: Fix compilation on MIPS with GCC 4.4 and newer MIPS: Fix crash that occurs when function tracing is enabled MIPS: Merge overlapping bootmem ranges
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/kernel/setup.c26
-rw-r--r--arch/mips/lib/mips-atomic.c8
2 files changed, 24 insertions, 10 deletions
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index a53f8ec37aac..290dc6a1d7a3 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -79,7 +79,7 @@ static struct resource data_resource = { .name = "Kernel data", };
79void __init add_memory_region(phys_t start, phys_t size, long type) 79void __init add_memory_region(phys_t start, phys_t size, long type)
80{ 80{
81 int x = boot_mem_map.nr_map; 81 int x = boot_mem_map.nr_map;
82 struct boot_mem_map_entry *prev = boot_mem_map.map + x - 1; 82 int i;
83 83
84 /* Sanity check */ 84 /* Sanity check */
85 if (start + size < start) { 85 if (start + size < start) {
@@ -88,15 +88,29 @@ void __init add_memory_region(phys_t start, phys_t size, long type)
88 } 88 }
89 89
90 /* 90 /*
91 * Try to merge with previous entry if any. This is far less than 91 * Try to merge with existing entry, if any.
92 * perfect but is sufficient for most real world cases.
93 */ 92 */
94 if (x && prev->addr + prev->size == start && prev->type == type) { 93 for (i = 0; i < boot_mem_map.nr_map; i++) {
95 prev->size += size; 94 struct boot_mem_map_entry *entry = boot_mem_map.map + i;
95 unsigned long top;
96
97 if (entry->type != type)
98 continue;
99
100 if (start + size < entry->addr)
101 continue; /* no overlap */
102
103 if (entry->addr + entry->size < start)
104 continue; /* no overlap */
105
106 top = max(entry->addr + entry->size, start + size);
107 entry->addr = min(entry->addr, start);
108 entry->size = top - entry->addr;
109
96 return; 110 return;
97 } 111 }
98 112
99 if (x == BOOT_MEM_MAP_MAX) { 113 if (boot_mem_map.nr_map == BOOT_MEM_MAP_MAX) {
100 pr_err("Ooops! Too many entries in the memory map!\n"); 114 pr_err("Ooops! Too many entries in the memory map!\n");
101 return; 115 return;
102 } 116 }
diff --git a/arch/mips/lib/mips-atomic.c b/arch/mips/lib/mips-atomic.c
index e091430dbeb1..cd160be3ce4d 100644
--- a/arch/mips/lib/mips-atomic.c
+++ b/arch/mips/lib/mips-atomic.c
@@ -56,7 +56,7 @@ __asm__(
56 " .set pop \n" 56 " .set pop \n"
57 " .endm \n"); 57 " .endm \n");
58 58
59void arch_local_irq_disable(void) 59notrace void arch_local_irq_disable(void)
60{ 60{
61 preempt_disable(); 61 preempt_disable();
62 __asm__ __volatile__( 62 __asm__ __volatile__(
@@ -93,7 +93,7 @@ __asm__(
93 " .set pop \n" 93 " .set pop \n"
94 " .endm \n"); 94 " .endm \n");
95 95
96unsigned long arch_local_irq_save(void) 96notrace unsigned long arch_local_irq_save(void)
97{ 97{
98 unsigned long flags; 98 unsigned long flags;
99 preempt_disable(); 99 preempt_disable();
@@ -135,7 +135,7 @@ __asm__(
135 " .set pop \n" 135 " .set pop \n"
136 " .endm \n"); 136 " .endm \n");
137 137
138void arch_local_irq_restore(unsigned long flags) 138notrace void arch_local_irq_restore(unsigned long flags)
139{ 139{
140 unsigned long __tmp1; 140 unsigned long __tmp1;
141 141
@@ -159,7 +159,7 @@ void arch_local_irq_restore(unsigned long flags)
159EXPORT_SYMBOL(arch_local_irq_restore); 159EXPORT_SYMBOL(arch_local_irq_restore);
160 160
161 161
162void __arch_local_irq_restore(unsigned long flags) 162notrace void __arch_local_irq_restore(unsigned long flags)
163{ 163{
164 unsigned long __tmp1; 164 unsigned long __tmp1;
165 165