Skip to content

Commit 2d24294

Browse files
committed
of: Workaround missing '#{address,size}-cells' properties [drop v6.13 + 2]
The dcp and dcpext nodes are missing '#address-cells' and '#size-cells' properties expected for busses. The nodes are handled as bus since they contain the 'piodma' subdevice. Commit 6e5773d ("of/address: Fix WARN when attempting translating non-translatable addresses") triggers an oops while evaluating reserved memory in dart. Commit 045b14c ("of: WARN on deprecated #address-cells/#size-cells handling") triggers warnings in the same code path. Happens only on devices with reserved memory for the piodma device (should be dcp/dcp0 only). Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 047a8d7 commit 2d24294

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

drivers/of/address.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,15 @@ static int of_bus_default_flags_match(struct device_node *np)
342342

343343
static int of_bus_default_match(struct device_node *np)
344344
{
345+
/**
346+
* To avoid issues with "missing" '#{address,size}-cells' properties
347+
* in dcp/dcpext nodes while evaluatting the 'piodma' sub device.
348+
* Keep this at least until v6.13 + 2 to ensure fixed devicetrees are
349+
* deployed.
350+
*/
351+
if (of_device_is_compatible(np, "apple,dcp") ||
352+
of_device_is_compatible(np, "apple,dcpext"))
353+
return true;
345354
/*
346355
* Check for presence first since of_bus_n_addr_cells() will warn when
347356
* walking parent nodes.

drivers/of/base.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ static bool __of_node_is_type(const struct device_node *np, const char *type)
8989

9090
#define EXCLUDED_DEFAULT_CELLS_PLATFORMS ( \
9191
IS_ENABLED(CONFIG_SPARC) || \
92+
of_find_compatible_node(NULL, NULL, "apple,dcp") || \
93+
of_find_compatible_node(NULL, NULL, "apple,dcpext") || \
9294
of_find_compatible_node(NULL, NULL, "coreboot") \
9395
)
9496

0 commit comments

Comments
 (0)