Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754149Ab3I0QgA (ORCPT ); Fri, 27 Sep 2013 12:36:00 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:46208 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753500Ab3I0Qfz (ORCPT ); Fri, 27 Sep 2013 12:35:55 -0400 X-IronPort-AV: E=Sophos;i="4.90,994,1371081600"; d="scan'208";a="55590962" From: Stefano Stabellini To: CC: , , , , , Stefano Stabellini Subject: [PATCH v6 15/19] swiotlb-xen: call dma_capable only if dev->dma_mask is allocated Date: Fri, 27 Sep 2013 17:10:03 +0100 Message-ID: <1380298207-29151-15-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1701 Lines: 44 Signed-off-by: Stefano Stabellini --- drivers/xen/swiotlb-xen.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 790c2eb..3011736 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -512,7 +512,7 @@ dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page, * buffering it. */ if (!xen_feature(XENFEAT_auto_translated_physmap) && - dma_capable(dev, dev_addr, size) && + dev->dma_mask && dma_capable(dev, dev_addr, size) && !range_straddles_page_boundary(phys, size) && !swiotlb_force) return dev_addr; @@ -532,7 +532,7 @@ dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page, /* * Ensure that the address returned is DMA'ble */ - if (!dma_capable(dev, dev_addr, size)) { + if (dev->dma_mask && !dma_capable(dev, dev_addr, size)) { swiotlb_tbl_unmap_single(dev, map, size, dir); dev_addr = 0; } @@ -660,7 +660,7 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, if (swiotlb_force || xen_feature(XENFEAT_auto_translated_physmap) || - !dma_capable(hwdev, dev_addr, sg->length) || + (hwdev->dma_mask && !dma_capable(hwdev, dev_addr, sg->length)) || range_straddles_page_boundary(paddr, sg->length)) { /* * Pass the dma_addr of the first slab in the iotlb buffer as -- 1.7.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/