From: Shuosheng Huang <huangshuosheng@allwinnertech.com>
To: sumit.semwal@linaro.org, lmark@codeaurora.org,
labbott@redhat.com, Brian.Starkey@arm.com,
john.stultz@linaro.org, christian.koenig@amd.com
Cc: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Shuosheng Huang <huangshuosheng@allwinnertech.com>
Subject: [PATCH v2] dma-buf: heaps: init heaps in subsys_initcall
Date: Fri, 22 Oct 2021 09:48:50 +0800 [thread overview]
Message-ID: <20211022014850.22933-1-huangshuosheng@allwinnertech.com> (raw)
Some built-in modules will failed to use dma-buf heap to allocate
memory if the heap drivers are too late to be initialized.
To fix this issue, move initialization of dma-buf heap drivers in
subsys_initcall() which is more earlier to be called.
Signed-off-by: Shuosheng Huang <huangshuosheng@allwinnertech.com>
---
drivers/dma-buf/heaps/cma_heap.c | 2 +-
drivers/dma-buf/heaps/system_heap.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c
index 0c05b79870f9..e051403a346d 100644
--- a/drivers/dma-buf/heaps/cma_heap.c
+++ b/drivers/dma-buf/heaps/cma_heap.c
@@ -400,6 +400,6 @@ static int add_default_cma_heap(void)
return ret;
}
-module_init(add_default_cma_heap);
+subsys_initcall(add_default_cma_heap);
MODULE_DESCRIPTION("DMA-BUF CMA Heap");
MODULE_LICENSE("GPL v2");
diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c
index 23a7e74ef966..3d6927657ec9 100644
--- a/drivers/dma-buf/heaps/system_heap.c
+++ b/drivers/dma-buf/heaps/system_heap.c
@@ -435,5 +435,5 @@ static int system_heap_create(void)
return 0;
}
-module_init(system_heap_create);
+subsys_initcall(system_heap_create);
MODULE_LICENSE("GPL v2");
--
2.29.0
next reply other threads:[~2021-10-22 1:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-22 1:48 Shuosheng Huang [this message]
2021-10-22 2:56 ` [PATCH v2] dma-buf: heaps: init heaps in subsys_initcall John Stultz
2021-10-22 6:32 ` Christian König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211022014850.22933-1-huangshuosheng@allwinnertech.com \
--to=huangshuosheng@allwinnertech.com \
--cc=Brian.Starkey@arm.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=john.stultz@linaro.org \
--cc=labbott@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=lmark@codeaurora.org \
--cc=sumit.semwal@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).