Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp842193ybg; Wed, 3 Jun 2020 15:25:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDcP4uZobd2d1w3lkg9hShbfY9xoI66IcbgNzEd6Hpp9wYV8An7zFWd/+Cp2ygYtFi4kI1 X-Received: by 2002:aa7:c790:: with SMTP id n16mr1666919eds.54.1591223111343; Wed, 03 Jun 2020 15:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591223111; cv=none; d=google.com; s=arc-20160816; b=JRt1LUqXysyebVHu5vMceseQhS1cCjFe8E0B5zauENliHXtjjwh0JTw5H3J0eYwSfx oC6cz0Yz0eJVddXAgwceSzl1/p7fwaG/tmiBk7YMQ/gFvC0x56QYBB7hh4YDc6ugKgvo BoEWe9e1vNQ/CX8zOudFdDjr+CR954uejDZIz9a+QOKftfnuZlY6ZjzhNNM+cFrGxmX5 tDRzCUGXlUeh++S9FtKeOSoDIfaaKSmuN288NvERdlhOerPioF2EO88KdEKxPyB5lZuW zZstKBYi477cHnxXA/2bXLmokrKt3jvgQZJpaIDyKDeBK/j9eOsSte1nxCTl39aYYSlY 30Xw== 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=LL5IAnhyDU5Gat4DsgNWOZKKJSNYR0qj/ikAUZeOeTI=; b=0blyo/VgiqCdPvRclfXiAUfdlSMePsqresvkWWUvmQlY/bKP9flLfAEf5Cv+/N/3rF UnXIyDOFsbT2CobZPFcG+FWqSGpf4zOG6vTl3aLKnDZLCB3SmCL6i9AQFNk4XoykgUWm Pw22MR31MC3mA8XTi22tddiuqdhT+NHobm5wm9UQVj5hNgT1ILRjbQFnXDf8zV7RbZrq JimFTarxFd9xkAUYhsaK9qy2BtMxBIBTMnwV3M801tDhRwUUTlwrS4jzM0dXsB72bkcY j2N8mBL2eNRSykZkXLYltKNjLN837g2tMsrHlbo7TGiEyc5lVlgTwiZ5eN3leFi+hMLy vVSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Qfq6j7xR; 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 f6si527116eds.91.2020.06.03.15.24.45; Wed, 03 Jun 2020 15:25:11 -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=Qfq6j7xR; 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 S1726885AbgFCWWw (ORCPT + 99 others); Wed, 3 Jun 2020 18:22:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:56584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726861AbgFCWWv (ORCPT ); Wed, 3 Jun 2020 18:22:51 -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 DD192207ED; Wed, 3 Jun 2020 22:22:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591222970; bh=8roukE2cTqX3x3U/iL+TWs1iGe9wtzQx9xz7olDA5jo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qfq6j7xRVNuYFJciHIBfv0Hg3QKcp+rEpTkPApdVaF/0j83toOfu9Qb2RDayzq07g eWKPjP2zWTV/ifm1xQvO+4YmzvyVJYmqgiUwWnpxQitIuHoRSHJxXT/YY2jtK9kkWD 9g33HwxMV7DGdAnc5ryX5OYBot/+trzQbyHC4d8E= 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, tamas@tklengyel.com, roman@zededa.com, Stefano Stabellini Subject: [PATCH v2 03/11] swiotlb-xen: add struct device* parameter to xen_phys_to_bus Date: Wed, 3 Jun 2020 15:22:39 -0700 Message-Id: <20200603222247.11681-3-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 The parameter is unused in this patch. No functional changes. Signed-off-by: Stefano Stabellini Tested-by: Corey Minyard Tested-by: Roman Shaposhnik --- drivers/xen/swiotlb-xen.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index ed09f8ac34c5..1c44dbc69b70 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -57,7 +57,7 @@ static unsigned long xen_io_tlb_nslabs; * can be 32bit when dma_addr_t is 64bit leading to a loss in * information if the shift is done before casting to 64bit. */ -static inline dma_addr_t xen_phys_to_bus(phys_addr_t paddr) +static inline dma_addr_t xen_phys_to_bus(struct device *dev, phys_addr_t paddr) { unsigned long bfn = pfn_to_bfn(XEN_PFN_DOWN(paddr)); dma_addr_t dma = (dma_addr_t)bfn << XEN_PAGE_SHIFT; @@ -78,9 +78,9 @@ static inline phys_addr_t xen_bus_to_phys(dma_addr_t baddr) return paddr; } -static inline dma_addr_t xen_virt_to_bus(void *address) +static inline dma_addr_t xen_virt_to_bus(struct device *dev, void *address) { - return xen_phys_to_bus(virt_to_phys(address)); + return xen_phys_to_bus(dev, virt_to_phys(address)); } static inline int range_straddles_page_boundary(phys_addr_t p, size_t size) @@ -309,7 +309,7 @@ xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size, * Do not use virt_to_phys(ret) because on ARM it doesn't correspond * to *dma_handle. */ phys = *dma_handle; - dev_addr = xen_phys_to_bus(phys); + dev_addr = xen_phys_to_bus(hwdev, phys); if (((dev_addr + size - 1 <= dma_mask)) && !range_straddles_page_boundary(phys, size)) *dma_handle = dev_addr; @@ -367,7 +367,7 @@ static dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page, unsigned long attrs) { phys_addr_t map, phys = page_to_phys(page) + offset; - dma_addr_t dev_addr = xen_phys_to_bus(phys); + dma_addr_t dev_addr = xen_phys_to_bus(dev, phys); BUG_ON(dir == DMA_NONE); /* @@ -392,7 +392,7 @@ static dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page, return DMA_MAPPING_ERROR; phys = map; - dev_addr = xen_phys_to_bus(map); + dev_addr = xen_phys_to_bus(dev, map); /* * Ensure that the address returned is DMA'ble @@ -536,7 +536,7 @@ xen_swiotlb_sync_sg_for_device(struct device *dev, struct scatterlist *sgl, static int xen_swiotlb_dma_supported(struct device *hwdev, u64 mask) { - return xen_virt_to_bus(xen_io_tlb_end - 1) <= mask; + return xen_virt_to_bus(hwdev, xen_io_tlb_end - 1) <= mask; } const struct dma_map_ops xen_swiotlb_dma_ops = { -- 2.17.1