MLK-14528: ASoC: sdma: Update period/segment max bytes
authorDaniel Baluta <daniel.baluta@nxp.com>
Fri, 5 May 2017 07:09:55 +0000 (10:09 +0300)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:22:11 +0000 (15:22 -0500)
Commit 665ced16cf044 ("MLK-10050 dma: imx-sdma: add support for sdma
memory copy") enforces maximum SDMA buffer descriptor length at 65532,
but doesn't update period_bytes_max or max_segment size in DMA drivers.

Thus, resulting in the following bug:

$ arecord -Dhw:0,0 -r 192000 -f S20_3LE -c 1 -d 10 audio192k20b1c.wav
imx-sdma: SDMA channel 5: maximum period size exceeded: 65534 > 65532

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
drivers/dma/imx-sdma.c
sound/soc/fsl/fsl_asrc_dma.c
sound/soc/fsl/imx-pcm-dma.c
sound/soc/fsl/imx-pcm-rpmsg.c

index ddf91a0..a8fc643 100644 (file)
@@ -2299,6 +2299,7 @@ static int sdma_probe(struct platform_device *pdev)
        sdma->dma_device.device_issue_pending = sdma_issue_pending;
        sdma->dma_device.dev->dma_parms = &sdma->dma_parms;
        sdma->dma_device.copy_align = 2;
+       dma_set_max_seg_size(sdma->dma_device.dev, SDMA_BD_MAX_CNT);
 
        platform_set_drvdata(pdev, sdma);
 
index ee3df1b..c5e3f09 100644 (file)
@@ -29,7 +29,7 @@ static struct snd_pcm_hardware snd_imx_hardware = {
                SNDRV_PCM_INFO_RESUME,
        .buffer_bytes_max = FSL_ASRC_DMABUF_SIZE,
        .period_bytes_min = 128,
-       .period_bytes_max = 65535, /* Limited by SDMA engine */
+       .period_bytes_max = 65532, /* Limited by SDMA engine */
        .periods_min = 2,
        .periods_max = 255,
        .fifo_size = 0,
index 1dbdbe6..89be19a 100644 (file)
@@ -42,7 +42,7 @@ static const struct snd_pcm_hardware imx_pcm_hardware = {
                SNDRV_PCM_INFO_RESUME,
        .buffer_bytes_max = IMX_DEFAULT_DMABUF_SIZE,
        .period_bytes_min = 128,
-       .period_bytes_max = 65535, /* Limited by SDMA engine */
+       .period_bytes_max = 65532, /* Limited by SDMA engine */
        .periods_min = 2,
        .periods_max = 255,
        .fifo_size = 0,
index e7d7244..45b71fd 100644 (file)
@@ -34,7 +34,7 @@ static const struct snd_pcm_hardware imx_rpmsg_pcm_hardware = {
                SNDRV_PCM_INFO_RESUME,
        .buffer_bytes_max = IMX_SAI_DMABUF_SIZE,
        .period_bytes_min = 512,
-       .period_bytes_max = 65535, /* Limited by SDMA engine */
+       .period_bytes_max = 65532, /* Limited by SDMA engine */
        .periods_min = 2,
        .periods_max = 255,
        .fifo_size = 0,