From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk 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 Message-ID: <20131112144832.GC9435@phenom.dumpdata.com> References: <1384265520-6833-2-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1384265520-6833-2-git-send-email-stefano.stabellini@eu.citrix.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Stefano Stabellini Cc: konrad@kernel.org, xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org List-Id: xen-devel@lists.xenproject.org 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 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