From nobody Thu Apr 9 18:00:39 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12CB637CD49 for ; Fri, 6 Mar 2026 10:37:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772793474; cv=none; b=Ip4oO4rrtUsT8ulthUGAD8DO97gW2Sr3lKHkN0GIQ6baq9bnF6l63G96sGYM+O7JZsW2McpPxlSZodZuIsinv4em9n+tBDLvuqlgqoYCbFCtWREWK4sbI9C7QT68LWRYH1TDmxNwtUbAexTKzbqJxmD/9dww3Lv8Z13VeO4z+B8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772793474; c=relaxed/simple; bh=8dYJXakMo93Mc3lLZ5xLZ8QfYkIluXNTvVn7oLOYyd0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WHppWRbLJ4uHaFpSJr4fW6iz91m66vsSx7WDywsafnEHENnriE5LNOE6GOTnLaNWSbtRsBaQ08BlKzt5B3DxT5CuE/YNk0yEmTYWI0yU7E4AJO7iQvYl03PUAEiL0GFM6Snw3HRS36scrF6O+sCSn4NO8ycQDAaf1v9N18btfpg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=g5Nud/PN; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="g5Nud/PN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772793472; 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=g5Nud/PNpHQhAqBQZ+SiSiMu7cu4hpRbgFPrGt1YkZqYPsxLIxE7fjo1buAcNcMQ7qXvae 2/ucyyWLqaqdAbZHvkJDg4UKDNKrTLanqnq+RBQ+cspPM2FCcUQmgpsqAiYTRAvv/E+R7T xNEURcSnWDDGBxJ31Tw47mEMoQDzzWU= 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 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. =20 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"); --=20 2.52.0