Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp312317pxb; Wed, 20 Oct 2021 23:19:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzreUs5NubecKxlWmJcH0UCpemY1ALez58F+o0otdU2hL7aGVNPGvt/3WgIESfpjkPqJ4zi X-Received: by 2002:a17:906:3784:: with SMTP id n4mr4964992ejc.129.1634797182030; Wed, 20 Oct 2021 23:19:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634797182; cv=none; d=google.com; s=arc-20160816; b=jpq2SFrPIGKr2uUofalQa8zuvJZb7CcjimjG8olUxUyzVAvoGz02jPihOSz7CbRvfy G+IkFgA8hIiloG/CqQJ0r0vlM32QQg+DylHQ0ptbgKTTAaTDFCPuZ1O0fXc+ebGeUw8v X/BOHSBevI6mJcIXeyGchGfkpGX0KoOGJKZjPrOmHvdn5hXxKEZOTNvmzvo1t9TR7g5f 0qaJVPd546E2h2smCNj5KgSk9/bfIX4djeayw4VnMD94sVLnWx7k5cPhlSr261IWfB0u da93MAx38lxGEja+naNNHuxS6LBnJ2u/Q5DKhme0Meqp8IipwnwZH0UHeGF+ZFWSyjem Y5sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=T2HGHLdyVLM2MPfzP3vu+BvjG5TViVfVdkE4UNB/UnQ=; b=CZ75Zif7+iG7HFjzUFbVuij3kI89tglAM13EIsJj/vnGCsn/w+O8/xvQjKdF8tRdv/ wmnGovu6Y5bHnu8u0ZED3n4V5SUx0OHGjGLG4ntDUx1DithqGf8+rAhq+kqgos29NK1U 6awqhD+e9J7b6eOT0iRzt3CxKBQ/I2PO5FGiWNkn5vWcBJH/pWPiUYpVjocG1PUMTUE4 /suVTWCYqLRK274eolqTg8L9BdbuDVS9q3t7mNrnKXhCZGGqbopyxo0IzVD+E8epX8qT GHZPZtM+mSJGc6svypI0nlZl4LkSLrtkmWygTMfjuZzBu7mJvUwgVCUDuY3ZHqdyeTMR nbfw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v23si5902622ejh.759.2021.10.20.23.19.18; Wed, 20 Oct 2021 23:19:42 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231202AbhJUGS5 (ORCPT + 99 others); Thu, 21 Oct 2021 02:18:57 -0400 Received: from out28-3.mail.aliyun.com ([115.124.28.3]:39974 "EHLO out28-3.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231137AbhJUGS4 (ORCPT ); Thu, 21 Oct 2021 02:18:56 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.1877204|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.00836179-0.00118455-0.990454;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047206;MF=huangshuosheng@allwinnertech.com;NM=1;PH=DS;RN=12;RT=12;SR=0;TI=SMTPD_---.LfKw.bc_1634796993; Received: from allwinnertech.com(mailfrom:huangshuosheng@allwinnertech.com fp:SMTPD_---.LfKw.bc_1634796993) by smtp.aliyun-inc.com(10.147.40.7); Thu, 21 Oct 2021 14:16:37 +0800 From: Shuosheng Huang To: sumit.semwal@linaro.org, benjamin.gaignard@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, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, Shuosheng Huang Subject: [PATCH] dma-buf: heaps: init heaps in subsys_initcall Date: Thu, 21 Oct 2021 14:16:07 +0800 Message-Id: <20211021061607.17618-1-huangshuosheng@allwinnertech.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some built-in modules will failed to use dma-buf heap to allocate memory if the heap drivers is 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 --- 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