* [PATCH v2 1/5] ASoC: dt-bindings: rockchip-spdif: Correct SPDIF clock descriptions
2026-06-02 10:16 [PATCH v2 0/5] ASoC: rockchip: Reorder clock enable sequence phucduc.bui
@ 2026-06-02 10:16 ` phucduc.bui
2026-06-12 15:12 ` Rob Herring (Arm)
2026-06-02 10:16 ` [PATCH v2 2/5] ASoC: rockchip: spdif: Reorder clock enable sequence phucduc.bui
` (4 subsequent siblings)
5 siblings, 1 reply; 8+ messages in thread
From: phucduc.bui @ 2026-06-02 10:16 UTC (permalink / raw)
To: Heiko Stuebner, Mark Brown, Liam Girdwood, Krzysztof Kozlowski
Cc: Rob Herring, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
devicetree, linux-sound, linux-rockchip, linux-arm-kernel,
linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Update the binding descriptions to match the actual clock usage, where
'mclk' is the controller clock and 'hclk' is the bus clock.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
- Update commit message based on Krzysztof's review
Documentation/devicetree/bindings/sound/rockchip-spdif.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/sound/rockchip-spdif.yaml b/Documentation/devicetree/bindings/sound/rockchip-spdif.yaml
index 502907dd28b3..b174d7498029 100644
--- a/Documentation/devicetree/bindings/sound/rockchip-spdif.yaml
+++ b/Documentation/devicetree/bindings/sound/rockchip-spdif.yaml
@@ -45,8 +45,8 @@ properties:
clocks:
items:
- - description: clock for SPDIF bus
- description: clock for SPDIF controller
+ - description: clock for SPDIF bus
clock-names:
items:
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH v2 1/5] ASoC: dt-bindings: rockchip-spdif: Correct SPDIF clock descriptions
2026-06-02 10:16 ` [PATCH v2 1/5] ASoC: dt-bindings: rockchip-spdif: Correct SPDIF clock descriptions phucduc.bui
@ 2026-06-12 15:12 ` Rob Herring (Arm)
0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring (Arm) @ 2026-06-12 15:12 UTC (permalink / raw)
To: phucduc.bui
Cc: Mark Brown, linux-kernel, Heiko Stuebner, Krzysztof Kozlowski,
linux-sound, Liam Girdwood, Jaroslav Kysela, Conor Dooley,
devicetree, linux-rockchip, linux-arm-kernel, Takashi Iwai
On Tue, 02 Jun 2026 17:16:04 +0700, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> Update the binding descriptions to match the actual clock usage, where
> 'mclk' is the controller clock and 'hclk' is the bus clock.
>
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
> ---
>
> Changes in v2:
> - Update commit message based on Krzysztof's review
>
> Documentation/devicetree/bindings/sound/rockchip-spdif.yaml | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 2/5] ASoC: rockchip: spdif: Reorder clock enable sequence
2026-06-02 10:16 [PATCH v2 0/5] ASoC: rockchip: Reorder clock enable sequence phucduc.bui
2026-06-02 10:16 ` [PATCH v2 1/5] ASoC: dt-bindings: rockchip-spdif: Correct SPDIF clock descriptions phucduc.bui
@ 2026-06-02 10:16 ` phucduc.bui
2026-06-02 10:16 ` [PATCH v2 3/5] ASoC: rockchip: rockchip_pdm: " phucduc.bui
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: phucduc.bui @ 2026-06-02 10:16 UTC (permalink / raw)
To: Heiko Stuebner, Mark Brown, Liam Girdwood, Krzysztof Kozlowski
Cc: Rob Herring, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
devicetree, linux-sound, linux-rockchip, linux-arm-kernel,
linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Enable the 'hclk' bus clock before the 'mclk' controller clock during
runtime resume.
The bus clock provides the register access interface, so enable it before
the controller clock. This also makes the resume sequence the reverse of
the suspend sequence, which keeps the clock ordering consistent.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
NOTE: This patch is compile-tested only. Please help test if you have
the relevant Rockchip hardware.
Changes in v2:
- Clarify in the commit message that the resume sequence becomes the
reverse of the suspend sequence.
sound/soc/rockchip/rockchip_spdif.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c
index 581624f2682e..8de5b76cfe79 100644
--- a/sound/soc/rockchip/rockchip_spdif.c
+++ b/sound/soc/rockchip/rockchip_spdif.c
@@ -76,16 +76,16 @@ static int rk_spdif_runtime_resume(struct device *dev)
struct rk_spdif_dev *spdif = dev_get_drvdata(dev);
int ret;
- ret = clk_prepare_enable(spdif->mclk);
+ ret = clk_prepare_enable(spdif->hclk);
if (ret) {
- dev_err(spdif->dev, "mclk clock enable failed %d\n", ret);
+ dev_err(spdif->dev, "hclk clock enable failed %d\n", ret);
return ret;
}
- ret = clk_prepare_enable(spdif->hclk);
+ ret = clk_prepare_enable(spdif->mclk);
if (ret) {
- clk_disable_unprepare(spdif->mclk);
- dev_err(spdif->dev, "hclk clock enable failed %d\n", ret);
+ clk_disable_unprepare(spdif->hclk);
+ dev_err(spdif->dev, "mclk clock enable failed %d\n", ret);
return ret;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH v2 3/5] ASoC: rockchip: rockchip_pdm: Reorder clock enable sequence
2026-06-02 10:16 [PATCH v2 0/5] ASoC: rockchip: Reorder clock enable sequence phucduc.bui
2026-06-02 10:16 ` [PATCH v2 1/5] ASoC: dt-bindings: rockchip-spdif: Correct SPDIF clock descriptions phucduc.bui
2026-06-02 10:16 ` [PATCH v2 2/5] ASoC: rockchip: spdif: Reorder clock enable sequence phucduc.bui
@ 2026-06-02 10:16 ` phucduc.bui
2026-06-02 10:16 ` [PATCH v2 4/5] ASoC: rockchip: spdif: Restore regcache cache-only mode on sync failure phucduc.bui
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: phucduc.bui @ 2026-06-02 10:16 UTC (permalink / raw)
To: Heiko Stuebner, Mark Brown, Liam Girdwood, Krzysztof Kozlowski
Cc: Rob Herring, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
devicetree, linux-sound, linux-rockchip, linux-arm-kernel,
linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Enable the 'hclk' bus clock before the 'clk' controller clock during
runtime resume.
The bus clock provides the register access interface, so enable it before
the controller clock. This also makes the resume sequence the reverse of
the suspend sequence, which keeps the clock ordering consistent.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
NOTE: This patch is compile-tested only. Please help test if you have
the relevant Rockchip hardware.
Changes in v2:
- Clarify in the commit message that the resume sequence becomes the
reverse of the suspend sequence.
sound/soc/rockchip/rockchip_pdm.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c
index c69cdd6f2499..8f78f7bc1806 100644
--- a/sound/soc/rockchip/rockchip_pdm.c
+++ b/sound/soc/rockchip/rockchip_pdm.c
@@ -422,16 +422,16 @@ static int rockchip_pdm_runtime_resume(struct device *dev)
struct rk_pdm_dev *pdm = dev_get_drvdata(dev);
int ret;
- ret = clk_prepare_enable(pdm->clk);
+ ret = clk_prepare_enable(pdm->hclk);
if (ret) {
- dev_err(pdm->dev, "clock enable failed %d\n", ret);
+ dev_err(pdm->dev, "hclock enable failed %d\n", ret);
return ret;
}
- ret = clk_prepare_enable(pdm->hclk);
+ ret = clk_prepare_enable(pdm->clk);
if (ret) {
- clk_disable_unprepare(pdm->clk);
- dev_err(pdm->dev, "hclock enable failed %d\n", ret);
+ clk_disable_unprepare(pdm->hclk);
+ dev_err(pdm->dev, "clock enable failed %d\n", ret);
return ret;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH v2 4/5] ASoC: rockchip: spdif: Restore regcache cache-only mode on sync failure
2026-06-02 10:16 [PATCH v2 0/5] ASoC: rockchip: Reorder clock enable sequence phucduc.bui
` (2 preceding siblings ...)
2026-06-02 10:16 ` [PATCH v2 3/5] ASoC: rockchip: rockchip_pdm: " phucduc.bui
@ 2026-06-02 10:16 ` phucduc.bui
2026-06-02 10:16 ` [PATCH v2 5/5] ASoC: rockchip: rockchip_pdm: Handle runtime PM resume failures in set_fmt phucduc.bui
2026-06-11 19:49 ` [PATCH v2 0/5] ASoC: rockchip: Reorder clock enable sequence Mark Brown
5 siblings, 0 replies; 8+ messages in thread
From: phucduc.bui @ 2026-06-02 10:16 UTC (permalink / raw)
To: Heiko Stuebner, Mark Brown, Liam Girdwood, Krzysztof Kozlowski
Cc: Rob Herring, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
devicetree, linux-sound, linux-rockchip, linux-arm-kernel,
linux-kernel, bui duc phuc, Sashiko AI Review
From: bui duc phuc <phucduc.bui@gmail.com>
If regcache_sync() fails during runtime resume, the driver disables the
clocks and returns an error. However, the regmap cache-only mode is left
disabled.
Restore cache-only mode in the error path so subsequent register accesses
continue to use the cache while the device is inactive.
Reported-by: Sashiko AI Review <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/20260522103713.6C09D1F000E9@smtp.kernel.org/
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
NOTE: This patch is compile-tested only. Please help test if you have
the relevant Rockchip hardware.
sound/soc/rockchip/rockchip_spdif.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c
index 8de5b76cfe79..7f15bc7f8f35 100644
--- a/sound/soc/rockchip/rockchip_spdif.c
+++ b/sound/soc/rockchip/rockchip_spdif.c
@@ -94,6 +94,7 @@ static int rk_spdif_runtime_resume(struct device *dev)
ret = regcache_sync(spdif->regmap);
if (ret) {
+ regcache_cache_only(spdif->regmap, true);
clk_disable_unprepare(spdif->mclk);
clk_disable_unprepare(spdif->hclk);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH v2 5/5] ASoC: rockchip: rockchip_pdm: Handle runtime PM resume failures in set_fmt
2026-06-02 10:16 [PATCH v2 0/5] ASoC: rockchip: Reorder clock enable sequence phucduc.bui
` (3 preceding siblings ...)
2026-06-02 10:16 ` [PATCH v2 4/5] ASoC: rockchip: spdif: Restore regcache cache-only mode on sync failure phucduc.bui
@ 2026-06-02 10:16 ` phucduc.bui
2026-06-11 19:49 ` [PATCH v2 0/5] ASoC: rockchip: Reorder clock enable sequence Mark Brown
5 siblings, 0 replies; 8+ messages in thread
From: phucduc.bui @ 2026-06-02 10:16 UTC (permalink / raw)
To: Heiko Stuebner, Mark Brown, Liam Girdwood, Krzysztof Kozlowski
Cc: Rob Herring, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
devicetree, linux-sound, linux-rockchip, linux-arm-kernel,
linux-kernel, bui duc phuc, Sashiko AI Review
From: bui duc phuc <phucduc.bui@gmail.com>
rockchip_pdm_set_fmt() calls pm_runtime_get_sync() before accessing
hardware registers, but ignores its return value.
If the runtime resume fails, the function continues to perform register
accesses while the device state is undefined.
Replace pm_runtime_get_sync() with pm_runtime_resume_and_get() and
return early on failure to avoid unpowered register accesses.
Reported-by: Sashiko AI Review <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/20260522110302.349421F000E9@smtp.kernel.org/
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
NOTE: This patch is compile-tested only. Please help test if you have
the relevant Rockchip hardware.
sound/soc/rockchip/rockchip_pdm.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c
index 8f78f7bc1806..115e90d3bbfe 100644
--- a/sound/soc/rockchip/rockchip_pdm.c
+++ b/sound/soc/rockchip/rockchip_pdm.c
@@ -321,6 +321,7 @@ static int rockchip_pdm_set_fmt(struct snd_soc_dai *cpu_dai,
{
struct rk_pdm_dev *pdm = to_info(cpu_dai);
unsigned int mask = 0, val = 0;
+ int ret;
mask = PDM_CKP_MSK;
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
@@ -334,7 +335,10 @@ static int rockchip_pdm_set_fmt(struct snd_soc_dai *cpu_dai,
return -EINVAL;
}
- pm_runtime_get_sync(cpu_dai->dev);
+ ret = pm_runtime_resume_and_get(cpu_dai->dev);
+ if (ret)
+ return ret;
+
regmap_update_bits(pdm->regmap, PDM_CLK_CTRL, mask, val);
pm_runtime_put(cpu_dai->dev);
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH v2 0/5] ASoC: rockchip: Reorder clock enable sequence
2026-06-02 10:16 [PATCH v2 0/5] ASoC: rockchip: Reorder clock enable sequence phucduc.bui
` (4 preceding siblings ...)
2026-06-02 10:16 ` [PATCH v2 5/5] ASoC: rockchip: rockchip_pdm: Handle runtime PM resume failures in set_fmt phucduc.bui
@ 2026-06-11 19:49 ` Mark Brown
5 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2026-06-11 19:49 UTC (permalink / raw)
To: Heiko Stuebner, Liam Girdwood, Krzysztof Kozlowski, phucduc.bui
Cc: Rob Herring, Conor Dooley, Jaroslav Kysela, Takashi Iwai,
devicetree, linux-sound, linux-rockchip, linux-arm-kernel,
linux-kernel
On Tue, 02 Jun 2026 17:16:03 +0700, phucduc.bui@gmail.com wrote:
> ASoC: rockchip: Reorder clock enable sequence
>
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> Hi all,
>
> This series reorders the runtime resume clock enable sequence in the
> Rockchip SPDIF and PDM drivers to enable the bus clock before the
> functional controller clock.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.2
Thanks!
[1/5] ASoC: dt-bindings: rockchip-spdif: Correct SPDIF clock descriptions
https://git.kernel.org/broonie/sound/c/d057cbc218ac
[2/5] ASoC: rockchip: spdif: Reorder clock enable sequence
https://git.kernel.org/broonie/sound/c/74d3f01a90ca
[3/5] ASoC: rockchip: rockchip_pdm: Reorder clock enable sequence
https://git.kernel.org/broonie/sound/c/3168721d6ec3
[4/5] ASoC: rockchip: spdif: Restore regcache cache-only mode on sync failure
https://git.kernel.org/broonie/sound/c/3546e9aa691a
[5/5] ASoC: rockchip: rockchip_pdm: Handle runtime PM resume failures in set_fmt
https://git.kernel.org/broonie/sound/c/ee7b5f7b3933
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 8+ messages in thread