forked from luck/tmp_suning_uos_patched
b1ce9716f3
Use 0 as the align parameter in memblock_find_in_range() is incorrect when we reserve memory for Crash kernel. The environment as follows: [ 0.000000] MIPS: machine is loongson,loongson64c-4core-rs780e ... [ 1.951016] crashkernel=64M@128M The warning as follows: [ 0.000000] Invalid memory region reserved for crash kernel And the iomem as follows: 00200000-0effffff : System RAM 04000000-0484009f : Kernel code 048400a0-04ad7fff : Kernel data 04b40000-05c4c6bf : Kernel bss 1a000000-1bffffff : pci@1a000000 ... The align parameter may be finally used by round_down() or round_up(). Like the following call tree: mips-next: mm/memblock.c memblock_find_in_range └── memblock_find_in_range_node ├── __memblock_find_range_bottom_up │ └── round_up └── __memblock_find_range_top_down └── round_down \#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) \#define round_down(x, y) ((x) & ~__round_mask(x, y)) \#define __round_mask(x, y) ((__typeof__(x))((y)-1)) The round_down(or round_up)'s second parameter must be a power of 2. If the second parameter is 0, it both will return 0. Use 1 as the parameter to fix the bug and the iomem as follows: 00200000-0effffff : System RAM 04000000-0484009f : Kernel code 048400a0-04ad7fff : Kernel data 04b40000-05c4c6bf : Kernel bss 08000000-0bffffff : Crash kernel 1a000000-1bffffff : pci@1a000000 ... Signed-off-by: Jinyang He <hejinyang@loongson.cn> Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> |
||
---|---|---|
.. | ||
syscalls | ||
.gitignore | ||
asm-offsets.c | ||
binfmt_elfn32.c | ||
binfmt_elfo32.c | ||
bmips_5xxx_init.S | ||
bmips_vec.S | ||
branch.c | ||
cacheinfo.c | ||
cevt-bcm1480.c | ||
cevt-ds1287.c | ||
cevt-gt641xx.c | ||
cevt-r4k.c | ||
cevt-sb1250.c | ||
cevt-txx9.c | ||
cmpxchg.c | ||
cps-vec-ns16550.S | ||
cps-vec.S | ||
cpu-probe.c | ||
crash_dump.c | ||
crash.c | ||
csrc-bcm1480.c | ||
csrc-ioasic.c | ||
csrc-r4k.c | ||
csrc-sb1250.c | ||
early_printk_8250.c | ||
early_printk.c | ||
elf.c | ||
entry.S | ||
ftrace.c | ||
genex.S | ||
gpio_txx9.c | ||
head.S | ||
i8253.c | ||
idle.c | ||
irq_txx9.c | ||
irq-gt641xx.c | ||
irq-msc01.c | ||
irq-rm7000.c | ||
irq.c | ||
jump_label.c | ||
kgdb.c | ||
kprobes.c | ||
linux32.c | ||
machine_kexec.c | ||
Makefile | ||
mcount.S | ||
mips_machine.c | ||
mips-cm.c | ||
mips-cpc.c | ||
mips-mt-fpaff.c | ||
mips-mt.c | ||
mips-r2-to-r6-emul.c | ||
module.c | ||
octeon_switch.S | ||
perf_event_mipsxx.c | ||
perf_event.c | ||
pm-cps.c | ||
pm.c | ||
probes-common.h | ||
proc.c | ||
process.c | ||
prom.c | ||
ptrace.c | ||
ptrace32.c | ||
r4k_fpu.S | ||
r4k_switch.S | ||
r4k-bugs64.c | ||
r2300_fpu.S | ||
r2300_switch.S | ||
relocate_kernel.S | ||
relocate.c | ||
reset.c | ||
rtlx-cmp.c | ||
rtlx-mt.c | ||
rtlx.c | ||
scall32-o32.S | ||
scall64-n32.S | ||
scall64-n64.S | ||
scall64-o32.S | ||
segment.c | ||
setup.c | ||
signal_n32.c | ||
signal_o32.c | ||
signal-common.h | ||
signal.c | ||
signal32.c | ||
smp-bmips.c | ||
smp-cmp.c | ||
smp-cps.c | ||
smp-mt.c | ||
smp-up.c | ||
smp.c | ||
spinlock_test.c | ||
spram.c | ||
stacktrace.c | ||
sync-r4k.c | ||
syscall.c | ||
sysrq.c | ||
time.c | ||
topology.c | ||
traps.c | ||
unaligned.c | ||
uprobes.c | ||
vdso.c | ||
vmlinux.lds.S | ||
vpe-cmp.c | ||
vpe-mt.c | ||
vpe.c | ||
watch.c |