Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp898724ybt; Fri, 10 Jul 2020 15:35:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpQWFHLe+rA0qMbE4elilNHhcuA7ERNP9Wr6iYTFoKxyS3/Tr7c866hYEN3uUx84bT328X X-Received: by 2002:a17:906:4a45:: with SMTP id a5mr61702146ejv.384.1594420522760; Fri, 10 Jul 2020 15:35:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594420522; cv=none; d=google.com; s=arc-20160816; b=jqUYn8hr1pn9+5XDwTOY334bMogCcuYhe1GT/VR8qpGIfZlqnvhVm+/e0+vifo5gDs eAW0AGNd9xnfeSbJWEoaPpGBA9Yl5+I7q/aCQeuMmSbI1dbN7K8MDjK+MAGsuEb8e8Rk HdxssJq8LNRjonxuZ1Oq1B+yi7efmiTf6UNZrxshxI13Pp/y8aPYPa2fvg+x3X40tFgk 2dA6AKEzVxSQ9UpkhvAq6CjALiTTXZsMo1Zv0ZiCr8R/FtqRVqN7Aor+5Wka1oog4G3N DJNOFWmPaRQubcobwXHdK/C0pNh78B+dtsM5nbTgr8oa1Ja/qUN1au5n3Eff1Km2FBJ4 HSTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=qQVoSmKSLKRAxl8UdNSXEN+5g8Rftt5N2+nkf1bXyy4=; b=n/EBBp1uTHvl9qx+eB09KO22nT2Ww9sdoRGjG+vZ51pTOg664HN+nLX9Mm26nDup1F d/2oR4sH4C2okVDozTjk0bLniVpKO8KOQkdSn0PyCY7MyaA5Y4YEdsH66iGsSFZ3icAO gwJfIHnWVlgGEKyVhcC/TRUrgLA1mJE2x0n4kaSAJk5W6ubdmLiXuJFZ5J2tt5yHF4M/ m9TMFgCo+pZ2pQsKadFJch1jPctWxU9GA2ijTaZf+TvAnH0J714obDgA7oCO7H5xeRsG GTi24vOCe6kww4o+2ObLTzF3XZntF2DAyEcnKx5QqrOEqMy16dcVncj5UWqn4YxwG+S/ zHRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dfehD7AQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a66si5977835edf.398.2020.07.10.15.34.59; Fri, 10 Jul 2020 15:35:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dfehD7AQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726819AbgGJWef (ORCPT + 99 others); Fri, 10 Jul 2020 18:34:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:45922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726605AbgGJWeb (ORCPT ); Fri, 10 Jul 2020 18:34:31 -0400 Received: from sstabellini-ThinkPad-T480s.hsd1.ca.comcast.net (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E05EB207DF; Fri, 10 Jul 2020 22:34:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594420471; bh=bb+w4hoTLC8vPpt7yxTmGZYiSiGXzA32wxBnynGozPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dfehD7AQAePQJ56EK6hgbwe6Jwhbv5sPi/IBt/TsLSyG92sE6vPwm14wGuknIP/2H 25o7wKQ8GkOj3BfJ8E/5wD43xNqd1FCQrIREXWBizXP8ULoa4DPax2k33qTPmalqFE O1pRR5dDyGC10CJw7PD2/p8IQZbpUzLXhgRqKjB0= From: Stefano Stabellini To: jgross@suse.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Cc: sstabellini@kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, hch@infradead.org, Stefano Stabellini Subject: [PATCH v3 04/11] swiotlb-xen: add struct device * parameter to xen_bus_to_phys Date: Fri, 10 Jul 2020 15:34:20 -0700 Message-Id: <20200710223427.6897-4-sstabellini@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefano Stabellini No functional changes. The parameter is unused in this patch but will be used by next patches. Signed-off-by: Stefano Stabellini Reviewed-by: Boris Ostrovsky Tested-by: Corey Minyard Tested-by: Roman Shaposhnik --- Changes in v3: - add whitespace in title - improve commit message --- drivers/xen/swiotlb-xen.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index dbe710a59bf2..a8e447137faf 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -67,7 +67,7 @@ static inline dma_addr_t xen_phys_to_bus(struct device *dev, phys_addr_t paddr) return dma; } -static inline phys_addr_t xen_bus_to_phys(dma_addr_t baddr) +static inline phys_addr_t xen_bus_to_phys(struct device *dev, dma_addr_t baddr) { unsigned long xen_pfn = bfn_to_pfn(XEN_PFN_DOWN(baddr)); dma_addr_t dma = (dma_addr_t)xen_pfn << XEN_PAGE_SHIFT; @@ -339,7 +339,7 @@ xen_swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr, /* do not use virt_to_phys because on ARM it doesn't return you the * physical address */ - phys = xen_bus_to_phys(dev_addr); + phys = xen_bus_to_phys(hwdev, dev_addr); /* Convert the size to actually allocated. */ size = 1UL << (order + XEN_PAGE_SHIFT); @@ -423,7 +423,7 @@ static dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page, static void xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, size_t size, enum dma_data_direction dir, unsigned long attrs) { - phys_addr_t paddr = xen_bus_to_phys(dev_addr); + phys_addr_t paddr = xen_bus_to_phys(hwdev, dev_addr); BUG_ON(dir == DMA_NONE); @@ -439,7 +439,7 @@ static void xen_swiotlb_sync_single_for_cpu(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction dir) { - phys_addr_t paddr = xen_bus_to_phys(dma_addr); + phys_addr_t paddr = xen_bus_to_phys(dev, dma_addr); if (!dev_is_dma_coherent(dev)) xen_dma_sync_for_cpu(dma_addr, paddr, size, dir); @@ -452,7 +452,7 @@ static void xen_swiotlb_sync_single_for_device(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction dir) { - phys_addr_t paddr = xen_bus_to_phys(dma_addr); + phys_addr_t paddr = xen_bus_to_phys(dev, dma_addr); if (is_xen_swiotlb_buffer(dma_addr)) swiotlb_tbl_sync_single(dev, paddr, size, dir, SYNC_FOR_DEVICE); -- 2.17.1