[PATCH 0/4] clk: implement sync_state support

From: Brian Masney

Date: Fri Jun 26 2026 - 12:40:46 EST


The existing support for disabling unused clks runs in the late initcall
stage, and it has been known for a long time that this is broken since
it runs too early in the boot up process. It doesn't work for kernel
modules, and it also doesn't work if all of the consumers haven't fully
probed yet. Folks have long recommended to boot certain platforms with
clk_ignore_unused to work around issues with disabling unused clks.

This series fixes this by adding support for sync_state to the clk
subsystem.

Changes in v3:
- Allow multiple sync_state callbacks in the driver core via a new
helper dev_add_sync_state(). This allows dropping changes to the QC
drivers that already have a sync_state callback since everything can
coexist without changes. This also makes it so that this can coexist
with the pmdomain subsystem.
- Only show "clk: Not disabling unused clocks" message once.
- Add Tested-by from Neil and Xuyang
- Link to v2: https://lore.kernel.org/linux-clk/20260616-clk-sync-state-v2-0-15f82c64d95c@xxxxxxxxxx/

Changes in v2:
- Split out clk-cbf-8996.c into it's own patch, and don't call
qcom_cc_sync_state().
- Clarify comment above call to dev_set_drv_sync_state() about
the -EBUSY.
- Added Tested-by from Jens
- Link to v1: https://lore.kernel.org/r/20260603-clk-sync-state-v1-0-457120eed200@xxxxxxxxxx

Signed-off-by: Brian Masney <bmasney@xxxxxxxxxx>
---
Brian Masney (4):
driver: core: introduce dev_add_sync_state()
pmdomain: core: migrate to dev_add_sync_state()
driver: core: remove dev_set_drv_sync_state()
clk: implement sync_state support

drivers/base/base.h | 7 +++++
drivers/base/core.c | 29 ++++++++++++++++++
drivers/clk/clk.c | 78 ++++++++++++++++++++++++++++++++++++++++---------
drivers/pmdomain/core.c | 4 +--
include/linux/clk.h | 14 +++++++++
include/linux/device.h | 21 +++++++------
6 files changed, 127 insertions(+), 26 deletions(-)
---
base-commit: 6c94b38b83a04c43ea49004275f0391404051093
change-id: 20260626-clk-sync-state-ad008829a689

Best regards,
--
Brian Masney <bmasney@xxxxxxxxxx>