Skip to content

Commit 6cfb0b9

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 fa5ab14 commit 6cfb0b9

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
@@ -328,6 +328,15 @@ static int of_bus_default_flags_match(struct device_node *np)
328328

329329
static int of_bus_default_match(struct device_node *np)
330330
{
331+
/**
332+
* To avoid issues with "missing" '#{address,size}-cells' properties
333+
* in dcp/dcpext nodes while evaluatting the 'piodma' sub device.
334+
* Keep this at least until v6.13 + 2 to ensure fixed devicetrees are
335+
* deployed.
336+
*/
337+
if (of_device_is_compatible(np, "apple,dcp") ||
338+
of_device_is_compatible(np, "apple,dcpext"))
339+
return true;
331340
/*
332341
* Check for presence first since of_bus_n_addr_cells() will warn when
333342
* 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)