Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10051360ybi; Wed, 10 Jul 2019 22:34:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLXgD+zlZ2BWivU2m2qHUMDR6hxd4seOp5nT1ojn4A33GcyNjqJLjejoxJAcJlfKcl6DuM X-Received: by 2002:a17:90a:2506:: with SMTP id j6mr2718881pje.129.1562823286875; Wed, 10 Jul 2019 22:34:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562823286; cv=none; d=google.com; s=arc-20160816; b=iecagpd1/D6xftZu9q1HtxYH6SvFvnUp8ZPNRduOLVxmSVnvoC9T6H9un1LAEb7Vo0 qOXfAG2egVCxMLciS8GpohC3JtfIYD4IpMudll3xKjXwNo8Usuj9dk2SMhgbXSUTcGk2 vmjfCSXXczHG2sRgXnJEAOEJaQ2u23Rm9NsL0ti6cPALlM5rSg4G30pAod0DAgXuTOGm npMs05hUjsb69vccitV9HdgoEcfERR38hCxj4Kc1t8M6U7gvsGqC2KGUWQfvh0b7vqKE j67W5+SaUonSPxlBcyhjWFVN4EPD/b5owfY5+ljikGheqm1QO3HvzOKRlV5xkq5T/pp1 1sNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=RR6aNjMiXuFaNvyF8Gw7Jy4zQNZpNWuIq7QCaog4WT8=; b=cldDPqrFGvqk/rMSu3KsEfrd2namJncY4z938SlH+8GAaX9JmzdhyniETXkqGgWqKk RGHSbx6w/QkRRuxSv5RQtfertPgMJALaaF+4a3CI/O3PKB9z28kSw375J1udMHgex+ec wFNvE4uMZUCFFyUW8uquML3XfwDYha0rO6zwmejy/grVwGI+elKCw0/kSlCGVliKeklq Bu6sY8M9sGzOaWZfS2Yf/Gad1BTf0mupttdNiyfb7IoyoFINLRDTbd8HLevH1XGq0fKB 1bsoufwaDCCgK9TAAUhaznd4poevhKR9HKw9LKCoECcJLdY39Lwf1E29dd1xHQrBzCDk TJVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si4245625pjv.80.2019.07.10.22.34.30; Wed, 10 Jul 2019 22:34:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727846AbfGKFdx (ORCPT + 99 others); Thu, 11 Jul 2019 01:33:53 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:58882 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725963AbfGKFdw (ORCPT ); Thu, 11 Jul 2019 01:33:52 -0400 X-UUID: 327af44e836944e1adb3d59daca23acd-20190711 X-UUID: 327af44e836944e1adb3d59daca23acd-20190711 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1269385009; Thu, 11 Jul 2019 13:33:46 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 11 Jul 2019 13:33:44 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 11 Jul 2019 13:33:44 +0800 From: To: Christoph Hellwig , Marek Szyprowski , Robin Murphy CC: , , , , Miles Chen Subject: [PATCH] kernel/dma: export dma_alloc_from_contiguous to modules Date: Thu, 11 Jul 2019 13:33:43 +0800 Message-ID: <20190711053343.28873-1-miles.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miles Chen This change exports dma_alloc_from_contiguous and dma_release_from_contiguous to modules. Currently, we can add a reserve a memory node in dts files, make it a CMA memory by setting compatible = "shared-dma-pool", and setup the dev->cma_area by using of_reserved_mem_device_init_by_idx(). Export dma_alloc_from_contiguous and dma_release_from_contiguous, so we can allocate/free from/to dev->cma_area in kernel modules. Signed-off-by: Miles Chen --- kernel/dma/contiguous.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c index b2a87905846d..d5920bdedc77 100644 --- a/kernel/dma/contiguous.c +++ b/kernel/dma/contiguous.c @@ -197,6 +197,7 @@ struct page *dma_alloc_from_contiguous(struct device *dev, size_t count, return cma_alloc(dev_get_cma_area(dev), count, align, no_warn); } +EXPORT_SYMBOL_GPL(dma_alloc_from_contiguous); /** * dma_release_from_contiguous() - release allocated pages @@ -213,6 +214,7 @@ bool dma_release_from_contiguous(struct device *dev, struct page *pages, { return cma_release(dev_get_cma_area(dev), pages, count); } +EXPORT_SYMBOL_GPL(dma_release_from_contiguous); /* * Support for reserved memory regions defined in device tree -- 2.18.0