From patchwork Mon May 10 14:17:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 433154 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp2896362jao; Mon, 10 May 2021 07:27:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsUqDEtAd0MlpRYVCT2neSw9E+BA1cRgX7LvAwN29mNFPKrEf16s3Mxwys46FPGQSPZwmR X-Received: by 2002:a6b:c889:: with SMTP id y131mr18329478iof.196.1620656829551; Mon, 10 May 2021 07:27:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620656829; cv=none; d=google.com; s=arc-20160816; b=RY8C88VmVsrFAP2iMCAD950fEaMN3H9caqa7gFhudS29SaMm21P2sgeMPhgc14gcYG bEfikeqPYKHaEjmAPMwoglIuFBlTgcqU5X2Gqa3uqLJqi4D6F2UmeRXYnMjt/1PwS5GF mXe4CYpWBHgiahb+1JN98/pkmSCO0bGuUS0UWuN2uOfHiU60H/Phbr2V5SjZiKXPNdkv rhHXzdvfLPDxCHJaUbrwmKn5HbI0UNzdxjf7Fxtaih6gstXzE2FVL7+MtqP8U9fnE8ES tOcx5rYwpRjhMR0DdwWXkYkRPyslHF3FXUjvlmf0ptJNnXxTGSTNj8Yyiprb5EIKn+ya gd9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=5FO8BU/SJLLPHrlQDlrkMRWeR8rPI98kI3+U2DnClxM=; b=WtuTLVHZPTszX7j7a5zSWDdB9ir00evXHILiJy3jDaPA5Y3B7F1SSp6chqlyENxDfO 367diSkkPzHh41ZhlyFQoUAG9YdbXEEnlJ5sJzizEFWmkQrJ/TL/jYdCVTjl2MGA/fte zhqoRTJKJ3EsM7jjQ3XV8FgOGkMplEbXqwS+b8bVL+2i73iAZsJMdKT+tCAhSkNjpvnq KwDL2QKxoIh7UUD13H/bFT0hwKji2AonGjCjdGDrlsMuq0SFzfYPv4CYbGCXcaK4BHSM ifdhsqSqcD/e0N1vEx7ZIGA30qdPxkIxys5ni7P9SgazMXvqDKtQglbVIPwAAO2f4gJV oX+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a13si13610863ilr.121.2021.05.10.07.27.09 for ; Mon, 10 May 2021 07:27:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231623AbhEJO2I (ORCPT ); Mon, 10 May 2021 10:28:08 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2681 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238914AbhEJOZs (ORCPT ); Mon, 10 May 2021 10:25:48 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Ff39B5yJgz1BKwN; Mon, 10 May 2021 22:19:58 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.498.0; Mon, 10 May 2021 22:22:28 +0800 From: John Garry To: , , , , CC: , , , , , , John Garry Subject: [PATCH v2 14/15] dma-iommu: Add iommu_dma_set_opt_size() Date: Mon, 10 May 2021 22:17:28 +0800 Message-ID: <1620656249-68890-15-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1620656249-68890-1-git-send-email-john.garry@huawei.com> References: <1620656249-68890-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Add iommu_dma_set_opt_size(), which is a frontend for iommu_set_dev_dma_opt_size(). Signed-off-by: John Garry --- drivers/iommu/dma-iommu.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.26.2 diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 1d58c7a2d85d..fd62afe7c7d0 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -490,6 +490,11 @@ static dma_addr_t iommu_dma_alloc_iova(struct iommu_domain *domain, return (dma_addr_t)iova << shift; } +static int iommu_dma_set_opt_size(struct device *dev, size_t size) +{ + return iommu_set_dev_dma_opt_size(dev, size); +} + static void iommu_dma_free_iova(struct iommu_dma_cookie *cookie, dma_addr_t iova, size_t size, struct page *freelist) { @@ -1340,6 +1345,7 @@ static const struct dma_map_ops iommu_dma_ops = { .map_resource = iommu_dma_map_resource, .unmap_resource = iommu_dma_unmap_resource, .get_merge_boundary = iommu_dma_get_merge_boundary, + .set_max_opt_size = iommu_dma_set_opt_size, }; /*