public inbox for dmaengine@vger.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Guanhua Gao <guanhua.gao@nxp.com>
Cc: Dan Williams <dan.j.williams@intel.com>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] dmaengine: fsl-dpaa2-qdma: Fix the size of dma pools
Date: Mon, 1 Feb 2021 15:30:59 +0530	[thread overview]
Message-ID: <20210201100059.GQ2771@vkoul-mobl> (raw)
In-Reply-To: <20201217092327.11473-1-guanhua.gao@nxp.com>

On 17-12-20, 17:23, Guanhua Gao wrote:
> 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.
> 
> Signed-off-by: Guanhua Gao <guanhua.gao@nxp.com>
> ---
>  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 4ec909e..bc5baa6 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);
> +

Can you add comments here as well (like you have for changelog above)
describing why we need 3 times dpaa2_fl_entry


>  	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.7.4

-- 
~Vinod

      reply	other threads:[~2021-02-01 10:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17  9:23 [PATCH 1/2] dmaengine: fsl-dpaa2-qdma: Fix the size of dma pools Guanhua Gao
2021-02-01 10:00 ` Vinod Koul [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210201100059.GQ2771@vkoul-mobl \
    --to=vkoul@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=guanhua.gao@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox