linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xensource.com, konrad@kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [Xen-devel] [PATCH 2/2] swiotlb-xen: xen_swiotlb_map_page: do not error out if dma_capable fails
Date: Tue, 12 Nov 2013 09:48:32 -0500	[thread overview]
Message-ID: <20131112144832.GC9435@phenom.dumpdata.com> (raw)
In-Reply-To: <1384265520-6833-2-git-send-email-stefano.stabellini@eu.citrix.com>

On Tue, Nov 12, 2013 at 02:12:00PM +0000, Stefano Stabellini wrote:
> Many ARM devices do not set the dma_mask correctly today.
> As a consequence dma_capable fails for them regardless of the address
> passed to it.

Wouldn't the DMA API debug warn of bad usage.

> In xen_swiotlb_map_page we currently use dma_capable to check if the
> address returned by the swiotlb is good for dma for the device.

Right..
> However the check would often fail even if the address is correct.

 .. and they will fail b/c the device hasn't set its dma mask so
we use the platform default right? What is the platform default?

> Considering that we know that the swiotlb buffer has a low address,
> skip the check.

I am not following that sentence. Could you please explain to me
how the SWIOTLB buffer low address guarantees that we don't need
the check?
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

What are the drivers that are busted. Does DMA API debug flag them?

Thanks!
> ---
>  drivers/xen/swiotlb-xen.c |    7 -------
>  1 files changed, 0 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
> index 1eac073..543e30b 100644
> --- a/drivers/xen/swiotlb-xen.c
> +++ b/drivers/xen/swiotlb-xen.c
> @@ -402,13 +402,6 @@ dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page,
>  					map & ~PAGE_MASK, size, dir, attrs);
>  	dev_addr = xen_phys_to_bus(map);
>  
> -	/*
> -	 * Ensure that the address returned is DMA'ble
> -	 */
> -	if (!dma_capable(dev, dev_addr, size)) {
> -		swiotlb_tbl_unmap_single(dev, map, size, dir);
> -		dev_addr = 0;
> -	}
>  	return dev_addr;
>  }
>  EXPORT_SYMBOL_GPL(xen_swiotlb_map_page);
> -- 
> 1.7.2.5
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

  reply	other threads:[~2013-11-12 14:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-12 14:11 [PATCH 0/2] swiotlb-xen fixes Stefano Stabellini
2013-11-12 14:11 ` [PATCH 1/2] swiotlb-xen: add missing xen_dma_map_page call Stefano Stabellini
2013-11-12 14:45   ` [Xen-devel] " Konrad Rzeszutek Wilk
2013-11-12 17:03     ` Stefano Stabellini
2013-11-12 14:12 ` [PATCH 2/2] swiotlb-xen: xen_swiotlb_map_page: do not error out if dma_capable fails Stefano Stabellini
2013-11-12 14:48   ` Konrad Rzeszutek Wilk [this message]
2013-11-12 15:05     ` [Xen-devel] " Russell King - ARM Linux
2013-11-12 17:27     ` Stefano Stabellini
2013-11-12 20:22       ` Rob Herring
2013-11-13 11:35         ` Stefano Stabellini

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=20131112144832.GC9435@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=konrad@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.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).