Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Catalin Marinas:
"These are mostly arm64 fixes with an additional arm(64) platform fix
for the initialisation of vexpress clocks (the latter only affecting
arm64; the arch/arm64 code is SoC agnostic and does not rely on early
SoC-specific calls)

- vexpress platform clocks initialisation moved earlier following the
arm64 move of of_clk_init() call in a previous commit
- Default DMA ops changed to non-coherent to preserve compatibility
with 32-bit ARM DT files. The "dma-coherent" property can be used
to explicitly mark a device coherent. The Applied Micro DT file
has been updated to avoid DMA cache maintenance for the X-Gene SATA
controller (the only arm64 related driver with such assumption in
-rc mainline)
- Fixmap correction for earlyprintk
- kern_addr_valid() fix for huge pages"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
vexpress: Initialise the sysregs before setting up the clocks
arm64: Mark the Applied Micro X-Gene SATA controller as DMA coherent
arm64: Use bus notifiers to set per-device coherent DMA ops
arm64: Make default dma_ops to be noncoherent
arm64: fixmap: fix missing sub-page offset for earlyprintk
arm64: Fix for the arm64 kern_addr_valid() function

Changed files
+50 -7
Documentation
devicetree
bindings
arch
drivers
clk
versatile
include
asm-generic
+3
Documentation/devicetree/bindings/ata/apm-xgene.txt
··· 24 24 * "sata-phy" for the SATA 6.0Gbps PHY 25 25 26 26 Optional properties: 27 + - dma-coherent : Present if dma operations are coherent 27 28 - status : Shall be "ok" if enabled or "disabled" if disabled. 28 29 Default is "ok". 29 30 ··· 56 55 <0x0 0x1f22e000 0x0 0x1000>, 57 56 <0x0 0x1f227000 0x0 0x1000>; 58 57 interrupts = <0x0 0x87 0x4>; 58 + dma-coherent; 59 59 status = "ok"; 60 60 clocks = <&sataclk 0>; 61 61 phys = <&phy2 0>; ··· 71 69 <0x0 0x1f23e000 0x0 0x1000>, 72 70 <0x0 0x1f237000 0x0 0x1000>; 73 71 interrupts = <0x0 0x88 0x4>; 72 + dma-coherent; 74 73 status = "ok"; 75 74 clocks = <&sataclk 0>; 76 75 phys = <&phy3 0>;
+3
arch/arm64/boot/dts/apm-storm.dtsi
··· 307 307 <0x0 0x1f21e000 0x0 0x1000>, 308 308 <0x0 0x1f217000 0x0 0x1000>; 309 309 interrupts = <0x0 0x86 0x4>; 310 + dma-coherent; 310 311 status = "disabled"; 311 312 clocks = <&sata01clk 0>; 312 313 phys = <&phy1 0>; ··· 322 321 <0x0 0x1f22e000 0x0 0x1000>, 323 322 <0x0 0x1f227000 0x0 0x1000>; 324 323 interrupts = <0x0 0x87 0x4>; 324 + dma-coherent; 325 325 status = "ok"; 326 326 clocks = <&sata23clk 0>; 327 327 phys = <&phy2 0>; ··· 336 334 <0x0 0x1f23d000 0x0 0x1000>, 337 335 <0x0 0x1f23e000 0x0 0x1000>; 338 336 interrupts = <0x0 0x88 0x4>; 337 + dma-coherent; 339 338 status = "ok"; 340 339 clocks = <&sata45clk 0>; 341 340 phys = <&phy3 0>;
+2 -4
arch/arm64/kernel/early_printk.c
··· 143 143 } 144 144 /* no options parsing yet */ 145 145 146 - if (paddr) { 147 - set_fixmap_io(FIX_EARLYCON_MEM_BASE, paddr); 148 - early_base = (void __iomem *)fix_to_virt(FIX_EARLYCON_MEM_BASE); 149 - } 146 + if (paddr) 147 + early_base = (void __iomem *)set_fixmap_offset_io(FIX_EARLYCON_MEM_BASE, paddr); 150 148 151 149 printch = match->printch; 152 150 early_console = &early_console_dev;
+1 -1
arch/arm64/kernel/setup.c
··· 396 396 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 397 397 return 0; 398 398 } 399 - arch_initcall(arm64_device_init); 399 + arch_initcall_sync(arm64_device_init); 400 400 401 401 static DEFINE_PER_CPU(struct cpu, cpu_data); 402 402
+33 -2
arch/arm64/mm/dma-mapping.c
··· 22 22 #include <linux/slab.h> 23 23 #include <linux/dma-mapping.h> 24 24 #include <linux/dma-contiguous.h> 25 + #include <linux/of.h> 26 + #include <linux/platform_device.h> 25 27 #include <linux/vmalloc.h> 26 28 #include <linux/swiotlb.h> 29 + #include <linux/amba/bus.h> 27 30 28 31 #include <asm/cacheflush.h> 29 32 ··· 308 305 }; 309 306 EXPORT_SYMBOL(coherent_swiotlb_dma_ops); 310 307 308 + static int dma_bus_notifier(struct notifier_block *nb, 309 + unsigned long event, void *_dev) 310 + { 311 + struct device *dev = _dev; 312 + 313 + if (event != BUS_NOTIFY_ADD_DEVICE) 314 + return NOTIFY_DONE; 315 + 316 + if (of_property_read_bool(dev->of_node, "dma-coherent")) 317 + set_dma_ops(dev, &coherent_swiotlb_dma_ops); 318 + 319 + return NOTIFY_OK; 320 + } 321 + 322 + static struct notifier_block platform_bus_nb = { 323 + .notifier_call = dma_bus_notifier, 324 + }; 325 + 326 + static struct notifier_block amba_bus_nb = { 327 + .notifier_call = dma_bus_notifier, 328 + }; 329 + 311 330 extern int swiotlb_late_init_with_default_size(size_t default_size); 312 331 313 332 static int __init swiotlb_late_init(void) 314 333 { 315 334 size_t swiotlb_size = min(SZ_64M, MAX_ORDER_NR_PAGES << PAGE_SHIFT); 316 335 317 - dma_ops = &coherent_swiotlb_dma_ops; 336 + /* 337 + * These must be registered before of_platform_populate(). 338 + */ 339 + bus_register_notifier(&platform_bus_type, &platform_bus_nb); 340 + bus_register_notifier(&amba_bustype, &amba_bus_nb); 341 + 342 + dma_ops = &noncoherent_swiotlb_dma_ops; 318 343 319 344 return swiotlb_late_init_with_default_size(swiotlb_size); 320 345 } 321 - subsys_initcall(swiotlb_late_init); 346 + arch_initcall(swiotlb_late_init); 322 347 323 348 #define PREALLOC_DMA_DEBUG_ENTRIES 4096 324 349
+3
arch/arm64/mm/mmu.c
··· 374 374 if (pmd_none(*pmd)) 375 375 return 0; 376 376 377 + if (pmd_sect(*pmd)) 378 + return pfn_valid(pmd_pfn(*pmd)); 379 + 377 380 pte = pte_offset_kernel(pmd, addr); 378 381 if (pte_none(*pte)) 379 382 return 0;
+2
drivers/clk/versatile/clk-vexpress-osc.c
··· 100 100 struct clk *clk; 101 101 u32 range[2]; 102 102 103 + vexpress_sysreg_of_early_init(); 104 + 103 105 osc = kzalloc(sizeof(*osc), GFP_KERNEL); 104 106 if (!osc) 105 107 return;
+3
include/asm-generic/fixmap.h
··· 93 93 #define set_fixmap_io(idx, phys) \ 94 94 __set_fixmap(idx, phys, FIXMAP_PAGE_IO) 95 95 96 + #define set_fixmap_offset_io(idx, phys) \ 97 + __set_fixmap_offset(idx, phys, FIXMAP_PAGE_IO) 98 + 96 99 #endif /* __ASSEMBLY__ */ 97 100 #endif /* __ASM_GENERIC_FIXMAP_H */