[PATCH] of: address: treat absent dma-ranges as 1:1 translation
Lucas Stach
l.stach at pengutronix.de
Wed May 18 10:57:45 PDT 2022
Some DTs use dma-ranges in child busses without this property being present
in the parent bus. To avoid failing the address translation, do the same as
the Linux kernel and treat absence of this property as a 1:1 translation.
Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
drivers/of/address.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/of/address.c b/drivers/of/address.c
index 67e8062f5d17..4eafce376d36 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -301,10 +301,13 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
*
* As far as we know, this damage only exists on Apple machines, so
* This code is only enabled on powerpc. --gcl
+ *
+ * This quirk also applies for 'dma-ranges' which frequently exist in
+ * child nodes without 'dma-ranges' in the parent nodes. --RobH
*/
ranges = of_get_property(parent, rprop, &rlen);
#if !defined(CONFIG_PPC)
- if (ranges == NULL) {
+ if (ranges == NULL && strcmp(rprop, "dma-ranges")) {
pr_vdebug("OF: no ranges; cannot translate\n");
return 1;
}
--
2.35.3
More information about the barebox
mailing list