From patchwork Tue Nov 16 09:06:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yicong Yang X-Patchwork-Id: 12692715 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73AF8C433F5 for ; Tue, 16 Nov 2021 09:11:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4171A61A8D for ; Tue, 16 Nov 2021 09:11:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4171A61A8D Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=hisilicon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uEK+RXmDovASmBsdAq5AOp42nFns2ST7rTAJJUu9h3w=; b=UMAdxChLgr8emx rYV0c4S3VZpD9a+EJpMmO3ID04mpAuOYB1iMR2RDLBIL5OjjC02H9Q9FVlZbBxYxJrU3gOjFH504j 55K0IBihjoB4l/KsUkBFzMS53EO2s5qUp7BOfgR1zDMc+yuDGtJsuLpou7WmWZa4fafD+rR1vy9qn IG3DLMWaJIN7dd7Hep9Y9JjARGabk7NALq+3HK1EdOGbdELR9fS15NB3LfqQ4DHmmDNLvN3bH2288 V4dUkH5QsFcj7T6BI1brZd3+5DljmjGromaH4qcJhDo36JMR86dAIEQ4MWh5xltR/ACuWGFLTpu2n WqAH/3UtzXyt7FYpw1tg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mmuSx-000r63-V8; Tue, 16 Nov 2021 09:09:24 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mmuSs-000r1Z-CP for linux-arm-kernel@lists.infradead.org; Tue, 16 Nov 2021 09:09:20 +0000 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4HtgGT3hNbz918F; Tue, 16 Nov 2021 17:08:49 +0800 (CST) Received: from dggema772-chm.china.huawei.com (10.1.198.214) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.20; Tue, 16 Nov 2021 17:09:09 +0800 Received: from localhost.localdomain (10.67.165.2) by dggema772-chm.china.huawei.com (10.1.198.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.20; Tue, 16 Nov 2021 17:09:09 +0800 From: Yicong Yang To: , , , , , , , , , , , , , , , , , , , , CC: , , , , , Subject: [PATCH v2 1/6] iommu: Export iommu_{get,put}_resv_regions() Date: Tue, 16 Nov 2021 17:06:20 +0800 Message-ID: <20211116090625.53702-2-yangyicong@hisilicon.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211116090625.53702-1-yangyicong@hisilicon.com> References: <20211116090625.53702-1-yangyicong@hisilicon.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggema772-chm.china.huawei.com (10.1.198.214) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211116_010918_629231_359FFB04 X-CRM114-Status: UNSURE ( 9.47 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Export iommu_{get,put}_resv_regions() to the modules so that the driver can retrieve and use the reserved regions of the device. Signed-off-by: Yicong Yang Acked-by: Mathieu Poirier --- drivers/iommu/iommu.c | 2 ++ include/linux/iommu.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index dd7863e453a5..e96711eee965 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -2792,6 +2792,7 @@ void iommu_get_resv_regions(struct device *dev, struct list_head *list) if (ops && ops->get_resv_regions) ops->get_resv_regions(dev, list); } +EXPORT_SYMBOL_GPL(iommu_get_resv_regions); void iommu_put_resv_regions(struct device *dev, struct list_head *list) { @@ -2800,6 +2801,7 @@ void iommu_put_resv_regions(struct device *dev, struct list_head *list) if (ops && ops->put_resv_regions) ops->put_resv_regions(dev, list); } +EXPORT_SYMBOL_GPL(iommu_put_resv_regions); /** * generic_iommu_put_resv_regions - Reserved region driver helper diff --git a/include/linux/iommu.h b/include/linux/iommu.h index d2f3435e7d17..1b7b0f370e28 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -450,8 +450,8 @@ extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t io extern void iommu_set_fault_handler(struct iommu_domain *domain, iommu_fault_handler_t handler, void *token); -extern void iommu_get_resv_regions(struct device *dev, struct list_head *list); -extern void iommu_put_resv_regions(struct device *dev, struct list_head *list); +void iommu_get_resv_regions(struct device *dev, struct list_head *list); +void iommu_put_resv_regions(struct device *dev, struct list_head *list); extern void generic_iommu_put_resv_regions(struct device *dev, struct list_head *list); extern void iommu_set_default_passthrough(bool cmd_line);