From patchwork Tue Nov 12 14:12:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 3172851 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 57CC99F39E for ; Tue, 12 Nov 2013 14:15:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2793E204CF for ; Tue, 12 Nov 2013 14:15:31 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5E6152047B for ; Tue, 12 Nov 2013 14:15:26 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VgEjW-0007nK-9L; Tue, 12 Nov 2013 14:14:22 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VgEjB-00076G-Th; Tue, 12 Nov 2013 14:14:01 +0000 Received: from smtp02.citrix.com ([66.165.176.63]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VgEj2-00073J-3L for linux-arm-kernel@lists.infradead.org; Tue, 12 Nov 2013 14:13:52 +0000 X-IronPort-AV: E=Sophos;i="4.93,685,1378857600"; d="scan'208";a="71018578" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 12 Nov 2013 14:13:29 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.2.342.4; Tue, 12 Nov 2013 09:13:28 -0500 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1VgEiZ-0005kG-17; Tue, 12 Nov 2013 14:13:23 +0000 From: Stefano Stabellini To: Subject: [PATCH 2/2] swiotlb-xen: xen_swiotlb_map_page: do not error out if dma_capable fails Date: Tue, 12 Nov 2013 14:12:00 +0000 Message-ID: <1384265520-6833-2-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 X-DLP: MIA2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131112_091352_293039_C8F15326 X-CRM114-Status: UNSURE ( 9.86 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: konrad@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stefano Stabellini X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. 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. However the check would often fail even if the address is correct. Considering that we know that the swiotlb buffer has a low address, skip the check. Signed-off-by: Stefano Stabellini --- 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);