mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Mark Brown <broonie@kernel.org>,
	Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, brgl@kernel.org,
		linux-doc@vger.kernel.org
Subject: Re: [PATCH v3 13/14] reset: convert reset core to using firmware nodes
Date: Tue, 10 Mar 2026 15:48:49 +0100	[thread overview]
Message-ID: <581eeac616ad0fa3376303e7136287b956534e69.camel@pengutronix.de> (raw)
In-Reply-To: <0b72286b-33dd-4bc9-8c0e-161c2f4baed8@sirena.org.uk>

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

  reply	other threads:[~2026-03-10 14:48 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06 17:22 [PATCH v3 00/14] reset: major reset core refactoring Bartosz Golaszewski
2026-03-06 17:22 ` [PATCH v3 01/14] reset: gpio: remove unneeded OF-node put Bartosz Golaszewski
2026-03-06 17:22 ` [PATCH v3 02/14] reset: gpio: add a devlink between reset-gpio and its consumer Bartosz Golaszewski
2026-03-06 17:22 ` [PATCH v3 03/14] reset: gpio: simplify fallback device matching Bartosz Golaszewski
2026-03-06 17:22 ` [PATCH v3 04/14] reset: gpio: remove unneeded auxiliary_set_drvdata() Bartosz Golaszewski
2026-03-06 17:22 ` [PATCH v3 05/14] reset: warn on reset-gpio release Bartosz Golaszewski
2026-03-09  9:21   ` Philipp Zabel
2026-03-06 17:22 ` [PATCH v3 06/14] reset: fold ida_alloc() into reset_create_gpio_aux_device() Bartosz Golaszewski
2026-03-09  7:47   ` Philipp Zabel
2026-03-06 17:22 ` [PATCH v3 07/14] reset: use lock guards in reset core Bartosz Golaszewski
2026-03-06 17:22 ` [PATCH v3 08/14] reset: handle removing supplier before consumers Bartosz Golaszewski
2026-03-09  7:47   ` Philipp Zabel
2026-03-06 17:22 ` [PATCH v3 09/14] reset: protect struct reset_controller_dev with its own mutex Bartosz Golaszewski
2026-03-09  8:01   ` Philipp Zabel
2026-03-06 17:22 ` [PATCH v3 10/14] reset: protect struct reset_control " Bartosz Golaszewski
2026-03-09  8:01   ` Philipp Zabel
2026-03-06 17:22 ` [PATCH v3 11/14] reset: convert of_reset_control_get_count() to using firmware nodes Bartosz Golaszewski
2026-03-06 17:22 ` [PATCH v3 12/14] reset: convert the core API " Bartosz Golaszewski
2026-03-06 17:22 ` [PATCH v3 13/14] reset: convert reset core " Bartosz Golaszewski
2026-03-09  8:01   ` Philipp Zabel
2026-03-10 14:16   ` Mark Brown
2026-03-10 14:48     ` Philipp Zabel [this message]
2026-03-10 14:53       ` Bartosz Golaszewski
2026-03-10 15:00   ` Geert Uytterhoeven
2026-03-11 15:47   ` Tommaso Merciai
2026-03-11 15:54     ` Bartosz Golaszewski
2026-03-11 16:06       ` Tommaso Merciai
2026-03-06 17:22 ` [PATCH v3 14/14] reset: gpio: make the driver fwnode-agnostic Bartosz Golaszewski
2026-03-09  9:25 ` [PATCH v3 00/14] reset: major reset core refactoring Philipp Zabel
2026-03-09  9:34   ` Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=581eeac616ad0fa3376303e7136287b956534e69.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=broonie@kernel.org \
    --cc=corbet@lwn.net \
    --cc=krzk@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®