Re: [PATCH v3 13/14] reset: convert reset core to using firmware nodes

From: Philipp Zabel

Date: Tue Mar 10 2026 - 11:21:50 EST


On Di, 2026-03-10 at 14:16 +0000, Mark Brown wrote:
> On Fri, Mar 06, 2026 at 06:22:57PM +0100, Bartosz Golaszewski wrote:
> > With everything else now in place, we can convert the remaining parts of
> > the reset subsystem to becoming fwnode-agnostic - meaning it will work
> > with all kinds of firmware nodes, not only devicetree.
>
> This patch is causing issues for me in yesterday's -next on a Toradax
> Mallow platform with a TI K3 AM625. Things start to go wrong with a
> WARN_ON():
>
> [ 11.544610] WARNING: drivers/reset/core.c:1195 at __fwnode_reset_control_get+0x488/0x580, CPU#0: (udev-worker)/129

Thank you, that's reset_controller_register() setting
fwnode_reset_n_cells to 2 since rcdev->of_node is set and rcdev-
>of_reset_n_cells == 2:

if (rcdev->of_node) {
rcdev->fwnode = of_fwnode_handle(rcdev->of_node);
rcdev->fwnode_reset_n_cells = rcdev->of_reset_n_cells;
}

and then overwriting it with 1, because rcdev->fwnode is now set as
well, rcdev->fwnode_xlate is NULL, and rcdev->of_xlate is ignored:

if (rcdev->fwnode && !rcdev->fwnode_xlate) {
rcdev->fwnode_reset_n_cells = 1;
rcdev->fwnode_xlate = fwnode_reset_simple_xlate;
}

That then fails because #reset-cells is <2> for k3_reset.
We also have to check !rcdev->of_xlate here. Could you check if this
fixes the issue?

----------8<----------
diff --git a/drivers/reset/core.c b/drivers/reset/core.c
index e625cf59cfb0..d52595db5f87 100644
--- a/drivers/reset/core.c
+++ b/drivers/reset/core.c
@@ -143,7 +143,7 @@ int reset_controller_register(struct reset_controller_dev *rcdev)
rcdev->fwnode_reset_n_cells = rcdev->of_reset_n_cells;
}

- if (rcdev->fwnode && !rcdev->fwnode_xlate) {
+ if (rcdev->fwnode && !rcdev->fwnode_xlate && !rcdev->of_xlate) {
rcdev->fwnode_reset_n_cells = 1;
rcdev->fwnode_xlate = fwnode_reset_simple_xlate;
}
---------->8----------

regards
Philipp