1
0
Fork 0
alistair23-linux/drivers/clk/ti
Mike Rapoport 7e1c4e2792 memblock: stop using implicit alignment to SMP_CACHE_BYTES
When a memblock allocation APIs are called with align = 0, the alignment
is implicitly set to SMP_CACHE_BYTES.

Implicit alignment is done deep in the memblock allocator and it can
come as a surprise.  Not that such an alignment would be wrong even
when used incorrectly but it is better to be explicit for the sake of
clarity and the prinicple of the least surprise.

Replace all such uses of memblock APIs with the 'align' parameter
explicitly set to SMP_CACHE_BYTES and stop implicit alignment assignment
in the memblock internal allocation functions.

For the case when memblock APIs are used via helper functions, e.g.  like
iommu_arena_new_node() in Alpha, the helper functions were detected with
Coccinelle's help and then manually examined and updated where
appropriate.

The direct memblock APIs users were updated using the semantic patch below:

@@
expression size, min_addr, max_addr, nid;
@@
(
|
- memblock_alloc_try_nid_raw(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_raw(size, SMP_CACHE_BYTES, min_addr, max_addr,
nid)
|
- memblock_alloc_try_nid_nopanic(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid_nopanic(size, SMP_CACHE_BYTES, min_addr, max_addr,
nid)
|
- memblock_alloc_try_nid(size, 0, min_addr, max_addr, nid)
+ memblock_alloc_try_nid(size, SMP_CACHE_BYTES, min_addr, max_addr, nid)
|
- memblock_alloc(size, 0)
+ memblock_alloc(size, SMP_CACHE_BYTES)
|
- memblock_alloc_raw(size, 0)
+ memblock_alloc_raw(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from(size, 0, min_addr)
+ memblock_alloc_from(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_nopanic(size, 0)
+ memblock_alloc_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low(size, 0)
+ memblock_alloc_low(size, SMP_CACHE_BYTES)
|
- memblock_alloc_low_nopanic(size, 0)
+ memblock_alloc_low_nopanic(size, SMP_CACHE_BYTES)
|
- memblock_alloc_from_nopanic(size, 0, min_addr)
+ memblock_alloc_from_nopanic(size, SMP_CACHE_BYTES, min_addr)
|
- memblock_alloc_node(size, 0, nid)
+ memblock_alloc_node(size, SMP_CACHE_BYTES, nid)
)

[mhocko@suse.com: changelog update]
[akpm@linux-foundation.org: coding-style fixes]
[rppt@linux.ibm.com: fix missed uses of implicit alignment]
  Link: http://lkml.kernel.org/r/20181016133656.GA10925@rapoport-lnx
Link: http://lkml.kernel.org/r/1538687224-17535-1-git-send-email-rppt@linux.vnet.ibm.com
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Suggested-by: Michal Hocko <mhocko@suse.com>
Acked-by: Paul Burton <paul.burton@mips.com>	[MIPS]
Acked-by: Michael Ellerman <mpe@ellerman.id.au>	[powerpc]
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Richard Weinberger <richard@nod.at>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-10-31 08:54:16 -07:00
..
Kconfig clk: ti: Add support for dm814x ADPLL 2016-03-01 16:21:25 -08:00
Makefile clk: ti: Drop legacy clk-3xxx-legacy code 2017-12-14 08:32:06 -08:00
adpll.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
apll.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
autoidle.c clk: ti: convert to use proper register definition for all accesses 2017-03-08 13:06:15 +02:00
clk-2xxx.c Merge branch 'cleanup-clk-h-includes' into clk-next 2015-07-28 11:59:09 -07:00
clk-3xxx.c clk: ti: omap3: cleanup unnecessary clock aliases 2017-12-01 15:17:17 +02:00
clk-7xx.c clk: ti: dra7: Add clkctrl clock data for the mcan clocks 2018-07-09 22:30:48 -07:00
clk-33xx.c clk: ti: am33xx: add set-rate-parent support for display clkctrl clock 2018-03-08 12:14:43 +02:00
clk-43xx.c clk: ti: am43xx: add set-rate-parent support for display clkctrl clock 2018-03-08 12:14:44 +02:00
clk-44xx.c clk: ti: omap4: clkctrl data fixes for opt-clocks 2017-12-01 15:18:08 +02:00
clk-54xx.c clk: ti: omap5: add clkctrl clock data 2017-12-01 15:17:18 +02:00
clk-814x.c clk: ti: dm814: add clkctrl clock data 2017-12-01 15:18:01 +02:00
clk-816x.c clk: ti: dm816: add clkctrl clock data 2017-12-01 15:18:06 +02:00
clk-dra7-atl.c clk: ti: dra7-atl-clock: fix child-node lookups 2017-11-14 15:53:31 -08:00
clk.c memblock: stop using implicit alignment to SMP_CACHE_BYTES 2018-10-31 08:54:16 -07:00
clkctrl.c clk: ti: clkctrl: add support for CLK_SET_RATE_PARENT flag 2018-03-08 12:14:43 +02:00
clkt_dflt.c clk: ti: convert to use proper register definition for all accesses 2017-03-08 13:06:15 +02:00
clkt_dpll.c clk: ti: convert to use proper register definition for all accesses 2017-03-08 13:06:15 +02:00
clkt_iclk.c clk: ti: convert to use proper register definition for all accesses 2017-03-08 13:06:15 +02:00
clock.h Merge branches 'clk-davinci', 'clk-si544', 'clk-rockchip', 'clk-uniphier' and 'clk-ti-flag-fix' into clk-next 2018-04-06 13:22:06 -07:00
clockdomain.c clk: Convert to using %pOF instead of full_name 2017-07-21 15:49:54 -07:00
composite.c clk: ti: Drop legacy clk-3xxx-legacy code 2017-12-14 08:32:06 -08:00
divider.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
dpll.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
dpll3xxx.c clk: ti: convert to use proper register definition for all accesses 2017-03-08 13:06:15 +02:00
dpll44xx.c clk: ti: convert to use proper register definition for all accesses 2017-03-08 13:06:15 +02:00
fapll.c clk: ti: make clk_ops const 2017-08-23 15:53:25 -07:00
fixed-factor.c clk: ti: use automatic clock alias generation framework 2017-03-08 12:58:18 +02:00
gate.c clk: ti: Drop legacy clk-3xxx-legacy code 2017-12-14 08:32:06 -08:00
interface.c clk: ti: Drop legacy clk-3xxx-legacy code 2017-12-14 08:32:06 -08:00
mux.c clk: ti: add support for clock latching to mux clocks 2018-03-08 11:42:05 +02:00