summaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2020-10-06 15:38:32 +0200
committerRob Herring <robh@kernel.org>2020-10-06 15:38:32 +0200
commitaa6174f0d31e4d5785a843fc79a433bed7cac784 (patch)
treeaf3634259876c4986ef4fde2972e40c8d0f1068a /drivers/of
parentdt-bindings: mfd: ti,j721e-system-controller: Fix incorrect pattern property (diff)
parentscripts/dtc: only append to HOST_EXTRACFLAGS instead of overwriting (diff)
downloadlinux-aa6174f0d31e4d5785a843fc79a433bed7cac784.tar.xz
linux-aa6174f0d31e4d5785a843fc79a433bed7cac784.zip
Merge branch 'dt/linus' into dt/next
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/address.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/of/address.c b/drivers/of/address.c
index 590493e04b01..da4f7341323f 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -128,15 +128,29 @@ static unsigned int of_bus_pci_get_flags(const __be32 *addr)
* PCI bus specific translator
*/
+static bool of_node_is_pcie(struct device_node *np)
+{
+ bool is_pcie = of_node_name_eq(np, "pcie");
+
+ if (is_pcie)
+ pr_warn_once("%pOF: Missing device_type\n", np);
+
+ return is_pcie;
+}
+
static int of_bus_pci_match(struct device_node *np)
{
/*
* "pciex" is PCI Express
* "vci" is for the /chaos bridge on 1st-gen PCI powermacs
* "ht" is hypertransport
+ *
+ * If none of the device_type match, and that the node name is
+ * "pcie", accept the device as PCI (with a warning).
*/
return of_node_is_type(np, "pci") || of_node_is_type(np, "pciex") ||
- of_node_is_type(np, "vci") || of_node_is_type(np, "ht");
+ of_node_is_type(np, "vci") || of_node_is_type(np, "ht") ||
+ of_node_is_pcie(np);
}
static void of_bus_pci_count_cells(struct device_node *np,
@@ -985,6 +999,11 @@ int of_dma_get_range(struct device_node *np, u64 *dma_addr, u64 *paddr, u64 *siz
/* Don't error out as we'd break some existing DTs */
continue;
}
+ if (range.cpu_addr == OF_BAD_ADDR) {
+ pr_err("translation of DMA address(%llx) to CPU address failed node(%pOF)\n",
+ range.bus_addr, node);
+ continue;
+ }
dma_offset = range.cpu_addr - range.bus_addr;
/* Take lower and upper limits */