* [PATCH 0/2] ASoC: Add flag to ignore 0Hz sysclk requests
@ 2026-03-17 9:49 Sheetal
2026-03-17 9:49 ` [PATCH 1/2] ASoC: simple-card-utils: add ignore_zero_sysclk flag Sheetal
2026-03-17 9:49 ` [PATCH 2/2] ASoC: tegra: enable ignore_zero_sysclk for Tegra Sheetal
0 siblings, 2 replies; 8+ messages in thread
From: Sheetal @ 2026-03-17 9:49 UTC (permalink / raw)
To: Mark Brown, Kuninori Morimoto, Jaroslav Kysela, Takashi Iwai,
Liam Girdwood, Thierry Reding, Jonathan Hunter
Cc: Mohan Kumar, linux-sound, linux-kernel, linux-tegra, Sheetal
Commit 2458adb8f92a ("SoC: simple-card-utils: set 0Hz to sysclk
when shutdown") introduced 0Hz sysclk requests during stream
shutdown. On Tegra platforms, clocks such as AUD_MCLK have a
minimum allowed frequency, so passing 0Hz results in Boot and
Power Management Processor (BPMP) clock controller errors.
This series adds an ignore_zero_sysclk flag to simple-card-utils
so that platform drivers can opt out of these 0Hz requests, and
enables it for the Tegra audio graph card.
Sheetal (2):
ASoC: simple-card-utils: add ignore_zero_sysclk flag
ASoC: tegra: enable ignore_zero_sysclk for Tegra
include/sound/simple_card_utils.h | 1 +
sound/soc/generic/simple-card-utils.c | 6 ++++--
sound/soc/tegra/tegra_audio_graph_card.c | 1 +
3 files changed, 6 insertions(+), 2 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH 1/2] ASoC: simple-card-utils: add ignore_zero_sysclk flag 2026-03-17 9:49 [PATCH 0/2] ASoC: Add flag to ignore 0Hz sysclk requests Sheetal @ 2026-03-17 9:49 ` Sheetal 2026-03-17 13:39 ` Mark Brown 2026-03-17 9:49 ` [PATCH 2/2] ASoC: tegra: enable ignore_zero_sysclk for Tegra Sheetal 1 sibling, 1 reply; 8+ messages in thread From: Sheetal @ 2026-03-17 9:49 UTC (permalink / raw) To: Mark Brown, Kuninori Morimoto, Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Thierry Reding, Jonathan Hunter Cc: Mohan Kumar, linux-sound, linux-kernel, linux-tegra, Sheetal Commit 2458adb8f92a ("SoC: simple-card-utils: set 0Hz to sysclk when shutdown") updated the simple-card-util driver to send 0Hz frequency requests during stream shutdown, which can request frequencies lower than a platform may support. Add ignore_zero_sysclk flag to struct simple_util_priv to allow drivers to ignore these 0Hz sysclk requests when they would result in a clock frequency below the hardware's minimum allowed rate. Signed-off-by: Sheetal <sheetal@nvidia.com> --- include/sound/simple_card_utils.h | 1 + sound/soc/generic/simple-card-utils.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 915e6ae5f68d..02ede92e8269 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -81,6 +81,7 @@ struct simple_util_priv { const struct snd_soc_ops *ops; unsigned int dpcm_selectable:1; unsigned int force_dpcm:1; + unsigned int ignore_zero_sysclk:1; }; #define simple_priv_to_card(priv) (&(priv)->snd_card) #define simple_priv_to_props(priv, i) ((priv)->dai_props + (i)) diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 3115e1f37c0c..04ae242a51d0 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -383,7 +383,8 @@ void simple_util_shutdown(struct snd_pcm_substream *substream) for_each_prop_dai_cpu(props, i, dai) { struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, i); - if (props->mclk_fs && !dai->clk_fixed && !snd_soc_dai_active(cpu_dai)) + if (!priv->ignore_zero_sysclk && props->mclk_fs && + !dai->clk_fixed && !snd_soc_dai_active(cpu_dai)) snd_soc_dai_set_sysclk(cpu_dai, 0, 0, dai->clk_direction); simple_clk_disable(dai); @@ -391,7 +392,8 @@ void simple_util_shutdown(struct snd_pcm_substream *substream) for_each_prop_dai_codec(props, i, dai) { struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, i); - if (props->mclk_fs && !dai->clk_fixed && !snd_soc_dai_active(codec_dai)) + if (!priv->ignore_zero_sysclk && props->mclk_fs && + !dai->clk_fixed && !snd_soc_dai_active(codec_dai)) snd_soc_dai_set_sysclk(codec_dai, 0, 0, dai->clk_direction); simple_clk_disable(dai); -- 2.17.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] ASoC: simple-card-utils: add ignore_zero_sysclk flag 2026-03-17 9:49 ` [PATCH 1/2] ASoC: simple-card-utils: add ignore_zero_sysclk flag Sheetal @ 2026-03-17 13:39 ` Mark Brown 2026-03-17 23:02 ` Kuninori Morimoto 0 siblings, 1 reply; 8+ messages in thread From: Mark Brown @ 2026-03-17 13:39 UTC (permalink / raw) To: Sheetal Cc: Kuninori Morimoto, Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Thierry Reding, Jonathan Hunter, Mohan Kumar, linux-sound, linux-kernel, linux-tegra [-- Attachment #1: Type: text/plain, Size: 735 bytes --] On Tue, Mar 17, 2026 at 09:49:09AM +0000, Sheetal wrote: > Commit 2458adb8f92a ("SoC: simple-card-utils: set 0Hz to > sysclk when shutdown") updated the simple-card-util driver to > send 0Hz frequency requests during stream shutdown, which can > request frequencies lower than a platform may support. > Add ignore_zero_sysclk flag to struct simple_util_priv to allow drivers > to ignore these 0Hz sysclk requests when they would result in a clock > frequency below the hardware's minimum allowed rate. If the driver simply can't tolerate disabling the sysclk it seems like it would be easier to just have the driver directly ignore attempts to do so rather than adding this flag which the driver has to set only to get it passed in? [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] ASoC: simple-card-utils: add ignore_zero_sysclk flag 2026-03-17 13:39 ` Mark Brown @ 2026-03-17 23:02 ` Kuninori Morimoto 2026-03-18 9:06 ` Sheetal . 0 siblings, 1 reply; 8+ messages in thread From: Kuninori Morimoto @ 2026-03-17 23:02 UTC (permalink / raw) To: Mark Brown Cc: Sheetal, Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Thierry Reding, Jonathan Hunter, Mohan Kumar, linux-sound, linux-kernel, linux-tegra Hi > > Commit 2458adb8f92a ("SoC: simple-card-utils: set 0Hz to > > sysclk when shutdown") updated the simple-card-util driver to > > send 0Hz frequency requests during stream shutdown, which can > > request frequencies lower than a platform may support. > > > Add ignore_zero_sysclk flag to struct simple_util_priv to allow drivers > > to ignore these 0Hz sysclk requests when they would result in a clock > > frequency below the hardware's minimum allowed rate. > > If the driver simply can't tolerate disabling the sysclk it seems like > it would be easier to just have the driver directly ignore attempts to > do so rather than adding this flag which the driver has to set only to > get it passed in? Agree. I think this commit can help you ? 1e1a2ef95b571825ca9c0113f6bef51e9cec98b0 ("ASoC: da7213: Avoid setting PLL when closing audio stream") Thank you for your help !! Best regards --- Kuninori Morimoto ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] ASoC: simple-card-utils: add ignore_zero_sysclk flag 2026-03-17 23:02 ` Kuninori Morimoto @ 2026-03-18 9:06 ` Sheetal . 2026-03-18 11:56 ` Mark Brown 0 siblings, 1 reply; 8+ messages in thread From: Sheetal . @ 2026-03-18 9:06 UTC (permalink / raw) To: Kuninori Morimoto, Mark Brown, katsuhiro Cc: Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Thierry Reding, Jonathan Hunter, Mohan Kumar, linux-sound, linux-kernel, linux-tegra On 18-03-2026 04:32, Kuninori Morimoto wrote: > External email: Use caution opening links or attachments > > > Hi > >>> Commit 2458adb8f92a ("SoC: simple-card-utils: set 0Hz to >>> sysclk when shutdown") updated the simple-card-util driver to >>> send 0Hz frequency requests during stream shutdown, which can >>> request frequencies lower than a platform may support. >> >>> Add ignore_zero_sysclk flag to struct simple_util_priv to allow drivers >>> to ignore these 0Hz sysclk requests when they would result in a clock >>> frequency below the hardware's minimum allowed rate. >> >> If the driver simply can't tolerate disabling the sysclk it seems like >> it would be easier to just have the driver directly ignore attempts to >> do so rather than adding this flag which the driver has to set only to >> get it passed in? > > Agree. > I think this commit can help you ? > > 1e1a2ef95b571825ca9c0113f6bef51e9cec98b0 > ("ASoC: da7213: Avoid setting PLL when closing audio stream") > > Thank you for your help !! Thank you for the feedback and the da7213 reference. The concern with the per-codec approach is that this affects any codec with a set_dai_sysclk that forwards the frequency to clk_set_rate(). Since any codec can be connected to Tegra platforms, and MCLK is provided by the SoC to external codecs, when clk_set_rate(..., 0) reaches the BPMP firmware, it raises a fault for rates below the hardware minimum. Fixing this per-codec would require individual patches for each. > > Best regards > --- > Kuninori Morimoto ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] ASoC: simple-card-utils: add ignore_zero_sysclk flag 2026-03-18 9:06 ` Sheetal . @ 2026-03-18 11:56 ` Mark Brown 2026-03-25 5:27 ` Sheetal . 0 siblings, 1 reply; 8+ messages in thread From: Mark Brown @ 2026-03-18 11:56 UTC (permalink / raw) To: Sheetal . Cc: Kuninori Morimoto, katsuhiro, Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Thierry Reding, Jonathan Hunter, Mohan Kumar, linux-sound, linux-kernel, linux-tegra [-- Attachment #1: Type: text/plain, Size: 1428 bytes --] On Wed, Mar 18, 2026 at 02:36:42PM +0530, Sheetal . wrote: > On 18-03-2026 04:32, Kuninori Morimoto wrote: > > > If the driver simply can't tolerate disabling the sysclk it seems like > > > it would be easier to just have the driver directly ignore attempts to > > > do so rather than adding this flag which the driver has to set only to > > > get it passed in? > > Agree. > > I think this commit can help you ? > > 1e1a2ef95b571825ca9c0113f6bef51e9cec98b0 > > ("ASoC: da7213: Avoid setting PLL when closing audio stream") > Thank you for the feedback and the da7213 reference. > The concern with the per-codec approach is that this affects any codec with > a set_dai_sysclk that forwards the frequency to clk_set_rate(). Since any > codec can be connected to Tegra platforms, and MCLK is provided by the SoC > to external codecs, when clk_set_rate(..., 0) reaches the BPMP firmware, it > raises a fault for rates below the hardware minimum. Fixing this per-codec > would require individual patches for each. Since in the clock API clk_get_rate() maps onto clk_disable() those drivers ought to be fixed anyway - perhaps we need some helpers for this since it does look like we have some issues here. Either the driver should ignore the disable (possibly due to already refcounting the use of the clock and disabling/enabling without machine driver help) or it should translate a rate of 0 to a disable. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] ASoC: simple-card-utils: add ignore_zero_sysclk flag 2026-03-18 11:56 ` Mark Brown @ 2026-03-25 5:27 ` Sheetal . 0 siblings, 0 replies; 8+ messages in thread From: Sheetal . @ 2026-03-25 5:27 UTC (permalink / raw) To: Mark Brown, Oder Chiou Cc: Kuninori Morimoto, katsuhiro, Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Thierry Reding, Jonathan Hunter, Mohan Kumar, linux-sound, linux-kernel, linux-tegra, Sameer Pujar On 18-03-2026 17:26, Mark Brown wrote: > On Wed, Mar 18, 2026 at 02:36:42PM +0530, Sheetal . wrote: >> On 18-03-2026 04:32, Kuninori Morimoto wrote: > >>>> If the driver simply can't tolerate disabling the sysclk it seems like >>>> it would be easier to just have the driver directly ignore attempts to >>>> do so rather than adding this flag which the driver has to set only to >>>> get it passed in? > >>> Agree. >>> I think this commit can help you ? > >>> 1e1a2ef95b571825ca9c0113f6bef51e9cec98b0 >>> ("ASoC: da7213: Avoid setting PLL when closing audio stream") > >> Thank you for the feedback and the da7213 reference. > >> The concern with the per-codec approach is that this affects any codec with >> a set_dai_sysclk that forwards the frequency to clk_set_rate(). Since any >> codec can be connected to Tegra platforms, and MCLK is provided by the SoC >> to external codecs, when clk_set_rate(..., 0) reaches the BPMP firmware, it >> raises a fault for rates below the hardware minimum. Fixing this per-codec >> would require individual patches for each. > > Since in the clock API clk_get_rate() maps onto clk_disable() those > drivers ought to be fixed anyway - perhaps we need some helpers for this > since it does look like we have some issues here. Either the driver > should ignore the disable (possibly due to already refcounting the use > of the clock and disabling/enabling without machine driver help) or it > should translate a rate of 0 to a disable. Since this needs to be handled in the codec driver, I will start with separate patch to fix in RT5640 codec. Adding Realtek codec maintainer for visibility. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] ASoC: tegra: enable ignore_zero_sysclk for Tegra 2026-03-17 9:49 [PATCH 0/2] ASoC: Add flag to ignore 0Hz sysclk requests Sheetal 2026-03-17 9:49 ` [PATCH 1/2] ASoC: simple-card-utils: add ignore_zero_sysclk flag Sheetal @ 2026-03-17 9:49 ` Sheetal 1 sibling, 0 replies; 8+ messages in thread From: Sheetal @ 2026-03-17 9:49 UTC (permalink / raw) To: Mark Brown, Kuninori Morimoto, Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Thierry Reding, Jonathan Hunter Cc: Mohan Kumar, linux-sound, linux-kernel, linux-tegra, Sheetal Tegra AUD_MCLK has a minimum allowed clock frequency of 1.5MHz, but 0Hz requests cause the system to set a lower rate than this minimum, resulting in the following errors from the Tegra Boot and Power Management Processor (BPMP) that configures the clocks: verify_rate_range: FMON_AUD_MCLK: rate 383999 below min 1500000 fmon_update_config: FMON_AUD_MCLK: detected fault 0x80 Enable the ignore_zero_sysclk flag for Tegra audio graph card to ignore these 0Hz sysclk requests during stream shutdown. Signed-off-by: Sheetal <sheetal@nvidia.com> --- sound/soc/tegra/tegra_audio_graph_card.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/tegra/tegra_audio_graph_card.c b/sound/soc/tegra/tegra_audio_graph_card.c index ea10e6e8a9fe..3c88c43e1273 100644 --- a/sound/soc/tegra/tegra_audio_graph_card.c +++ b/sound/soc/tegra/tegra_audio_graph_card.c @@ -209,6 +209,7 @@ static int tegra_audio_graph_probe(struct platform_device *pdev) card->component_chaining = 1; priv->simple.ops = &tegra_audio_graph_ops; priv->simple.force_dpcm = 1; + priv->simple.ignore_zero_sysclk = 1; return audio_graph_parse_of(&priv->simple, dev); } -- 2.17.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-03-25 5:27 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-03-17 9:49 [PATCH 0/2] ASoC: Add flag to ignore 0Hz sysclk requests Sheetal 2026-03-17 9:49 ` [PATCH 1/2] ASoC: simple-card-utils: add ignore_zero_sysclk flag Sheetal 2026-03-17 13:39 ` Mark Brown 2026-03-17 23:02 ` Kuninori Morimoto 2026-03-18 9:06 ` Sheetal . 2026-03-18 11:56 ` Mark Brown 2026-03-25 5:27 ` Sheetal . 2026-03-17 9:49 ` [PATCH 2/2] ASoC: tegra: enable ignore_zero_sysclk for Tegra Sheetal
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox