Ira Weiny
01c4b788e0
arch/kmap: remove BUG_ON()
...
Patch series "Remove duplicated kmap code", v3.
The kmap infrastructure has been copied almost verbatim to every
architecture. This series consolidates obvious duplicated code by
defining core functions which call into the architectures only when
needed.
Some of the k[un]map_atomic() implementations have some similarities but
the similarities were not sufficient to warrant further changes.
In addition we remove a duplicate implementation of kmap() in DRM.
This patch (of 15):
Replace the use of BUG_ON(in_interrupt()) in the kmap() and kunmap() in
favor of might_sleep().
Besides the benefits of might_sleep(), this normalizes the implementations
such that they can be made generic in subsequent patches.
Signed-off-by: Ira Weiny <ira.weiny@intel.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Reviewed-by: Dan Williams <dan.j.williams@intel.com >
Reviewed-by: Christoph Hellwig <hch@lst.de >
Cc: Al Viro <viro@zeniv.linux.org.uk >
Cc: Christian König <christian.koenig@amd.com >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de >
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com >
Cc: Helge Deller <deller@gmx.de >
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: "David S. Miller" <davem@davemloft.net >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: "H. Peter Anvin" <hpa@zytor.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: Andy Lutomirski <luto@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Chris Zankel <chris@zankel.net >
Cc: Max Filippov <jcmvbkbc@gmail.com >
Link: http://lkml.kernel.org/r/20200507150004.1423069-1-ira.weiny@intel.com
Link: http://lkml.kernel.org/r/20200507150004.1423069-2-ira.weiny@intel.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-06-04 19:06:22 -07:00
Guo Ren
f136008f31
csky: Separate fixaddr_init from highmem
...
After fixaddr_init is separated from highmem, we could use tcm
without highmem selected. (610 (abiv1) don't support highmem,
but it could use tcm now.)
Signed-off-by: Guo Ren <guoren@linux.alibaba.com >
2020-02-21 15:43:24 +08:00
Mike Rapoport
8a7f97b902
treewide: add checks for the return value of memblock_alloc*()
...
Add check for the return value of memblock_alloc*() functions and call
panic() in case of error. The panic message repeats the one used by
panicing memblock allocators with adjustment of parameters to include
only relevant ones.
The replacement was mostly automated with semantic patches like the one
below with manual massaging of format strings.
@@
expression ptr, size, align;
@@
ptr = memblock_alloc(size, align);
+ if (!ptr)
+ panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__, size, align);
[anders.roxell@linaro.org: use '%pa' with 'phys_addr_t' type]
Link: http://lkml.kernel.org/r/20190131161046.21886-1-anders.roxell@linaro.org
[rppt@linux.ibm.com: fix format strings for panics after memblock_alloc]
Link: http://lkml.kernel.org/r/1548950940-15145-1-git-send-email-rppt@linux.ibm.com
[rppt@linux.ibm.com: don't panic if the allocation in sparse_buffer_init fails]
Link: http://lkml.kernel.org/r/20190131074018.GD28876@rapoport-lnx
[akpm@linux-foundation.org: fix xtensa printk warning]
Link: http://lkml.kernel.org/r/1548057848-15136-20-git-send-email-rppt@linux.ibm.com
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com >
Signed-off-by: Anders Roxell <anders.roxell@linaro.org >
Reviewed-by: Guo Ren <ren_guo@c-sky.com > [c-sky]
Acked-by: Paul Burton <paul.burton@mips.com > [MIPS]
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com > [s390]
Reviewed-by: Juergen Gross <jgross@suse.com > [Xen]
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org > [m68k]
Acked-by: Max Filippov <jcmvbkbc@gmail.com > [xtensa]
Cc: Catalin Marinas <catalin.marinas@arm.com >
Cc: Christophe Leroy <christophe.leroy@c-s.fr >
Cc: Christoph Hellwig <hch@lst.de >
Cc: "David S. Miller" <davem@davemloft.net >
Cc: Dennis Zhou <dennis@kernel.org >
Cc: Greentime Hu <green.hu@gmail.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Guan Xuetao <gxt@pku.edu.cn >
Cc: Guo Ren <guoren@kernel.org >
Cc: Mark Salter <msalter@redhat.com >
Cc: Matt Turner <mattst88@gmail.com >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Michal Simek <monstr@monstr.eu >
Cc: Petr Mladek <pmladek@suse.com >
Cc: Richard Weinberger <richard@nod.at >
Cc: Rich Felker <dalias@libc.org >
Cc: Rob Herring <robh+dt@kernel.org >
Cc: Rob Herring <robh@kernel.org >
Cc: Russell King <linux@armlinux.org.uk >
Cc: Stafford Horne <shorne@gmail.com >
Cc: Tony Luck <tony.luck@intel.com >
Cc: Vineet Gupta <vgupta@synopsys.com >
Cc: Yoshinori Sato <ysato@users.sourceforge.jp >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2019-03-12 10:04:02 -07:00
Mike Rapoport
aca52c3983
mm: remove CONFIG_HAVE_MEMBLOCK
...
All architecures use memblock for early memory management. There is no need
for the CONFIG_HAVE_MEMBLOCK configuration option.
[rppt@linux.vnet.ibm.com: of/fdt: fixup #ifdefs]
Link: http://lkml.kernel.org/r/20180919103457.GA20545@rapoport-lnx
[rppt@linux.vnet.ibm.com: csky: fixups after bootmem removal]
Link: http://lkml.kernel.org/r/20180926112744.GC4628@rapoport-lnx
[rppt@linux.vnet.ibm.com: remove stale #else and the code it protects]
Link: http://lkml.kernel.org/r/1538067825-24835-1-git-send-email-rppt@linux.vnet.ibm.com
Link: http://lkml.kernel.org/r/1536927045-23536-4-git-send-email-rppt@linux.vnet.ibm.com
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com >
Acked-by: Michal Hocko <mhocko@suse.com >
Tested-by: Jonathan Cameron <jonathan.cameron@huawei.com >
Cc: Catalin Marinas <catalin.marinas@arm.com >
Cc: Chris Zankel <chris@zankel.net >
Cc: "David S. Miller" <davem@davemloft.net >
Cc: Geert Uytterhoeven <geert@linux-m68k.org >
Cc: Greentime Hu <green.hu@gmail.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Guan Xuetao <gxt@pku.edu.cn >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org >
Cc: Jonas Bonn <jonas@southpole.se >
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: Ley Foon Tan <lftan@altera.com >
Cc: Mark Salter <msalter@redhat.com >
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com >
Cc: Matt Turner <mattst88@gmail.com >
Cc: Michael Ellerman <mpe@ellerman.id.au >
Cc: Michal Simek <monstr@monstr.eu >
Cc: Palmer Dabbelt <palmer@sifive.com >
Cc: Paul Burton <paul.burton@mips.com >
Cc: Richard Kuo <rkuo@codeaurora.org >
Cc: Richard Weinberger <richard@nod.at >
Cc: Rich Felker <dalias@libc.org >
Cc: Russell King <linux@armlinux.org.uk >
Cc: Serge Semin <fancer.lancer@gmail.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Tony Luck <tony.luck@intel.com >
Cc: Vineet Gupta <vgupta@synopsys.com >
Cc: Yoshinori Sato <ysato@users.sourceforge.jp >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2018-10-31 08:54:15 -07:00
Guo Ren
013de2d667
csky: MMU and page table management
...
This patch adds files related to memory management and here is our
memory-layout:
Fixmap : 0xffc02000 – 0xfffff000 (4 MB - 12KB)
Pkmap : 0xff800000 – 0xffc00000 (4 MB)
Vmalloc : 0xf0200000 – 0xff000000 (238 MB)
Lowmem : 0x80000000 – 0xc0000000 (1GB)
abiv1 CPU (CK610) is VIPT cache and it doesn't support highmem.
abiv2 CPUs are all PIPT cache and they could support highmem.
Lowmem is directly mapped by msa0 & msa1 reg, and we needn't setup
memory page table for it.
Link:https://lore.kernel.org/lkml/20180518215548.GH17671@n2100.armlinux.org.uk/
Signed-off-by: Guo Ren <ren_guo@c-sky.com >
Cc: Christoph Hellwig <hch@infradead.org >
Reviewed-by: Arnd Bergmann <arnd@arndb.de >
2018-10-25 23:36:19 +08:00