Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp900144ybt; Fri, 10 Jul 2020 15:38:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQIOD793jhifzYmZqOHfDRpnY3BBHwM/TIKePmndDs+Lvj67sk/PHCX1CSBIu8wT5swptt X-Received: by 2002:a17:906:a0c8:: with SMTP id bh8mr65833911ejb.190.1594420704615; Fri, 10 Jul 2020 15:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594420704; cv=none; d=google.com; s=arc-20160816; b=zzETPHHy6pfNS/QM/FnXGkrQ8KsCxCSED7P+IvRaNrdH7uk+0mebYpeSpUlicPPmWJ Ij+UW3nOLZPMDntU0mrrXGVrE8mOpZZ2oj8U9gTca59xJivVXGW1hhE89bR6DxqHP+TS OGMBZvMN/aFIZeSmpbYXke7q81MRltbFJ2towzNPGbNh5lpY+zA7QM3eNJnMSnSiBdPc UBVQYfSV1THObVii1HBs1RFG5DiQbcOqLDRU00qTaZGyU6ThQPYiaNw6jPYACcHP6AfY T8OT6UTBmt59imdX4YwPhX3KRfKJH6Iwia/Tz0XosvPL22a35wsanvFJDpg2eh14tpOk 5X6w== 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=nqesRR03/6G8Uj3HDWvM8dC6sSsGpJU0HxysSKcfjsQ=; b=N8S7BG0v0QP4oMJ8wMkfFuylDwc7K8dPA20Nqo6EFEEvMPjReLWqXbl0Js8EHuCE0T Ei6apomD5w/EnwY/ONkZYsDiFyLYpg6A3sjZEBsQZj6+eGnCfclj5fZYWn4GWzkFNUzA Rfb1rP6n3Jexb9gPFWecN2ujJJu0TvQuxg6DoL6dYqs27LkySxSO2X7iwjFYx1x+DbFv S8cxznspAP1u6rq5gFx+jpSKzkv9nfy9K5Uz+f8ra4QbOCBzQT3EaqU42bxk2M8JNEf8 hxUpnuFieglzabYT0lvN8ABRZXffqEEuf3xCXDPPRt4d08/BXCtBIafpjOUPRfhuNVQl pqHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IEfN+YoO; 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 j18si5105527edp.389.2020.07.10.15.38.01; Fri, 10 Jul 2020 15:38:24 -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=IEfN+YoO; 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 S1726974AbgGJWez (ORCPT + 99 others); Fri, 10 Jul 2020 18:34:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:45966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726769AbgGJWec (ORCPT ); Fri, 10 Jul 2020 18:34:32 -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 5D3BB2088E; Fri, 10 Jul 2020 22:34:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594420471; bh=Vs0xqtsJWIWR1q7n2x/kejMEtvYSj5EpVIj/uSYTM10=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IEfN+YoOhvU0/hM8GDqS8n1h5AfhunMYm2GQc6siAJRM0SWOS7Hl7yZCXjRCpO/ev 3VLAOXEdk+xBD0On1LhX+YN09vwO5Hjl5QpGMH4phflyXdv0socTbjszzkegJEe48O WsYaPP0p6K8SyBbfj59+AuYV6o64CD7Qi3gLt+Jc= 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 05/11] swiotlb-xen: add struct device * parameter to xen_dma_sync_for_cpu Date: Fri, 10 Jul 2020 15:34:21 -0700 Message-Id: <20200710223427.6897-5-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 --- arch/arm/xen/mm.c | 5 +++-- drivers/xen/swiotlb-xen.c | 4 ++-- include/xen/swiotlb-xen.h | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c index d40e9e5fc52b..1a00e8003c64 100644 --- a/arch/arm/xen/mm.c +++ b/arch/arm/xen/mm.c @@ -71,8 +71,9 @@ static void dma_cache_maint(dma_addr_t handle, size_t size, u32 op) * pfn_valid returns true the pages is local and we can use the native * dma-direct functions, otherwise we call the Xen specific version. */ -void xen_dma_sync_for_cpu(dma_addr_t handle, phys_addr_t paddr, size_t size, - enum dma_data_direction dir) +void xen_dma_sync_for_cpu(struct device *dev, dma_addr_t handle, + phys_addr_t paddr, size_t size, + enum dma_data_direction dir) { if (pfn_valid(PFN_DOWN(handle))) arch_sync_dma_for_cpu(paddr, size, dir); diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index a8e447137faf..d04b7a15124f 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -428,7 +428,7 @@ static void xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, BUG_ON(dir == DMA_NONE); if (!dev_is_dma_coherent(hwdev) && !(attrs & DMA_ATTR_SKIP_CPU_SYNC)) - xen_dma_sync_for_cpu(dev_addr, paddr, size, dir); + xen_dma_sync_for_cpu(hwdev, dev_addr, paddr, size, dir); /* NOTE: We use dev_addr here, not paddr! */ if (is_xen_swiotlb_buffer(dev_addr)) @@ -442,7 +442,7 @@ xen_swiotlb_sync_single_for_cpu(struct device *dev, dma_addr_t 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); + xen_dma_sync_for_cpu(dev, dma_addr, paddr, size, dir); if (is_xen_swiotlb_buffer(dma_addr)) swiotlb_tbl_sync_single(dev, paddr, size, dir, SYNC_FOR_CPU); diff --git a/include/xen/swiotlb-xen.h b/include/xen/swiotlb-xen.h index ffc0d3902b71..f62d1854780b 100644 --- a/include/xen/swiotlb-xen.h +++ b/include/xen/swiotlb-xen.h @@ -4,8 +4,9 @@ #include -void xen_dma_sync_for_cpu(dma_addr_t handle, phys_addr_t paddr, size_t size, - enum dma_data_direction dir); +void xen_dma_sync_for_cpu(struct device *dev, dma_addr_t handle, + phys_addr_t paddr, size_t size, + enum dma_data_direction dir); void xen_dma_sync_for_device(dma_addr_t handle, phys_addr_t paddr, size_t size, enum dma_data_direction dir); -- 2.17.1