Merge tag 'devicetree-fixes-for-4.4' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 Nov 2015 03:54:05 +0000 (19:54 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 Nov 2015 03:54:05 +0000 (19:54 -0800)
Pull DeviceTree fixes from Rob Herring:

 - Add empty of_translate_address needed for HiSilicon network driver.

 - Fix alignment requirements for CMA regions in DT.

 - Fix booting on PPC systems which can't do WARN() early.

 - Rename ak4554 binding doc from .c to .txt.

* tag 'devicetree-fixes-for-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  of: Provide static inline function for of_translate_address if needed
  drivers: of: of_reserved_mem: fixup the alignment with CMA setup
  of: Print rather than WARN'ing when overlap check fails
  dt-bindings: ak4554: extension should be .txt

Documentation/devicetree/bindings/sound/ak4554.c [deleted file]
Documentation/devicetree/bindings/sound/ak4554.txt [new file with mode: 0644]
drivers/of/of_reserved_mem.c
include/linux/of.h
include/linux/of_address.h

diff --git a/Documentation/devicetree/bindings/sound/ak4554.c b/Documentation/devicetree/bindings/sound/ak4554.c
deleted file mode 100644 (file)
index 934fa02..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-AK4554 ADC/DAC
-
-Required properties:
-
-  - compatible : "asahi-kasei,ak4554"
-
-Example:
-
-ak4554-adc-dac {
-       compatible = "asahi-kasei,ak4554";
-};
diff --git a/Documentation/devicetree/bindings/sound/ak4554.txt b/Documentation/devicetree/bindings/sound/ak4554.txt
new file mode 100644 (file)
index 0000000..934fa02
--- /dev/null
@@ -0,0 +1,11 @@
+AK4554 ADC/DAC
+
+Required properties:
+
+  - compatible : "asahi-kasei,ak4554"
+
+Example:
+
+ak4554-adc-dac {
+       compatible = "asahi-kasei,ak4554";
+};
index 62f467b8ccae940a931a2a08ce530a9a14f46a1f..be77e75c587db95c55a51e556f228f97810e051c 100644 (file)
@@ -124,6 +124,10 @@ static int __init __reserved_mem_alloc_size(unsigned long node,
                align = dt_mem_next_cell(dt_root_addr_cells, &prop);
        }
 
+       /* Need adjust the alignment to satisfy the CMA requirement */
+       if (IS_ENABLED(CONFIG_CMA) && of_flat_dt_is_compatible(node, "shared-dma-pool"))
+               align = max(align, (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order));
+
        prop = of_get_flat_dt_prop(node, "alloc-ranges", &len);
        if (prop) {
 
@@ -226,10 +230,9 @@ static void __init __rmem_check_for_overlap(void)
 
                        this_end = this->base + this->size;
                        next_end = next->base + next->size;
-                       WARN(1,
-                            "Reserved memory: OVERLAP DETECTED!\n%s (%pa--%pa) overlaps with %s (%pa--%pa)\n",
-                            this->name, &this->base, &this_end,
-                            next->name, &next->base, &next_end);
+                       pr_err("Reserved memory: OVERLAP DETECTED!\n%s (%pa--%pa) overlaps with %s (%pa--%pa)\n",
+                              this->name, &this->base, &this_end,
+                              next->name, &next->base, &next_end);
                }
        }
 }
index 2194b8ca41f92fe4edb7bb32ecd4bc4507f1ddf0..dd10626a615fb160587ecf09f860de36ba583c19 100644 (file)
@@ -126,6 +126,8 @@ extern raw_spinlock_t devtree_lock;
 #define OF_POPULATED   3 /* device already created for the node */
 #define OF_POPULATED_BUS       4 /* of_platform_populate recursed to children of this node */
 
+#define OF_BAD_ADDR    ((u64)-1)
+
 #ifdef CONFIG_OF
 void of_core_init(void);
 
@@ -229,8 +231,6 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)
 #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
 #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
 
-#define OF_BAD_ADDR    ((u64)-1)
-
 static inline const char *of_node_full_name(const struct device_node *np)
 {
        return np ? np->full_name : "<no-node>";
index d88e81be6368d2e2a07e34a8c0d28bbf9366a878..507daad0bc8d5d7e49dde6f5ef8ca353f56e02f0 100644 (file)
@@ -57,6 +57,13 @@ extern int of_dma_get_range(struct device_node *np, u64 *dma_addr,
                                u64 *paddr, u64 *size);
 extern bool of_dma_is_coherent(struct device_node *np);
 #else /* CONFIG_OF_ADDRESS */
+
+static inline u64 of_translate_address(struct device_node *np,
+                                      const __be32 *addr)
+{
+       return OF_BAD_ADDR;
+}
+
 static inline struct device_node *of_find_matching_node_by_address(
                                        struct device_node *from,
                                        const struct of_device_id *matches,