Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a9f5ecd authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents e3fb7d4c e715eb2e
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@ Required properties:
  * "sata-phy" for the SATA 6.0Gbps PHY
  * "sata-phy" for the SATA 6.0Gbps PHY


Optional properties:
Optional properties:
- dma-coherent		: Present if dma operations are coherent
- status		: Shall be "ok" if enabled or "disabled" if disabled.
- status		: Shall be "ok" if enabled or "disabled" if disabled.
			  Default is "ok".
			  Default is "ok".


@@ -55,6 +56,7 @@ Example:
			      <0x0 0x1f22e000 0x0 0x1000>,
			      <0x0 0x1f22e000 0x0 0x1000>,
			      <0x0 0x1f227000 0x0 0x1000>;
			      <0x0 0x1f227000 0x0 0x1000>;
			interrupts = <0x0 0x87 0x4>;
			interrupts = <0x0 0x87 0x4>;
			dma-coherent;
			status = "ok";
			status = "ok";
			clocks = <&sataclk 0>;
			clocks = <&sataclk 0>;
			phys = <&phy2 0>;
			phys = <&phy2 0>;
@@ -69,6 +71,7 @@ Example:
			      <0x0 0x1f23e000 0x0 0x1000>,
			      <0x0 0x1f23e000 0x0 0x1000>,
			      <0x0 0x1f237000 0x0 0x1000>;
			      <0x0 0x1f237000 0x0 0x1000>;
			interrupts = <0x0 0x88 0x4>;
			interrupts = <0x0 0x88 0x4>;
			dma-coherent;
			status = "ok";
			status = "ok";
			clocks = <&sataclk 0>;
			clocks = <&sataclk 0>;
			phys = <&phy3 0>;
			phys = <&phy3 0>;
+3 −0
Original line number Original line Diff line number Diff line
@@ -307,6 +307,7 @@
			      <0x0 0x1f21e000 0x0 0x1000>,
			      <0x0 0x1f21e000 0x0 0x1000>,
			      <0x0 0x1f217000 0x0 0x1000>;
			      <0x0 0x1f217000 0x0 0x1000>;
			interrupts = <0x0 0x86 0x4>;
			interrupts = <0x0 0x86 0x4>;
			dma-coherent;
			status = "disabled";
			status = "disabled";
			clocks = <&sata01clk 0>;
			clocks = <&sata01clk 0>;
			phys = <&phy1 0>;
			phys = <&phy1 0>;
@@ -321,6 +322,7 @@
			      <0x0 0x1f22e000 0x0 0x1000>,
			      <0x0 0x1f22e000 0x0 0x1000>,
			      <0x0 0x1f227000 0x0 0x1000>;
			      <0x0 0x1f227000 0x0 0x1000>;
			interrupts = <0x0 0x87 0x4>;
			interrupts = <0x0 0x87 0x4>;
			dma-coherent;
			status = "ok";
			status = "ok";
			clocks = <&sata23clk 0>;
			clocks = <&sata23clk 0>;
			phys = <&phy2 0>;
			phys = <&phy2 0>;
@@ -334,6 +336,7 @@
			      <0x0 0x1f23d000 0x0 0x1000>,
			      <0x0 0x1f23d000 0x0 0x1000>,
			      <0x0 0x1f23e000 0x0 0x1000>;
			      <0x0 0x1f23e000 0x0 0x1000>;
			interrupts = <0x0 0x88 0x4>;
			interrupts = <0x0 0x88 0x4>;
			dma-coherent;
			status = "ok";
			status = "ok";
			clocks = <&sata45clk 0>;
			clocks = <&sata45clk 0>;
			phys = <&phy3 0>;
			phys = <&phy3 0>;
+2 −4
Original line number Original line Diff line number Diff line
@@ -143,10 +143,8 @@ static int __init setup_early_printk(char *buf)
	}
	}
	/* no options parsing yet */
	/* no options parsing yet */


	if (paddr) {
	if (paddr)
		set_fixmap_io(FIX_EARLYCON_MEM_BASE, paddr);
		early_base = (void __iomem *)set_fixmap_offset_io(FIX_EARLYCON_MEM_BASE, paddr);
		early_base = (void __iomem *)fix_to_virt(FIX_EARLYCON_MEM_BASE);
	}


	printch = match->printch;
	printch = match->printch;
	early_console = &early_console_dev;
	early_console = &early_console_dev;
+1 −1
Original line number Original line Diff line number Diff line
@@ -396,7 +396,7 @@ static int __init arm64_device_init(void)
	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
	return 0;
	return 0;
}
}
arch_initcall(arm64_device_init);
arch_initcall_sync(arm64_device_init);


static DEFINE_PER_CPU(struct cpu, cpu_data);
static DEFINE_PER_CPU(struct cpu, cpu_data);


+33 −2
Original line number Original line Diff line number Diff line
@@ -22,8 +22,11 @@
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/dma-mapping.h>
#include <linux/dma-mapping.h>
#include <linux/dma-contiguous.h>
#include <linux/dma-contiguous.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/vmalloc.h>
#include <linux/vmalloc.h>
#include <linux/swiotlb.h>
#include <linux/swiotlb.h>
#include <linux/amba/bus.h>


#include <asm/cacheflush.h>
#include <asm/cacheflush.h>


@@ -305,17 +308,45 @@ struct dma_map_ops coherent_swiotlb_dma_ops = {
};
};
EXPORT_SYMBOL(coherent_swiotlb_dma_ops);
EXPORT_SYMBOL(coherent_swiotlb_dma_ops);


static int dma_bus_notifier(struct notifier_block *nb,
			    unsigned long event, void *_dev)
{
	struct device *dev = _dev;

	if (event != BUS_NOTIFY_ADD_DEVICE)
		return NOTIFY_DONE;

	if (of_property_read_bool(dev->of_node, "dma-coherent"))
		set_dma_ops(dev, &coherent_swiotlb_dma_ops);

	return NOTIFY_OK;
}

static struct notifier_block platform_bus_nb = {
	.notifier_call = dma_bus_notifier,
};

static struct notifier_block amba_bus_nb = {
	.notifier_call = dma_bus_notifier,
};

extern int swiotlb_late_init_with_default_size(size_t default_size);
extern int swiotlb_late_init_with_default_size(size_t default_size);


static int __init swiotlb_late_init(void)
static int __init swiotlb_late_init(void)
{
{
	size_t swiotlb_size = min(SZ_64M, MAX_ORDER_NR_PAGES << PAGE_SHIFT);
	size_t swiotlb_size = min(SZ_64M, MAX_ORDER_NR_PAGES << PAGE_SHIFT);


	dma_ops = &coherent_swiotlb_dma_ops;
	/*
	 * These must be registered before of_platform_populate().
	 */
	bus_register_notifier(&platform_bus_type, &platform_bus_nb);
	bus_register_notifier(&amba_bustype, &amba_bus_nb);

	dma_ops = &noncoherent_swiotlb_dma_ops;


	return swiotlb_late_init_with_default_size(swiotlb_size);
	return swiotlb_late_init_with_default_size(swiotlb_size);
}
}
subsys_initcall(swiotlb_late_init);
arch_initcall(swiotlb_late_init);


#define PREALLOC_DMA_DEBUG_ENTRIES	4096
#define PREALLOC_DMA_DEBUG_ENTRIES	4096


Loading