* [PATCH] ASoC: simple-card-utils: fix PCM constraint error check
@ 2023-06-02 1:19 Robert Hancock
2023-06-02 17:10 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Robert Hancock @ 2023-06-02 1:19 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai, Robert Hancock
Cc: alsa-devel, linux-kernel
The code in asoc_simple_startup was treating any non-zero return from
snd_pcm_hw_constraint_minmax as an error, when this can return 1 in some
normal cases and only negative values indicate an error.
When this happened, it caused asoc_simple_startup to disable the clocks
it just enabled and return 1, which was not treated as an error by the
calling code which only checks for negative return values. Then when the
PCM is eventually shut down, it causes the clock framework to complain
about disabling clocks that were not enabled.
Fix the check for snd_pcm_hw_constraint_minmax return value to only
treat negative values as an error.
Fixes: 5ca2ab459817 ("ASoC: simple-card-utils: Add new system-clock-fixed flag")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
---
sound/soc/generic/simple-card-utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 467edd96eae5..e5ff61c1e9d1 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -314,7 +314,7 @@ int asoc_simple_startup(struct snd_pcm_substream *substream)
}
ret = snd_pcm_hw_constraint_minmax(substream->runtime, SNDRV_PCM_HW_PARAM_RATE,
fixed_rate, fixed_rate);
- if (ret)
+ if (ret < 0)
goto codec_err;
}
--
2.40.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] ASoC: simple-card-utils: fix PCM constraint error check
2023-06-02 1:19 [PATCH] ASoC: simple-card-utils: fix PCM constraint error check Robert Hancock
@ 2023-06-02 17:10 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2023-06-02 17:10 UTC (permalink / raw)
To: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Robert Hancock
Cc: alsa-devel, linux-kernel
On Thu, 01 Jun 2023 19:19:35 -0600, Robert Hancock wrote:
> The code in asoc_simple_startup was treating any non-zero return from
> snd_pcm_hw_constraint_minmax as an error, when this can return 1 in some
> normal cases and only negative values indicate an error.
>
> When this happened, it caused asoc_simple_startup to disable the clocks
> it just enabled and return 1, which was not treated as an error by the
> calling code which only checks for negative return values. Then when the
> PCM is eventually shut down, it causes the clock framework to complain
> about disabling clocks that were not enabled.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: simple-card-utils: fix PCM constraint error check
commit: 635071f5fee31550e921644b2becc42b3ff1036c
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] 2+ messages in thread
end of thread, other threads:[~2023-06-02 17:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02 1:19 [PATCH] ASoC: simple-card-utils: fix PCM constraint error check Robert Hancock
2023-06-02 17:10 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®