2023-05-11 12:13:28

by yixuanjiang

[permalink] [raw]
Subject: [PATCH 1/6] ASoC: soc-pcm: use GFP_ATOMIC for dpcm structure

From: Pierre-Louis Bossart <[email protected]>

[ Upstream commit d8a9c6e1f6766a16cf02b4e99a629f3c5512c183 ]

We allocate a structure in dpcm_be_connect(), which may be called in
atomic context. Using GFP_KERNEL is not quite right, we have to use
GFP_ATOMIC to prevent the allocator from sleeping.

Suggested-by: Guennadi Liakhovetski <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Kai Vehmanen <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Ranjani Sridharan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Fixes: aa9ff6a4955f ("ASoC: soc-compress: Reposition and add pcm_mutex")
Signed-off-by: Yixuan Jiang <[email protected]>
Cc: [email protected] # 5.15+
---
sound/soc/soc-pcm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 3b673477f6215..cffae9b7c2548 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1132,7 +1132,7 @@ static int dpcm_be_connect(struct snd_soc_pcm_runtime *fe,
return 0;
}

- dpcm = kzalloc(sizeof(struct snd_soc_dpcm), GFP_KERNEL);
+ dpcm = kzalloc(sizeof(struct snd_soc_dpcm), GFP_ATOMIC);
if (!dpcm)
return -ENOMEM;

--
2.40.1.521.gf1e218fcd8-goog



2023-05-11 23:39:47

by Sasha Levin

[permalink] [raw]
Subject: Re: [PATCH 1/6] ASoC: soc-pcm: use GFP_ATOMIC for dpcm structure

On Thu, May 11, 2023 at 08:08:36PM +0800, yixuanjiang wrote:
>From: Pierre-Louis Bossart <[email protected]>
>
>[ Upstream commit d8a9c6e1f6766a16cf02b4e99a629f3c5512c183 ]

Queued up, thanks!

--
Thanks,
Sasha