Skip to content

Commit b73e43d

Browse files
Guanhua Gaovinodkoul
authored andcommitted
dmaengine: fsl-dpaa2-qdma: Fix the size of dma pools
In case of long format of qDMA command descriptor, there are one frame descriptor, three entries in the frame list and two data entries. So the size of dma_pool_create for these three fields should be the same with the total size of entries respectively, or the contents may be overwritten by the next allocated descriptor. Fixes: 7fdf9b0 ("dmaengine: fsl-dpaa2-qdma: Add NXP dpaa2 qDMA controller driver for Layerscape SoCs") Signed-off-by: Guanhua Gao <guanhua.gao@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240118162917.2951450-1-Frank.Li@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent e4cec07 commit b73e43d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,17 @@ static int dpaa2_qdma_alloc_chan_resources(struct dma_chan *chan)
3838
if (!dpaa2_chan->fd_pool)
3939
goto err;
4040

41-
dpaa2_chan->fl_pool = dma_pool_create("fl_pool", dev,
42-
sizeof(struct dpaa2_fl_entry),
43-
sizeof(struct dpaa2_fl_entry), 0);
41+
dpaa2_chan->fl_pool =
42+
dma_pool_create("fl_pool", dev,
43+
sizeof(struct dpaa2_fl_entry) * 3,
44+
sizeof(struct dpaa2_fl_entry), 0);
45+
4446
if (!dpaa2_chan->fl_pool)
4547
goto err_fd;
4648

4749
dpaa2_chan->sdd_pool =
4850
dma_pool_create("sdd_pool", dev,
49-
sizeof(struct dpaa2_qdma_sd_d),
51+
sizeof(struct dpaa2_qdma_sd_d) * 2,
5052
sizeof(struct dpaa2_qdma_sd_d), 0);
5153
if (!dpaa2_chan->sdd_pool)
5254
goto err_fl;

0 commit comments

Comments
 (0)