From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8FFFFF01825 for ; Fri, 6 Mar 2026 10:37:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 015AF10ECD4; Fri, 6 Mar 2026 10:37:55 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="NLh+1mgV"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6D57210ECD7 for ; Fri, 6 Mar 2026 10:37:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772793473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QlzQWM0pQarIoPqm3Nl91hQ8QPCgoigzmRIhUlpi9M8=; b=NLh+1mgVQl4dFJf0LSnP1k/E0p16sl4LdtDM+/6yCVwG1vK9hhaRwWepBcYRCK4XHWkcEe zdrwTaplqVHVWPl1rZPJypf8/Fqrq9BoX4vfKDMe52wlv/796DaWuFxlFL4OALmbYUlFJD yVi+xAHVlYOAmjpP6IbRGKo89vrIX9o= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-588-UUtSeqiXMbu1DAjH5sRbQg-1; Fri, 06 Mar 2026 05:37:47 -0500 X-MC-Unique: UUtSeqiXMbu1DAjH5sRbQg-1 X-Mimecast-MFC-AGG-ID: UUtSeqiXMbu1DAjH5sRbQg_1772793465 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BBFDE1956088; Fri, 6 Mar 2026 10:37:45 +0000 (UTC) Received: from [192.168.1.153] (unknown [10.45.226.103]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D4D89180035F; Fri, 6 Mar 2026 10:37:39 +0000 (UTC) From: Albert Esteve Date: Fri, 06 Mar 2026 11:36:37 +0100 Subject: [PATCH v3 6/6] dma-buf: heaps: coherent: Turn heap into a module MIME-Version: 1.0 Message-Id: <20260306-b4-dmabuf-heap-coherent-rmem-v3-6-3d00d36c9bc4@redhat.com> References: <20260306-b4-dmabuf-heap-coherent-rmem-v3-0-3d00d36c9bc4@redhat.com> In-Reply-To: <20260306-b4-dmabuf-heap-coherent-rmem-v3-0-3d00d36c9bc4@redhat.com> To: Sumit Semwal , Benjamin Gaignard , Brian Starkey , John Stultz , "T.J. Mercier" , =?utf-8?q?Christian_K=C3=B6nig?= , Marek Szyprowski , Robin Murphy , Rob Herring , Saravana Kannan Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Albert Esteve , mripard@redhat.com, echanude@redhat.com X-Developer-Signature: v=1; a=ed25519-sha256; t=1772793417; l=1661; i=aesteve@redhat.com; s=20260303; h=from:subject:message-id; bh=8dYJXakMo93Mc3lLZ5xLZ8QfYkIluXNTvVn7oLOYyd0=; b=Qm2/NTv+NibwQ4NUgIiBv1ELR84Zemc1608Ij5MBU+ZNmcVHDkvPQnkB17rRPklxBL/kLazKf 4Fi3uUXQDF+CAD44A2H9aDZK/GjsuL7JYH0er/9W85JKFYPQp+70MJH X-Developer-Key: i=aesteve@redhat.com; a=ed25519; pk=YSFz6sOHd2L45+Fr8DIvHTi6lSIjhLZ5T+rkxspJt1s= X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: jcSDV0XAT2WZtyX4RAgkGe9DjLxS-NkSeM_8r0woJso_1772793465 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Following the current efforts to make CMA heap as module, we can do the same and turn the Coherent heap into a module as well, by changing the Kconfig into a tristate and importing the proper dma-buf namespaces. This heap won't be able to unload (same as happens with the CMA heap), since we're missing a big part of the infrastructure that would allow to make it safe. Signed-off-by: Albert Esteve --- drivers/dma-buf/heaps/Kconfig | 2 +- drivers/dma-buf/heaps/coherent_heap.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/dma-buf/heaps/Kconfig b/drivers/dma-buf/heaps/Kconfig index aeb475e585048..2f84a1018b900 100644 --- a/drivers/dma-buf/heaps/Kconfig +++ b/drivers/dma-buf/heaps/Kconfig @@ -14,7 +14,7 @@ config DMABUF_HEAPS_CMA regions, you should say Y here. config DMABUF_HEAPS_COHERENT - bool "DMA-BUF Coherent Reserved-Memory Heap" + tristate "DMA-BUF Coherent Reserved-Memory Heap" depends on DMABUF_HEAPS && OF_RESERVED_MEM && DMA_DECLARE_COHERENT help Choose this option to enable coherent reserved-memory dma-buf heaps. diff --git a/drivers/dma-buf/heaps/coherent_heap.c b/drivers/dma-buf/heaps/coherent_heap.c index 55f53f87c4c15..fdb3f5d907e88 100644 --- a/drivers/dma-buf/heaps/coherent_heap.c +++ b/drivers/dma-buf/heaps/coherent_heap.c @@ -412,3 +412,6 @@ static int __init coherent_heap_register(void) } module_init(coherent_heap_register); MODULE_DESCRIPTION("DMA-BUF heap for coherent reserved-memory regions"); +MODULE_LICENSE("GPL"); +MODULE_IMPORT_NS("DMA_BUF"); +MODULE_IMPORT_NS("DMA_BUF_HEAP"); -- 2.52.0