From: Herman van Hazendonk <github.com@herrie.org>
To: Bjorn Andersson <andersson@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org,
Herman van Hazendonk <github.com@herrie.org>
Subject: [PATCH 0/3] clk: qcom: gdsc: three pre-existing correctness fixes
Date: Tue, 2 Jun 2026 16:09:31 +0200 [thread overview]
Message-ID: <20260602140934.796697-1-github.com@herrie.org> (raw)
While preparing MSM8x60 support for the GDSC core (a separate series,
adding LEGACY_FOOTSWITCH and RPM_ALWAYS_ON), code review surfaced
three pre-existing correctness issues in drivers/clk/qcom/gdsc.c that
are independent of any new SoC enabling work. This series collects
those three fixes so each can be reviewed and queued on its own
schedule without blocking the MSM8x60 series.
1/3 - gdsc_poll_status: propagate gdsc_check_status() errno
The polling helper treats any non-zero gdsc_check_status() return
as "reached the target state". gdsc_check_status() returns < 0
on regmap_read() failure (e.g. parent regmap unbinding, bus
protection, debug-tool CSR removal). The boolean test promotes
that negative errno to "true" and the poll returns success with
the hardware state unknown -- silently misleading
gdsc_toggle_logic() and the gdsc_init() sync path.
2/3 - gdsc_init: propagate gdsc_enable() failure for ALWAYS_ON
GENPD_FLAG_ALWAYS_ON requires the domain to be ON at
pm_genpd_init() time. When the cold readback finds an ALWAYS_ON
GDSC powered down, gdsc_init() tries to bring it back up but
discards the gdsc_enable() return value. If the enable fails the
code still sets on=true and registers the domain as ALWAYS_ON,
so genpd reports "on" while the silicon is actually off and
consumer probes hang on dead registers.
3/3 - gdsc_unregister: tear down per-domain genpds + reorder
gdsc_unregister() removes the OF provider entry and tears down
the parent/subdomain wiring, but never calls pm_genpd_remove()
on the individual generic_pm_domain structures registered by
gdsc_init(). The dangling entries on gpd_list cause the next
gdsc_init() to fail with -EEXIST on deferred-probe replay,
module reload, or OF-overlay teardown. While here, of_genpd_-
del_provider() is moved ahead of gdsc_pm_subdomain_remove() so
that a racing of_genpd_get_from_provider() cannot attach to a
domain that is mid-removal.
The three changes are independent and could in principle be sent as
separate one-off patches, but they share a single file and the cover
letter makes it easier to reason about them together. Apply order is
not significant: each patch stands on its own.
Built and boot-tested on an HP TouchPad (APQ8060) in conjunction with
the MSM8x60 GDSC enabling series.
Herman van Hazendonk (3):
clk: qcom: gdsc: propagate gdsc_check_status() errors from
gdsc_poll_status
clk: qcom: gdsc: propagate gdsc_enable() failure for ALWAYS_ON domains
clk: qcom: gdsc: tear down per-domain genpds in gdsc_unregister()
drivers/clk/qcom/gdsc.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
base-commit: 944125b4c454b58d2fe6e35f1087a932b2050dff
--
2.43.0
next reply other threads:[~2026-06-02 14:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-02 14:09 Herman van Hazendonk [this message]
2026-06-02 14:09 ` [PATCH 1/3] clk: qcom: gdsc: propagate gdsc_check_status() errors from gdsc_poll_status Herman van Hazendonk
2026-06-02 14:09 ` [PATCH 2/3] clk: qcom: gdsc: propagate gdsc_enable() failure for ALWAYS_ON domains Herman van Hazendonk
2026-06-02 14:09 ` [PATCH 3/3] clk: qcom: gdsc: tear down per-domain genpds in gdsc_unregister() Herman van Hazendonk
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=20260602140934.796697-1-github.com@herrie.org \
--to=github.com@herrie.org \
--cc=andersson@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.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