Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3862342pxj; Tue, 15 Jun 2021 10:12:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSFL3Kkmg0iz1HekkJVi4Y/+O6WTDucJhctZYsM04sR8F0HAGrFQ1nE9vndr0Nfc657k7M X-Received: by 2002:a17:906:f9d1:: with SMTP id lj17mr596536ejb.345.1623777139664; Tue, 15 Jun 2021 10:12:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623777139; cv=none; d=google.com; s=arc-20160816; b=lR0ToaNRTIP10QmWYOznRScvVAICWX95NOLjx8RBgpkuKKK3FiAe6MZM7p2SqML/Gh G0gxBKRB+zh4Ov9mUOncunUkpt8+31paRQD8dQ5dsMgirsq5X0QxsuxqpvNIbH1ZWR59 9nNvVe2FMc3dF/O390dsAQ9IZnWSX8KQ2rRZti3qRaeCT+YTcCHgiRjTlhTv+S7nPls/ u7Uft1FDjUT71NFZJhyRLQJ8SUE3yC2/Wb02gtIlkxmaKviZJz/peAY9kcrzFi1JoGg0 fCLae30znD8Wb/ctFMIv/oPnwrb8PzUGttvDQb/ZSON2GCXFC0Z+JibnkCX96gaq+DPo aV/Q== 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:dkim-signature; bh=0vcU4jqL0G8cdbbaQMPrBMeNEb80wCaWAyjq7Mo3xGo=; b=mpD0k3pCiv2HokfJFZqefXNZumXqu0FlN7k4Zudg4GQyM+67+o288sgv8ttbrVEUVQ 6BxuzWUL4pk+CaSXNkxJJiigouKnXHAcqlw000MjB6yjrgWHYQBr7Q+ae3ayO7iX8uVv XJg3YNHvmAz3wOjag591YcjXrE5j/CvTWUTasrapbAfp64ubGOwZnxUQV0U9ZqsFSoNL ggHl/dc+dsWDRLDHpm3kyYixU77808+ewX/fQ4ce56uNc5tNr6wIf2xh0jCddVfmiX+k Yup5ZzvCuzlnwu8KgGdmBLhjjrhY1Ne3hsnmEFhl8Gh+Hla/MP5W61Jni/qHVJBKvTXi 6ROA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@quicinc.com header.s=qcdkim header.b=UUPzBm5N; 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=fail (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r12si14817327edo.370.2021.06.15.10.11.56; Tue, 15 Jun 2021 10:12:19 -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=fail header.i=@quicinc.com header.s=qcdkim header.b=UUPzBm5N; 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=fail (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231709AbhFORLm (ORCPT + 99 others); Tue, 15 Jun 2021 13:11:42 -0400 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:34909 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231282AbhFORK7 (ORCPT ); Tue, 15 Jun 2021 13:10:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1623776935; x=1655312935; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=BYgsDpGVXiNQKbjx1zEY4QnnueERRkwQ3EUBgFLcp1s=; b=UUPzBm5N8rWnw4/CdC4hrHZuWGlTwKjrbEA9bQJPXMKaPkeO/uD3lIgJ O2vk6w4HqiSJB5e0kmtNZxhI3mAAJC96wIH/OzPHSZCW2G90TEzIlw8/O fEhUGoKx7jNSf6TfnZO8KWTzI9wJOn7viL4CVBfWjlUdabE7Pd0BywUpT E=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-02.qualcomm.com with ESMTP; 15 Jun 2021 10:08:54 -0700 X-QCInternal: smtphost Received: from nasanexm03e.na.qualcomm.com ([10.85.0.48]) by ironmsg03-sd.qualcomm.com with ESMTP/TLS/AES256-SHA; 15 Jun 2021 10:08:54 -0700 Received: from th-lint-040.qualcomm.com (10.80.80.8) by nasanexm03e.na.qualcomm.com (10.85.0.48) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 15 Jun 2021 10:08:54 -0700 From: Georgi Djakov To: , CC: , , , , , , , Subject: [PATCH v6 15/15] iommu/arm-smmu: Implement the map_pages() IOMMU driver callback Date: Tue, 15 Jun 2021 10:08:33 -0700 Message-ID: <1623776913-390160-16-git-send-email-quic_c_gdjako@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1623776913-390160-1-git-send-email-quic_c_gdjako@quicinc.com> References: <1623776913-390160-1-git-send-email-quic_c_gdjako@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanexm03e.na.qualcomm.com (10.85.0.48) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Isaac J. Manjarres" Implement the map_pages() callback for the ARM SMMU driver to allow calls from iommu_map to map multiple pages of the same size in one call. Also, remove the map() callback for the ARM SMMU driver, as it will no longer be used. Signed-off-by: Isaac J. Manjarres Suggested-by: Will Deacon Signed-off-by: Georgi Djakov --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index 593a15cfa8d5..c1ca3b49a620 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -1193,8 +1193,9 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev) return ret; } -static int arm_smmu_map(struct iommu_domain *domain, unsigned long iova, - phys_addr_t paddr, size_t size, int prot, gfp_t gfp) +static int arm_smmu_map_pages(struct iommu_domain *domain, unsigned long iova, + phys_addr_t paddr, size_t pgsize, size_t pgcount, + int prot, gfp_t gfp, size_t *mapped) { struct io_pgtable_ops *ops = to_smmu_domain(domain)->pgtbl_ops; struct arm_smmu_device *smmu = to_smmu_domain(domain)->smmu; @@ -1204,7 +1205,7 @@ static int arm_smmu_map(struct iommu_domain *domain, unsigned long iova, return -ENODEV; arm_smmu_rpm_get(smmu); - ret = ops->map(ops, iova, paddr, size, prot, gfp); + ret = ops->map_pages(ops, iova, paddr, pgsize, pgcount, prot, gfp, mapped); arm_smmu_rpm_put(smmu); return ret; @@ -1574,7 +1575,7 @@ static struct iommu_ops arm_smmu_ops = { .domain_alloc = arm_smmu_domain_alloc, .domain_free = arm_smmu_domain_free, .attach_dev = arm_smmu_attach_dev, - .map = arm_smmu_map, + .map_pages = arm_smmu_map_pages, .unmap_pages = arm_smmu_unmap_pages, .flush_iotlb_all = arm_smmu_flush_iotlb_all, .iotlb_sync = arm_smmu_iotlb_sync,