From: Steven Price <steven.price@arm.com>
To: Philipp Zabel <p.zabel@pengutronix.de>, Heiko Stuebner <heiko@sntech.de>
Cc: linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Subject: Re: [PATCH] reset: use a shared SRCU domain for reset controls
Date: Thu, 23 Apr 2026 13:45:48 +0100 [thread overview]
Message-ID: <ad88a223-8dce-42a2-a09b-c65373c8991b@arm.com> (raw)
In-Reply-To: <e975712ff8e3c7af4b7b59ca5502f3ad405995fe.camel@pengutronix.de>
+Heiko for the Rockchip questions.
On 23/04/2026 11:27, Philipp Zabel wrote:
> Hi Steven,
>
> On Fr, 2026-04-17 at 16:48 +0100, Steven Price wrote:
>> Commit 78ebbff6d1a0 ("reset: handle removing supplier before consumers")
>> added a dynamically initialized srcu_struct to every reset_control and
>> cleaned it up again when the handle was dropped.
>>
>> That breaks early boot users which acquire and release reset handles
>> before workqueues are online. On rk3288 this shows up during
>> rockchip_smp_prepare_cpus(), where pmu_set_power_domain() gets a reset
>> control for a CPU core and then drops it again before SMP bring-up has
>> finished.
>
> Can the reset_control_put() call be dropped from pmu_set_power_domain()
> to fix the problem?
I'm not that familiar with the code, so I'm not sure.
Just dropping that call causes a WARN_ON() bringing the secondary CPUs
on (because the call to rockchip_get_core_reset() expects to have
exclusive access to the reset). Switching to a shared reset then his a
WARN_ON() in reset_control_assert because deassert_count == 0. I could
keep digging blindly but I'm not really sure how this code is meant to work.
Hopefully Heiko might be able to shed some more light on this?
> Putting the reset control should mean that the driver doesn't care
> about the state of the reset line anymore, but the platsmp code very
> much expects the reset line to stay deasserted after enabling a CPU.
> Acquiring reset controls in rockchip_smp_prepare_cpus() once and never
> giving them up via reset_control_put() seems like a correct fix,
> regardless of whether this patch is applied or not.
>
> It looks like the meson platsmp suffers from the same issue.
This is why I did the fix in the reset code - how many other platforms
might have similar issues? But obviously if these platforms are buggy
then they should be fixed.
My interest is keeping the devboard working so I can keep testing
Panfrost on it.
Thanks,
Steve
>> cleanup_srcu_struct() then tries to flush delayed SRCU work
>> and hits the WARN_ON(!wq_online) path, which can leave the machine
>> hanging before the serial console appears.
>>
>> Keep the supplier-removal protection, but move it to a single shared
>> static SRCU domain for the reset core. That preserves the rcdev lifetime
>> protection needed for supplier unregister without requiring per-handle
>> init_srcu_struct()/cleanup_srcu_struct() on normal get/put paths.
>
> I'd prefer to document the workqueue requirement and keep the SRCU
> domain per reset_control, if possible.
>
> regards
> Philipp
next prev parent reply other threads:[~2026-04-23 12:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 15:48 Steven Price
2026-04-20 8:18 ` Steven Price
2026-04-23 10:27 ` Philipp Zabel
2026-04-23 12:45 ` Steven Price [this message]
2026-04-23 14:15 ` Philipp Zabel
2026-04-24 9:04 ` Steven Price
2026-05-14 9:07 ` Steven Price
2026-05-21 21:15 ` Heiko Stuebner
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=ad88a223-8dce-42a2-a09b-c65373c8991b@arm.com \
--to=steven.price@arm.com \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=heiko@sntech.de \
--cc=linux-kernel@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
/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®