From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFF895F54E; Tue, 13 Feb 2024 17:26:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707845193; cv=none; b=cIlGHx24igjcBQBlGX/tHH/GBQiyvA2HphJ7rquhTToB/Q1cMiMgztsLC6zoG75E3V/Q5K840Nf3sNVsClpime6TzjvkJIO8Vktqyx+vkmz2nHIm5uNn/b+So699lFDMjn0kxCusDqKceKZ1WvoPCYc1dVV9QyBxCxnimWUQMTs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707845193; c=relaxed/simple; bh=dg0CObtt0ZxiKsn0Yu2iDi1Y4EbVOSMJF37kcPWBHio=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FJg3P/c2PoAuiRK9YyUetNhFRsvZMM7fFaT9g1+9AA95QWkU/N0FcA7LcUpAo0W9/nH0Z/7R9TjoqV7K+oUDW69UvucVOhmdyfXG2t0O1QdsOJ5uu1l3aaxqmUBbIcksp33M7F0BCdZAHx3ypc12pmjFzSkL1n+lx+8oT5ZEfkQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=d8JlKH7w; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="d8JlKH7w" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BFF7C433F1; Tue, 13 Feb 2024 17:26:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1707845193; bh=dg0CObtt0ZxiKsn0Yu2iDi1Y4EbVOSMJF37kcPWBHio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d8JlKH7w+5pWUisVXQ4zHRK/8R5h0AkuEYkD0WsXssOtXvI5MfGMP5xtszIGfmbFT umvgD0P3cyIli0DtwHxhBLSW+3cF9P6BQdHBdNQ30S7165fyL3GE14kVZdzJwMChV4 BmE0TDsd94XQoCfTHeQ12GoeszcIL71JigECiXDE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guanhua Gao , Frank Li , Vinod Koul , Sasha Levin Subject: [PATCH 6.6 002/121] dmaengine: fsl-dpaa2-qdma: Fix the size of dma pools Date: Tue, 13 Feb 2024 18:20:11 +0100 Message-ID: <20240213171853.023775762@linuxfoundation.org> X-Mailer: git-send-email 2.43.1 In-Reply-To: <20240213171852.948844634@linuxfoundation.org> References: <20240213171852.948844634@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guanhua Gao [ Upstream commit b73e43dcd7a8be26880ef8ff336053b29e79dbc5 ] 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: 7fdf9b05c73b ("dmaengine: fsl-dpaa2-qdma: Add NXP dpaa2 qDMA controller driver for Layerscape SoCs") Signed-off-by: Guanhua Gao Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20240118162917.2951450-1-Frank.Li@nxp.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c b/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c index a42a37634881..da91bc9a8e6f 100644 --- a/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c +++ b/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c @@ -38,15 +38,17 @@ static int dpaa2_qdma_alloc_chan_resources(struct dma_chan *chan) if (!dpaa2_chan->fd_pool) goto err; - dpaa2_chan->fl_pool = dma_pool_create("fl_pool", dev, - sizeof(struct dpaa2_fl_entry), - sizeof(struct dpaa2_fl_entry), 0); + dpaa2_chan->fl_pool = + dma_pool_create("fl_pool", dev, + sizeof(struct dpaa2_fl_entry) * 3, + sizeof(struct dpaa2_fl_entry), 0); + if (!dpaa2_chan->fl_pool) goto err_fd; dpaa2_chan->sdd_pool = dma_pool_create("sdd_pool", dev, - sizeof(struct dpaa2_qdma_sd_d), + sizeof(struct dpaa2_qdma_sd_d) * 2, sizeof(struct dpaa2_qdma_sd_d), 0); if (!dpaa2_chan->sdd_pool) goto err_fl; -- 2.43.0