]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: mediatek: use reserved memory or enable buffer pre-allocation
authorChen-Yu Tsai <wenst@chromium.org>
Thu, 12 Jun 2025 07:48:57 +0000 (15:48 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 12 Jun 2025 12:45:35 +0000 (13:45 +0100)
commitec4a10ca4a68ec97f12f4d17d7abb74db34987db
treef2388f02c4c7b608d0d018fbc1871ff29b288f5f
parentcd12d3a5ed10e3e3b323f2b2c652de1c8e17a750
ASoC: mediatek: use reserved memory or enable buffer pre-allocation

In commit 32c9c06adb5b ("ASoC: mediatek: disable buffer pre-allocation")
buffer pre-allocation was disabled to accommodate newer platforms that
have a limited reserved memory region for the audio frontend.

Turns out disabling pre-allocation across the board impacts platforms
that don't have this reserved memory region. Buffer allocation failures
have been observed on MT8173 and MT8183 based Chromebooks under low
memory conditions, which results in no audio playback for the user.

Since some MediaTek platforms already have dedicated reserved memory
pools for the audio frontend, the plan is to enable this for all of
them. This requires device tree changes. As a fallback, reinstate the
original policy of pre-allocating audio buffers at probe time of the
reserved memory pool cannot be found or used.

This patch covers the MT8173, MT8183, MT8186 and MT8192 platforms for
now, the reason being that existing MediaTek platform drivers that
supported reserved memory were all platforms that mainly supported
ChromeOS, and is also the set of devices that I can verify.

Fixes: 32c9c06adb5b ("ASoC: mediatek: disable buffer pre-allocation")
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Link: https://patch.msgid.link/20250612074901.4023253-7-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/common/mtk-afe-platform-driver.c
sound/soc/mediatek/common/mtk-base-afe.h
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
sound/soc/mediatek/mt8183/mt8183-afe-pcm.c
sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
sound/soc/mediatek/mt8192/mt8192-afe-pcm.c