Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp900242ybt; Fri, 10 Jul 2020 15:38:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfLmuVNFds/+NGX3mtTTrXFsBbN+rkhCX7woBA9OWje3o4nH4hPHQPXl1SBRWklthtsvcZ X-Received: by 2002:aa7:c442:: with SMTP id n2mr68848030edr.309.1594420717078; Fri, 10 Jul 2020 15:38:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594420717; cv=none; d=google.com; s=arc-20160816; b=H26x0peqqgjVfwCyKTxqqn+t43gldX363BO766I9co7CxlQlZNJhcBah2++MA81mf5 uM8yMeWufjFEbi6NLUxTwKG6axR2BuvLn73C/VLU91CHGkvbL4FvJQUaNLQWFwiCXjqy fXBfkoDB3ecfN9g3O/KeLUdegH/U9UxS4rFc+CR88IL57VlMrK+XDSqHXJQRuQey1RSV P6agFHVnmc0XRgY64WeFJO93AzeM853L6npgBLEf/zm2IAsg5f2/PJIhKDFSz8w/aoOu 2ScthdKCMPuVdMUGUbL52R0Si2RuE+sGljm+8roPrE7Kmz16ZSGeDwKl8LAILJptMOxk Uh5A== 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=8cwoObc3erygf6vSe+MsCQUKPaXkAc8q/wTwlNTXlCY=; b=Q7O2Jtb3Hbu40CfK3dNCqBcix83ktbp5hQjTXoN0uDw8dTb6g5cUhEHQPUUCVaQgxB hDlX2Za4e9HklpWMSaYZQL2hAGlyVuNKMkpwWJrXPOcpa42LQz1OYzA3bQ0uJ+Ohyb2U sLUe91HKCUnoTbLwjnJ14Jx73sXx575vbe+p6XWK9zKe2uE1mF+dVfJYVdZDGckK2FMb +MqH2ZaWshp/ApLFIam8kF0ew67mR0KxHNW8nbSg0bA57qbOUMJvHB0N8UxRzPvzal08 zZhC55YZ4W9Kma3ffNgLbnC40L405LI0QYDoWgB8EA+7mwkcaLLekFJPo+Tdlz1DC1uS O0YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LgBdVYBg; 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 b15si6841780edz.588.2020.07.10.15.38.13; Fri, 10 Jul 2020 15:38:37 -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=LgBdVYBg; 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 S1727006AbgGJWe6 (ORCPT + 99 others); Fri, 10 Jul 2020 18:34:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:45996 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726782AbgGJWec (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 3DB1E207FB; Fri, 10 Jul 2020 22:34:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594420472; bh=/MGI6bbpyfeW2PBoCKZ5Cz+tMk9tLtI9QoqYjLImzVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LgBdVYBgc9RgqvwP366WyyPlA8UgtCJ/fDBUVewj431Q3fqI3qEUCdwjfhqNZSC4q wQSN9eut6WxOj7lthfXxS+fEOCBgtpMtDbQokobURzuL/PwrI51K5viOHPCx9hRVP5 735P3IzlseBdexGGPHvpyrwV7szvunail7KEBR60= 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 07/11] swiotlb-xen: add struct device * parameter to is_xen_swiotlb_buffer Date: Fri, 10 Jul 2020 15:34:23 -0700 Message-Id: <20200710223427.6897-7-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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index 8a3a7bcc5ec0..e2c35f45f91e 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -97,7 +97,7 @@ static inline int range_straddles_page_boundary(phys_addr_t p, size_t size) return 0; } -static int is_xen_swiotlb_buffer(dma_addr_t dma_addr) +static int is_xen_swiotlb_buffer(struct device *dev, dma_addr_t dma_addr) { unsigned long bfn = XEN_PFN_DOWN(dma_addr); unsigned long xen_pfn = bfn_to_local_pfn(bfn); @@ -431,7 +431,7 @@ static void xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, 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)) + if (is_xen_swiotlb_buffer(hwdev, dev_addr)) swiotlb_tbl_unmap_single(hwdev, paddr, size, size, dir, attrs); } @@ -444,7 +444,7 @@ xen_swiotlb_sync_single_for_cpu(struct device *dev, dma_addr_t dma_addr, if (!dev_is_dma_coherent(dev)) xen_dma_sync_for_cpu(dev, dma_addr, paddr, size, dir); - if (is_xen_swiotlb_buffer(dma_addr)) + if (is_xen_swiotlb_buffer(dev, dma_addr)) swiotlb_tbl_sync_single(dev, paddr, size, dir, SYNC_FOR_CPU); } @@ -454,7 +454,7 @@ xen_swiotlb_sync_single_for_device(struct device *dev, dma_addr_t dma_addr, { phys_addr_t paddr = xen_bus_to_phys(dev, dma_addr); - if (is_xen_swiotlb_buffer(dma_addr)) + if (is_xen_swiotlb_buffer(dev, dma_addr)) swiotlb_tbl_sync_single(dev, paddr, size, dir, SYNC_FOR_DEVICE); if (!dev_is_dma_coherent(dev)) -- 2.17.1