diff mbox series

[RFC,v2] ASoC: soc-pcm: Optimize hw_params() BE DAI call

Message ID 20250408083022.3671283-1-sheetal@nvidia.com (mailing list archive)
State RFC
Headers show
Series [RFC,v2] ASoC: soc-pcm: Optimize hw_params() BE DAI call | expand

Commit Message

Sheetal . April 8, 2025, 8:30 a.m. UTC
From: Sheetal <sheetal@nvidia.com>

The hw_params() function for BE DAI was being called multiple times due
to an unnecessary SND_SOC_DPCM_STATE_HW_PARAMS state check.

Remove the redundant state check to ensure hw_params() is called only once
per BE DAI configuration.

Signed-off-by: Sheetal <sheetal@nvidia.com>
---
Changes in v2:
- Update commit message as its not a fix.
- Marked as RFC patch as it requires feedback from other users
  perspective as well.
- The patch is being sent separately as other patch is not RFC.

 sound/soc/soc-pcm.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Sheetal . April 8, 2025, 9:04 a.m. UTC | #1
Hi,

This patch should be a V1 and the "changes in v2" were based upon an 
initial internal review.

Please let me know if the change should be re-sent as V1.


On 08-04-2025 14:00, Sheetal . wrote:
> From: Sheetal <sheetal@nvidia.com>
>
> The hw_params() function for BE DAI was being called multiple times due
> to an unnecessary SND_SOC_DPCM_STATE_HW_PARAMS state check.
>
> Remove the redundant state check to ensure hw_params() is called only once
> per BE DAI configuration.
>
> Signed-off-by: Sheetal <sheetal@nvidia.com>
> ---
> Changes in v2:
> - Update commit message as its not a fix.
> - Marked as RFC patch as it requires feedback from other users
>    perspective as well.
> - The patch is being sent separately as other patch is not RFC.
>
>   sound/soc/soc-pcm.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
> index d7f6d3a6d312..c73be27c4ecb 100644
> --- a/sound/soc/soc-pcm.c
> +++ b/sound/soc/soc-pcm.c
> @@ -2123,7 +2123,6 @@ int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream)
>   			continue;
>   
>   		if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) &&
> -		    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) &&
>   		    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE))
>   			continue;
>
diff mbox series

Patch

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index d7f6d3a6d312..c73be27c4ecb 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2123,7 +2123,6 @@  int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream)
 			continue;
 
 		if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) &&
-		    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) &&
 		    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE))
 			continue;