linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wu Hao <hao.wu@intel.com>
To: Scott Wood <swood@redhat.com>
Cc: Alan Tull <atull@kernel.org>, Moritz Fischer <mdf@kernel.org>,
	linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fpga: dfl: afu: Pass the correct device to dma_mapping_error()
Date: Thu, 11 Apr 2019 20:33:14 +0800	[thread overview]
Message-ID: <20190411123314.GA19198@hao-dev> (raw)
In-Reply-To: <20190410215327.8024-1-swood@redhat.com>

On Wed, Apr 10, 2019 at 04:53:27PM -0500, Scott Wood wrote:
> dma_mapping_error() was being called on a different device struct than
> what was passed to map/unmap.  Besides rendering the error checking
> ineffective, it caused a debug splat with CONFIG_DMA_API_DEBUG.
> 
> Signed-off-by: Scott Wood <swood@redhat.com>

Hi Scott,

Looks good to me. Thanks for catching this issue.

Acked-by: Wu Hao <hao.wu@intel.com>

Hao

> ---
>  drivers/fpga/dfl-afu-dma-region.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/fpga/dfl-afu-dma-region.c b/drivers/fpga/dfl-afu-dma-region.c
> index e18a786fc943..cd68002ac097 100644
> --- a/drivers/fpga/dfl-afu-dma-region.c
> +++ b/drivers/fpga/dfl-afu-dma-region.c
> @@ -399,7 +399,7 @@ int afu_dma_map_region(struct dfl_feature_platform_data *pdata,
>  				    region->pages[0], 0,
>  				    region->length,
>  				    DMA_BIDIRECTIONAL);
> -	if (dma_mapping_error(&pdata->dev->dev, region->iova)) {
> +	if (dma_mapping_error(dfl_fpga_pdata_to_parent(pdata), region->iova)) {
>  		dev_err(&pdata->dev->dev, "failed to map for dma\n");
>  		ret = -EFAULT;
>  		goto unpin_pages;
> -- 
> 1.8.3.1

  reply	other threads:[~2019-04-11 12:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-10 21:53 [PATCH] fpga: dfl: afu: Pass the correct device to dma_mapping_error() Scott Wood
2019-04-11 12:33 ` Wu Hao [this message]
2019-04-11 16:35   ` Moritz Fischer
2019-04-15 19:22     ` Alan Tull
2019-05-08 21:39       ` Scott Wood
2019-05-09  1:55         ` Moritz Fischer

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=20190411123314.GA19198@hao-dev \
    --to=hao.wu@intel.com \
    --cc=atull@kernel.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdf@kernel.org \
    --cc=swood@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).