Linux clock framework development
 help / color / mirror / Atom feed
* [PATCH 0/3] clk: qcom: gdsc: three pre-existing correctness fixes
@ 2026-06-02 14:09 Herman van Hazendonk
  2026-06-02 14:09 ` [PATCH 1/3] clk: qcom: gdsc: propagate gdsc_check_status() errors from gdsc_poll_status Herman van Hazendonk
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Herman van Hazendonk @ 2026-06-02 14:09 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd
  Cc: linux-arm-msm, linux-clk, linux-kernel, Herman van Hazendonk

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-02 14:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-02 14:09 [PATCH 0/3] clk: qcom: gdsc: three pre-existing correctness fixes Herman van Hazendonk
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox