diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-11 19:54:05 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-11 19:54:05 -0800 |
commit | b4a237598aa740562f842db76d97465c44fb74c1 (patch) | |
tree | cadb4228d51a984360b4b3fdd7534731e2211f11 | |
parent | c970872e59e46774d508777291b2f90910ab695b (diff) | |
parent | b1d06b60e90cd5016798b9984f8e420e753f4846 (diff) | |
download | linux-b4a237598aa740562f842db76d97465c44fb74c1.tar.bz2 |
Merge tag 'devicetree-fixes-for-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
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
-rw-r--r-- | Documentation/devicetree/bindings/sound/ak4554.txt (renamed from Documentation/devicetree/bindings/sound/ak4554.c) | 0 | ||||
-rw-r--r-- | drivers/of/of_reserved_mem.c | 11 | ||||
-rw-r--r-- | include/linux/of.h | 4 | ||||
-rw-r--r-- | include/linux/of_address.h | 7 |
4 files changed, 16 insertions, 6 deletions
diff --git a/Documentation/devicetree/bindings/sound/ak4554.c b/Documentation/devicetree/bindings/sound/ak4554.txt index 934fa02754b3..934fa02754b3 100644 --- a/Documentation/devicetree/bindings/sound/ak4554.c +++ b/Documentation/devicetree/bindings/sound/ak4554.txt diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 62f467b8ccae..be77e75c587d 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -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); } } } diff --git a/include/linux/of.h b/include/linux/of.h index 2194b8ca41f9..dd10626a615f 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -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>"; diff --git a/include/linux/of_address.h b/include/linux/of_address.h index d88e81be6368..507daad0bc8d 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h @@ -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, |