From patchwork Tue Dec 1 17:51:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minchan Kim X-Patchwork-Id: 11943439 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99FD2C64E7A for ; Tue, 1 Dec 2020 17:52:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 03DF321D46 for ; Tue, 1 Dec 2020 17:52:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Cc5oZnGf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03DF321D46 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 683946B0070; Tue, 1 Dec 2020 12:52:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 60DEB8D0002; Tue, 1 Dec 2020 12:52:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D6B78D0001; Tue, 1 Dec 2020 12:52:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0226.hostedemail.com [216.40.44.226]) by kanga.kvack.org (Postfix) with ESMTP id 3392A6B0070 for ; Tue, 1 Dec 2020 12:52:21 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E0AB3180AD837 for ; Tue, 1 Dec 2020 17:52:20 +0000 (UTC) X-FDA: 77545457640.29.ants14_4b0fdf6273ac Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 5974618085CF9 for ; Tue, 1 Dec 2020 17:51:58 +0000 (UTC) X-HE-Tag: ants14_4b0fdf6273ac X-Filterd-Recvd-Size: 6314 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Tue, 1 Dec 2020 17:51:57 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id m9so1620374pgb.4 for ; Tue, 01 Dec 2020 09:51:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4zRLtJ0Q5wi/JJXSMnqzlxIlA9XB0kWpvTg/hxCouGQ=; b=Cc5oZnGf3sYZSv66LApJ0Hgee277p8MonRA3s85p2F4XlF/n+VuGbl8fU1lW2bHbjK VFN0bZnO7OxxcK23RWuO/DPEq3TRvvtTcqhdlvHY2d4aNv295MZTZ7bP0WiGEjaTnNST 6dwK8wsxn5QoaHaqieK4GfYhbB6bKqHjaUnaNae7j8jIQJPFdW8cgPhBmCGdDlfGyWgB HkfsElLLP4bC+N3AQ7lBXPcGyLrKAmGUW5mJNOipjvY+6tty6wHAQ2pHxv8sdAjSNCuL 9s4EOkHKhk/10a9sYS4fOVfuSjatOufSFolSqFs5bDdbIaHPy588RglVWiRtg6LK+UyI dtow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4zRLtJ0Q5wi/JJXSMnqzlxIlA9XB0kWpvTg/hxCouGQ=; b=LvkGJ9Ffvwq/LOAEcd1lpw/phtREWXPRxZZXHWfVbomiNJfDYFgFAfv7CPhQzI2aj/ 7c4HtljVBc211SMrPosnSFevw/zbdSYTuEP7K/mnJG3hp6eDvLI5CNcERkltsiW1YdiQ REjhfdElhheC/25KSiFJykwkhmrkwu9xr0qAenyofCBUmKBtLTVdDWhAUi2i6R0bXD00 8AGRNRAeuCoNbda0CUzw+gqcFGER5in/5+LlnXiC8dqzew5aOTyx3/Lwg2gYHXsKueW4 7wtLiLRaQp21KG2pRVLVrAgD+tM+KH2Y2++p3iBafbSWDRYzbDMO+HoGT3qMotdkhJV3 H/pQ== X-Gm-Message-State: AOAM532Avvf/VOtx5bASaB3hEBwb/HRfp2XYM8yG3tiMReCgjYXfIy+h U0u+pp4QnlXAJj4N+9umfHI= X-Google-Smtp-Source: ABdhPJzGe4cpt+aeqFv9FnQFMR/FJjDiGsrboHIU1DKsNNU7bUw3lkcdAv3MMGBbgCOWuQDUV/UPeQ== X-Received: by 2002:a63:fb42:: with SMTP id w2mr3229528pgj.354.1606845116922; Tue, 01 Dec 2020 09:51:56 -0800 (PST) Received: from bbox-1.mtv.corp.google.com ([2620:15c:211:201:7220:84ff:fe09:5e58]) by smtp.gmail.com with ESMTPSA id q23sm390082pfg.192.2020.12.01.09.51.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 09:51:55 -0800 (PST) From: Minchan Kim To: Andrew Morton Cc: LKML , linux-mm , hyesoo.yu@samsung.com, willy@infradead.org, david@redhat.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, surenb@google.com, pullip.cho@samsung.com, joaodias@google.com, hridya@google.com, sumit.semwal@linaro.org, john.stultz@linaro.org, Brian.Starkey@arm.com, linux-media@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, christian.koenig@amd.com, linaro-mm-sig@lists.linaro.org, Minchan Kim Subject: [PATCH v2 3/4] dma-buf: add export symbol for dma-heap Date: Tue, 1 Dec 2020 09:51:43 -0800 Message-Id: <20201201175144.3996569-4-minchan@kernel.org> X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog In-Reply-To: <20201201175144.3996569-1-minchan@kernel.org> References: <20201201175144.3996569-1-minchan@kernel.org> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Hyesoo Yu The heaps could be added as module, so some functions should be exported to register dma-heaps. And dma-heap of module can use cma area to allocate and free. However the function related cma is not exported now. Let's export them for next patches. Signed-off-by: Hyesoo Yu Signed-off-by: Minchan Kim --- drivers/dma-buf/dma-heap.c | 2 ++ kernel/dma/contiguous.c | 1 + mm/cma.c | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index afd22c9dbdcf..cc6339cbca09 100644 --- a/drivers/dma-buf/dma-heap.c +++ b/drivers/dma-buf/dma-heap.c @@ -189,6 +189,7 @@ void *dma_heap_get_drvdata(struct dma_heap *heap) { return heap->priv; } +EXPORT_SYMBOL_GPL(dma_heap_get_drvdata); struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) { @@ -272,6 +273,7 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) kfree(heap); return err_ret; } +EXPORT_SYMBOL_GPL(dma_heap_add); static char *dma_heap_devnode(struct device *dev, umode_t *mode) { diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c index 3d63d91cba5c..7e9777119b29 100644 --- a/kernel/dma/contiguous.c +++ b/kernel/dma/contiguous.c @@ -58,6 +58,7 @@ #endif struct cma *dma_contiguous_default_area; +EXPORT_SYMBOL_GPL(dma_contiguous_default_area); /* * Default global CMA area size can be defined in kernel's .config. diff --git a/mm/cma.c b/mm/cma.c index 4459045fa717..d39cb7066b9e 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include "cma.h" @@ -54,6 +55,7 @@ const char *cma_get_name(const struct cma *cma) { return cma->name; } +EXPORT_SYMBOL_GPL(cma_get_name); static unsigned long cma_bitmap_aligned_mask(const struct cma *cma, unsigned int align_order) @@ -499,6 +501,7 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, pr_debug("%s(): returned %p\n", __func__, page); return page; } +EXPORT_SYMBOL_GPL(cma_alloc); /* * cma_alloc_bulk() - allocate high order bulk pages from contiguous area with @@ -609,6 +612,7 @@ int cma_alloc_bulk(struct cma *cma, unsigned int align, bool fast, return ret; } +EXPORT_SYMBOL_GPL(cma_alloc_bulk); /** * cma_release() - release allocated pages @@ -642,6 +646,7 @@ bool cma_release(struct cma *cma, const struct page *pages, unsigned int count) return true; } +EXPORT_SYMBOL_GPL(cma_release); int cma_for_each_area(int (*it)(struct cma *cma, void *data), void *data) {