linux/arch/mips/txx9/generic
Geert Uytterhoeven c5eac1f532
MIPS: TXx9: Fix boot crash in free_initmem()
On rbtx4927:

    BUG: Bad page state in process swapper  pfn:00001
    page:804b7820 refcount:0 mapcount:-128 mapping:00000000 index:0x1
    flags: 0x0()
    raw: 00000000 00000100 00000200 00000000 00000001 00000000 ffffff7f 00000000
    page dumped because: nonzero mapcount
    Modules linked in:
    CPU: 0 PID: 1 Comm: swapper Not tainted 5.2.0-rc1-rbtx4927-00468-g3c05ea3d4077b756 #141
    Stack : 00000000 10008400 8040dc4c 87c1b974 8044af63 8040dc4c 00000001 804a3490
            00000001 81000000 0030f231 80148558 00000003 10008400 87c1dd80 3d0f9a2c
            00000000 00000000 804b0000 00000000 00000007 00000000 00000081 00000000
            62722d31 00000080 804b0000 39347874 00000000 804b7820 8040ce18 81000010
            00000001 00000007 00000001 81000000 00000018 8021de24 00000000 804a0000
            ...
    Call Trace:
    [<8010adec>] show_stack+0x74/0x104
    [<801a5e44>] bad_page+0x130/0x138
    [<801a654c>] free_pcppages_bulk+0x17c/0x3b0
    [<801a789c>] free_unref_page+0x40/0x68
    [<801120f4>] free_init_pages+0xec/0x104
    [<803bdde8>] free_initmem+0x10/0x58
    [<803bdb8c>] kernel_init+0x20/0x100
    [<801057c8>] ret_from_kernel_thread+0x14/0x1c

As of commit b93ddc4f91 ("mips: Reserve memory for the kernel
image resources"), bootmem_init() no longer reserves the memory below
the kernel, while prom_free_prom_memory() still frees it.

Fix this by reverting commit b6263ff2d6 ("MIPS: TXx9: Implement
prom_free_prom_memory").

Suggested-by: Serge Semin <fancer.lancer@gmail.com>
Fixes: b93ddc4f91 ("mips: Reserve memory for the kernel image resources")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: Maciej W . Rozycki <macro@linux-mips.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
2019-05-22 18:46:32 -07:00
..
7segled.c MIPS: TXx9: 7segled: use permission-specific DEVICE_ATTR variants 2017-01-03 16:34:32 +01:00
irq_tx3927.c
irq_tx4927.c
irq_tx4938.c
irq_tx4939.c
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mem_tx4927.c
pci.c MIPS: PCI: Move map_irq() hooks out of initdata 2017-09-19 14:55:26 -05:00
setup_tx3927.c MIPS: TXx9: Modernize printing of kernel messages 2017-01-03 16:34:32 +01:00
setup_tx4927.c MIPS: TXx9: Modernize printing of kernel messages 2017-01-03 16:34:32 +01:00
setup_tx4938.c MIPS: txx9: Move the ndfc.h header to include/linux/platform_data/txx9 2018-07-18 10:10:23 +02:00
setup_tx4939.c MIPS: txx9: Move the ndfc.h header to include/linux/platform_data/txx9 2018-07-18 10:10:23 +02:00
setup.c MIPS: TXx9: Fix boot crash in free_initmem() 2019-05-22 18:46:32 -07:00
smsc_fdc37m81x.c MIPS: TXx9: Modernize printing of kernel messages 2017-01-03 16:34:32 +01:00
spi_eeprom.c spi: Drop owner assignment from spi_drivers 2015-10-28 10:30:17 +09:00