[PATCH v2 0/12] ASoC: Use devm_of_reserved_mem_device_init()

Mukesh Ojha posted 12 patches 3 weeks, 2 days ago
sound/soc/mediatek/mt8192/mt8192-afe-pcm.c | 11 +----------
sound/soc/mediatek/mt8196/mt8196-afe-pcm.c | 14 ++------------
sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 13 +------------
sound/soc/mediatek/mt8189/mt8189-afe-pcm.c | 16 ++--------------
sound/hda/controllers/cix-ipbloq.c         |  2 +-
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c |  2 +-
sound/soc/mediatek/mt8186/mt8186-afe-pcm.c |  2 +-
sound/soc/mediatek/mt8188/mt8188-afe-pcm.c |  2 +-
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c |  2 +-
sound/soc/sof/mediatek/mt8186/mt8186.c     |  2 +-
sound/soc/sof/mediatek/mt8195/mt8195.c     |  2 +-
sound/soc/sprd/sprd-pcm-dma.c             |  3 +--
12 files changed, 12 insertions(+), 71 deletions(-)
[PATCH v2 0/12] ASoC: Use devm_of_reserved_mem_device_init()
Posted by Mukesh Ojha 3 weeks, 2 days ago
Several ASoC drivers manually manage reserved memory lifetime by calling
of_reserved_mem_device_init() in probe and of_reserved_mem_device_release()
in remove. This pattern is fragile: any error path between the two that
skips the release leaks the reserved memory region for the lifetime of the
driver.

devm_of_reserved_mem_device_init() was recently introduced to tie the
release to the device's devres lifetime automatically. Convert the affected
ASoC drivers to use it, removing the manual release calls and any wrapper
devres actions.

Changes since v1: https://lore.kernel.org/lkml/20260703193855.110619-2-mukesh.ojha@oss.qualcomm.com/
 - Carried review tag.
 - Rebased it.

Mukesh Ojha (12):
  ASoC: mediatek: mt8192: Use devm_of_reserved_mem_device_init()
  ASoC: mediatek: mt8196: Use devm_of_reserved_mem_device_init()
  ASoC: mediatek: mt8183: Use devm_of_reserved_mem_device_init()
  ASoC: mediatek: mt8189: Use devm_of_reserved_mem_device_init()
  ASoC: cix-ipbloq: Use devm_of_reserved_mem_device_init()
  ASoC: mediatek: mt8173: Use devm_of_reserved_mem_device_init()
  ASoC: mediatek: mt8186: Use devm_of_reserved_mem_device_init()
  ASoC: mediatek: mt8188: Use devm_of_reserved_mem_device_init()
  ASoC: mediatek: mt8195: Use devm_of_reserved_mem_device_init()
  ASoC: SOF: mediatek: mt8186: Use devm_of_reserved_mem_device_init()
  ASoC: SOF: mediatek: mt8195: Use devm_of_reserved_mem_device_init()
  ASoC: sprd: Use devm_of_reserved_mem_device_init()

 sound/soc/mediatek/mt8192/mt8192-afe-pcm.c | 11 +----------
 sound/soc/mediatek/mt8196/mt8196-afe-pcm.c | 14 ++------------
 sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 13 +------------
 sound/soc/mediatek/mt8189/mt8189-afe-pcm.c | 16 ++--------------
 sound/hda/controllers/cix-ipbloq.c         |  2 +-
 sound/soc/mediatek/mt8173/mt8173-afe-pcm.c |  2 +-
 sound/soc/mediatek/mt8186/mt8186-afe-pcm.c |  2 +-
 sound/soc/mediatek/mt8188/mt8188-afe-pcm.c |  2 +-
 sound/soc/mediatek/mt8195/mt8195-afe-pcm.c |  2 +-
 sound/soc/sof/mediatek/mt8186/mt8186.c     |  2 +-
 sound/soc/sof/mediatek/mt8195/mt8195.c     |  2 +-
 sound/soc/sprd/sprd-pcm-dma.c             |  3 +--
 12 files changed, 12 insertions(+), 71 deletions(-)

--
2.34.1
Re: (subset) [PATCH v2 0/12] ASoC: Use devm_of_reserved_mem_device_init()
Posted by Mark Brown 1 week, 4 days ago
On Thu, 03 Sep 2026 01:17:00 +0530, Mukesh Ojha wrote:
> ASoC: Use devm_of_reserved_mem_device_init()
> 
> Several ASoC drivers manually manage reserved memory lifetime by calling
> of_reserved_mem_device_init() in probe and of_reserved_mem_device_release()
> in remove. This pattern is fragile: any error path between the two that
> skips the release leaks the reserved memory region for the lifetime of the
> driver.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4

Thanks!

[01/12] ASoC: mediatek: mt8192: Use devm_of_reserved_mem_device_init()
        https://git.kernel.org/broonie/sound/c/14318426e2c0
[02/12] ASoC: mediatek: mt8196: Use devm_of_reserved_mem_device_init()
        https://git.kernel.org/broonie/sound/c/68cd0442f674
[03/12] ASoC: mediatek: mt8183: Use devm_of_reserved_mem_device_init()
        https://git.kernel.org/broonie/sound/c/573d1749fcb3
[04/12] ASoC: mediatek: mt8189: Use devm_of_reserved_mem_device_init()
        https://git.kernel.org/broonie/sound/c/34dbfae252c2
[06/12] ASoC: mediatek: mt8173: Use devm_of_reserved_mem_device_init()
        https://git.kernel.org/broonie/sound/c/f33929d53089
[07/12] ASoC: mediatek: mt8186: Use devm_of_reserved_mem_device_init()
        https://git.kernel.org/broonie/sound/c/55be77e8a5fb
[08/12] ASoC: mediatek: mt8188: Use devm_of_reserved_mem_device_init()
        https://git.kernel.org/broonie/sound/c/3167f3ca6c77
[09/12] ASoC: mediatek: mt8195: Use devm_of_reserved_mem_device_init()
        https://git.kernel.org/broonie/sound/c/4169b6a5cdd3
[10/12] ASoC: SOF: mediatek: mt8186: Use devm_of_reserved_mem_device_init()
        https://git.kernel.org/broonie/sound/c/6b006d357f03
[11/12] ASoC: SOF: mediatek: mt8195: Use devm_of_reserved_mem_device_init()
        https://git.kernel.org/broonie/sound/c/3531143e9cec
[12/12] ASoC: sprd: Use devm_of_reserved_mem_device_init()
        https://git.kernel.org/broonie/sound/c/e88fd9fe81d7

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