Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'devicetree-fixes-for-4.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull DT fixes from Rob Herring:
"I think this should be all for 4.4:

- Fix incorrect warning about overlapping memory regions

- Export of_irq_find_parent again which was made static in 4.4, but
has users pending for 4.5.

- Fix of_msi_map_rid declaration location

- Fix re-entrancy for of_fdt_unflatten_tree

- Clean-up of phys_addr_t printks"

* tag 'devicetree-fixes-for-4.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
of/irq: move of_msi_map_rid declaration to the correct ifdef section
of/irq: Export of_irq_find_parent again
of/fdt: Add mutex protection for calls to __unflatten_device_tree()
of/address: fix typo in comment block of of_translate_one()
of: do not use 0x in front of %pa
of: Fix comparison of reserved memory regions

+30 -12
+3 -2
drivers/of/address.c
··· 485 485 int rone; 486 486 u64 offset = OF_BAD_ADDR; 487 487 488 - /* Normally, an absence of a "ranges" property means we are 488 + /* 489 + * Normally, an absence of a "ranges" property means we are 489 490 * crossing a non-translatable boundary, and thus the addresses 490 - * below the current not cannot be converted to CPU physical ones. 491 + * below the current cannot be converted to CPU physical ones. 491 492 * Unfortunately, while this is very clear in the spec, it's not 492 493 * what Apple understood, and they do have things like /uni-n or 493 494 * /ht nodes with no "ranges" property and a lot of perfectly
+6 -1
drivers/of/fdt.c
··· 13 13 #include <linux/kernel.h> 14 14 #include <linux/initrd.h> 15 15 #include <linux/memblock.h> 16 + #include <linux/mutex.h> 16 17 #include <linux/of.h> 17 18 #include <linux/of_fdt.h> 18 19 #include <linux/of_reserved_mem.h> ··· 437 436 return kzalloc(size, GFP_KERNEL); 438 437 } 439 438 439 + static DEFINE_MUTEX(of_fdt_unflatten_mutex); 440 + 440 441 /** 441 442 * of_fdt_unflatten_tree - create tree of device_nodes from flat blob 442 443 * ··· 450 447 void of_fdt_unflatten_tree(const unsigned long *blob, 451 448 struct device_node **mynodes) 452 449 { 450 + mutex_lock(&of_fdt_unflatten_mutex); 453 451 __unflatten_device_tree(blob, mynodes, &kernel_tree_alloc); 452 + mutex_unlock(&of_fdt_unflatten_mutex); 454 453 } 455 454 EXPORT_SYMBOL_GPL(of_fdt_unflatten_tree); 456 455 ··· 1046 1041 int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base, 1047 1042 phys_addr_t size, bool nomap) 1048 1043 { 1049 - pr_err("Reserved memory not supported, ignoring range 0x%pa - 0x%pa%s\n", 1044 + pr_err("Reserved memory not supported, ignoring range %pa - %pa%s\n", 1050 1045 &base, &size, nomap ? " (nomap)" : ""); 1051 1046 return -ENOSYS; 1052 1047 }
+2 -1
drivers/of/irq.c
··· 53 53 * Returns a pointer to the interrupt parent node, or NULL if the interrupt 54 54 * parent could not be determined. 55 55 */ 56 - static struct device_node *of_irq_find_parent(struct device_node *child) 56 + struct device_node *of_irq_find_parent(struct device_node *child) 57 57 { 58 58 struct device_node *p; 59 59 const __be32 *parp; ··· 77 77 78 78 return p; 79 79 } 80 + EXPORT_SYMBOL_GPL(of_irq_find_parent); 80 81 81 82 /** 82 83 * of_irq_parse_raw - Low level interrupt tree parsing
+7 -1
drivers/of/of_reserved_mem.c
··· 206 206 { 207 207 const struct reserved_mem *ra = a, *rb = b; 208 208 209 - return ra->base - rb->base; 209 + if (ra->base < rb->base) 210 + return -1; 211 + 212 + if (ra->base > rb->base) 213 + return 1; 214 + 215 + return 0; 210 216 } 211 217 212 218 static void __init __rmem_check_for_overlap(void)
+12 -7
include/linux/of_irq.h
··· 46 46 extern int of_irq_get_byname(struct device_node *dev, const char *name); 47 47 extern int of_irq_to_resource_table(struct device_node *dev, 48 48 struct resource *res, int nr_irqs); 49 + extern struct device_node *of_irq_find_parent(struct device_node *child); 49 50 extern struct irq_domain *of_msi_get_domain(struct device *dev, 50 51 struct device_node *np, 51 52 enum irq_domain_bus_token token); 52 53 extern struct irq_domain *of_msi_map_get_device_domain(struct device *dev, 53 54 u32 rid); 54 55 extern void of_msi_configure(struct device *dev, struct device_node *np); 56 + u32 of_msi_map_rid(struct device *dev, struct device_node *msi_np, u32 rid_in); 55 57 #else 56 58 static inline int of_irq_count(struct device_node *dev) 57 59 { ··· 72 70 { 73 71 return 0; 74 72 } 73 + static inline void *of_irq_find_parent(struct device_node *child) 74 + { 75 + return NULL; 76 + } 77 + 75 78 static inline struct irq_domain *of_msi_get_domain(struct device *dev, 76 79 struct device_node *np, 77 80 enum irq_domain_bus_token token) ··· 91 84 static inline void of_msi_configure(struct device *dev, struct device_node *np) 92 85 { 93 86 } 87 + static inline u32 of_msi_map_rid(struct device *dev, 88 + struct device_node *msi_np, u32 rid_in) 89 + { 90 + return rid_in; 91 + } 94 92 #endif 95 93 96 94 #if defined(CONFIG_OF_IRQ) || defined(CONFIG_SPARC) ··· 105 93 * so declare it here regardless of the CONFIG_OF_IRQ setting. 106 94 */ 107 95 extern unsigned int irq_of_parse_and_map(struct device_node *node, int index); 108 - u32 of_msi_map_rid(struct device *dev, struct device_node *msi_np, u32 rid_in); 109 96 110 97 #else /* !CONFIG_OF && !CONFIG_SPARC */ 111 98 static inline unsigned int irq_of_parse_and_map(struct device_node *dev, 112 99 int index) 113 100 { 114 101 return 0; 115 - } 116 - 117 - static inline u32 of_msi_map_rid(struct device *dev, 118 - struct device_node *msi_np, u32 rid_in) 119 - { 120 - return rid_in; 121 102 } 122 103 #endif /* !CONFIG_OF */ 123 104