Re: [PATCH 3/4] ASoC: xlnx: formatter: set a 64-bit DMA mask

From: Mark Brown

Date: Thu Nov 26 2026 - 12:52:23 EST


> hw_params splits the ring buffer address over the LSB and MSB buffer
> address registers, but the device is left on the default 32-bit mask.
> The coherent buffer therefore always comes from below 4G and the MSB
> register is only ever written as zero.
>
> Set a 64-bit mask so the buffer can sit in high memory as well.
>
> Signed-off-by: Dhanunjanrao Katta <katta.dhanunjanrao@xxxxxxx>
> ---
> sound/soc/xilinx/xlnx_formatter_pcm.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/sound/soc/xilinx/xlnx_formatter_pcm.c b/sound/soc/xilinx/xlnx_formatter_pcm.c
> index fa7419439ec7..57901c9466a0 100644
> --- a/sound/soc/xilinx/xlnx_formatter_pcm.c
> +++ b/sound/soc/xilinx/xlnx_formatter_pcm.c
> @@ -8,6 +8,7 @@
>
> #include <linux/bitfield.h>
> #include <linux/clk.h>
> +#include <linux/dma-mapping.h>
> #include <linux/io.h>
> #include <linux/module.h>
> #include <linux/sizes.h>
> @@ -598,6 +599,11 @@ static int xlnx_formatter_pcm_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> struct clk *axi_clk, *aud_mclk, *axis_clk;
>
> + ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));

Is this always safe, can we have instances restricted to 32 bits?

--
Mark Brown <broonie@xxxxxxxxxx>