From patchwork Mon Nov 10 16:13:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 40511 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 57563218DE for ; Mon, 10 Nov 2014 16:17:13 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id r20sf4319185wiv.6 for ; Mon, 10 Nov 2014 08:17:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=BQKsFJRrpma0ZtPNmNMvc58s2B3DzrAiC8ahPTWcC3U=; b=LrSRDPVKDpT1pfLL3lq3Fe2XZdeJ2PKewGldmjKEEhaHgH3zoq0GekMzaPh8pnn7Up fcr3aL8oOCnZ3qifIfgEqRGsRBuLlapbyh3hCTnIJYbuzKzGO4k/8FEHE3aQXEZAgaRC Z1w1pQbUIQ/iTMzwDBQO22gT2mV6TxTCTjoizQZXlysMTut8MDCxAGm9pGUJReeJAayv sTGxWY2E1ZXAYJrHEQw7DkXpaCccNdYZW4aOOQ1Q5dEWa7sHaRz+C3l2vGQqSv9nHOSG pZ3rzrE/AOy6xBD9wu8D7GmYVEsRtWhnkQDXUQzTLeysc1+G7SCyvCnFZk4rIeFort1g Cbfg== X-Gm-Message-State: ALoCoQmwFoMyKjMA/p+5U9iOzUaGAZ0wcFgmdaUhy/uQQHvqi6ooyD60B38YZPKH4A74C1P//K/M X-Received: by 10.112.119.194 with SMTP id kw2mr99435lbb.16.1415636232617; Mon, 10 Nov 2014 08:17:12 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.137 with SMTP id o9ls383619lal.17.gmail; Mon, 10 Nov 2014 08:17:12 -0800 (PST) X-Received: by 10.112.138.39 with SMTP id qn7mr30145497lbb.57.1415636232250; Mon, 10 Nov 2014 08:17:12 -0800 (PST) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id ua7si27534917lac.103.2014.11.10.08.17.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Nov 2014 08:17:12 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id n15so6175940lbi.18 for ; Mon, 10 Nov 2014 08:17:12 -0800 (PST) X-Received: by 10.152.6.228 with SMTP id e4mr30252147laa.71.1415636232154; Mon, 10 Nov 2014 08:17:12 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp116380lbc; Mon, 10 Nov 2014 08:17:11 -0800 (PST) X-Received: by 10.220.199.70 with SMTP id er6mr653822vcb.68.1415636230942; Mon, 10 Nov 2014 08:17:10 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id tq7si11008908vdc.5.2014.11.10.08.17.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 10 Nov 2014 08:17:10 -0800 (PST) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xnrce-0003Im-Sw; Mon, 10 Nov 2014 16:15:20 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XnrcY-0003En-6D for xen-devel@lists.xensource.com; Mon, 10 Nov 2014 16:15:14 +0000 Received: from [85.158.137.68] by server-1.bemta-3.messagelabs.com id BF/99-18267-194E0645; Mon, 10 Nov 2014 16:15:13 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1415636105!11487291!5 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.12.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 24618 invoked from network); 10 Nov 2014 16:15:12 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-15.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 10 Nov 2014 16:15:12 -0000 X-IronPort-AV: E=Sophos;i="5.07,353,1413244800"; d="scan'208";a="189798980" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Mon, 10 Nov 2014 11:14:23 -0500 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Xnrbe-0000Mx-0v; Mon, 10 Nov 2014 16:14:18 +0000 From: Stefano Stabellini To: Date: Mon, 10 Nov 2014 16:13:59 +0000 Message-ID: <1415636045-24669-7-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: MIA1 Cc: Ian.Campbell@citrix.com, Stefano Stabellini , catalin.marinas@arm.com, linux-kernel@vger.kernel.org, david.vrabel@citrix.com, linux-arm-kernel@lists.infradead.org Subject: [Xen-devel] [PATCH v8 07/13] xen: add a dma_addr_t dev_addr argument to xen_dma_map_page X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Signed-off-by: Stefano Stabellini CC: david.vrabel@citrix.com CC: konrad.wilk@oracle.com --- arch/arm/include/asm/xen/page-coherent.h | 4 ++-- arch/arm64/include/asm/xen/page-coherent.h | 4 ++-- arch/x86/include/asm/xen/page-coherent.h | 4 ++-- drivers/xen/swiotlb-xen.c | 6 ++++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/arch/arm/include/asm/xen/page-coherent.h b/arch/arm/include/asm/xen/page-coherent.h index d97b0b4..25d450c 100644 --- a/arch/arm/include/asm/xen/page-coherent.h +++ b/arch/arm/include/asm/xen/page-coherent.h @@ -29,8 +29,8 @@ static inline void xen_free_coherent_pages(struct device *hwdev, size_t size, } static inline void xen_dma_map_page(struct device *hwdev, struct page *page, - unsigned long offset, size_t size, enum dma_data_direction dir, - struct dma_attrs *attrs) + dma_addr_t dev_addr, unsigned long offset, size_t size, + enum dma_data_direction dir, struct dma_attrs *attrs) { __generic_dma_ops(hwdev)->map_page(hwdev, page, offset, size, dir, attrs); } diff --git a/arch/arm64/include/asm/xen/page-coherent.h b/arch/arm64/include/asm/xen/page-coherent.h index dde3fc9..d7cd4c2 100644 --- a/arch/arm64/include/asm/xen/page-coherent.h +++ b/arch/arm64/include/asm/xen/page-coherent.h @@ -20,8 +20,8 @@ static inline void xen_free_coherent_pages(struct device *hwdev, size_t size, } static inline void xen_dma_map_page(struct device *hwdev, struct page *page, - unsigned long offset, size_t size, enum dma_data_direction dir, - struct dma_attrs *attrs) + dma_addr_t dev_addr, unsigned long offset, size_t size, + enum dma_data_direction dir, struct dma_attrs *attrs) { } diff --git a/arch/x86/include/asm/xen/page-coherent.h b/arch/x86/include/asm/xen/page-coherent.h index 7f02fe4..acd844c 100644 --- a/arch/x86/include/asm/xen/page-coherent.h +++ b/arch/x86/include/asm/xen/page-coherent.h @@ -22,8 +22,8 @@ static inline void xen_free_coherent_pages(struct device *hwdev, size_t size, } static inline void xen_dma_map_page(struct device *hwdev, struct page *page, - unsigned long offset, size_t size, enum dma_data_direction dir, - struct dma_attrs *attrs) { } + dma_addr_t dev_addr, unsigned long offset, size_t size, + enum dma_data_direction dir, struct dma_attrs *attrs) { } static inline void xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle, size_t size, enum dma_data_direction dir, diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index ebd8f21..ad2c5eb 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -403,7 +403,7 @@ dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page, /* we are not interested in the dma_addr returned by * xen_dma_map_page, only in the potential cache flushes executed * by the function. */ - xen_dma_map_page(dev, page, offset, size, dir, attrs); + xen_dma_map_page(dev, page, dev_addr, offset, size, dir, attrs); return dev_addr; } @@ -417,7 +417,7 @@ dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page, return DMA_ERROR_CODE; xen_dma_map_page(dev, pfn_to_page(map >> PAGE_SHIFT), - map & ~PAGE_MASK, size, dir, attrs); + dev_addr, map & ~PAGE_MASK, size, dir, attrs); dev_addr = xen_phys_to_bus(map); /* @@ -574,6 +574,7 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, return 0; } xen_dma_map_page(hwdev, pfn_to_page(map >> PAGE_SHIFT), + dev_addr, map & ~PAGE_MASK, sg->length, dir, @@ -584,6 +585,7 @@ xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, * xen_dma_map_page, only in the potential cache flushes executed * by the function. */ xen_dma_map_page(hwdev, pfn_to_page(paddr >> PAGE_SHIFT), + dev_addr, paddr & ~PAGE_MASK, sg->length, dir,