From nobody Mon Feb 9 00:59:58 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 01F0C29A317 for ; Thu, 22 May 2025 19:14:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747941292; cv=none; b=cogL1LOVN2Ehi47girgiLO0jJdzJhRmg4z7kEkEDZJX+prOoQUTDUkojiwDjoYP/4MwmgVY8Pj6mRdc7YBKrwM01NhNsxCQfOa2DG93rR/hDmPivwUPH8EMt0u8McEtZ0ZZz6N3BWbQw3cYBRpvSNkYzm+9bpDmzigoHeypgRaQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747941292; c=relaxed/simple; bh=48KOU03C6ig9fpKOv9cqZfxnQQrj+t5IAgMqA1jMLOo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UnTSybIdnViQIYkjHYt6ltPPLuXyWJ1TPcusOvz3YokMnQe3ELOuhniKJDKA7vNAfZdM5tRdm+RBj3l1rYkvJBmhkBveo/HNYUtSrDjYKZNlHY+eFb1rkSy6bnC3vIa9iQpcpF3gM04dnWxuMKBYg69OUUCS+Emjh+fGCOWY3sg= 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=bJ/llPph; arc=none smtp.client-ip=170.10.129.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="bJ/llPph" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747941289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DxcIBXbY9aD24z/Sdb9axXzItBI4qzUHLrNE5Q1QDjU=; b=bJ/llPph6xfk4vtiugTvKrO1JJjsfiklz7r10lyzY6LeTZyc5zkDqI+GuS1M6EyApb2vZI mN1I7JWTRMYk5Cm/8m9n2aaOh8DfeGkpkejn0BhY6B17kltPl9YUYZ/9KgWBk2eNC1qrao MlAPpgCAuJMqsxNkjbOdEp9SEahubUY= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-275-3n-i2b0rOt2HXaT2mteKNw-1; Thu, 22 May 2025 15:14:48 -0400 X-MC-Unique: 3n-i2b0rOt2HXaT2mteKNw-1 X-Mimecast-MFC-AGG-ID: 3n-i2b0rOt2HXaT2mteKNw_1747941288 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6f8bdefcb39so3567416d6.0 for ; Thu, 22 May 2025 12:14:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747941288; x=1748546088; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DxcIBXbY9aD24z/Sdb9axXzItBI4qzUHLrNE5Q1QDjU=; b=BKwC7dUuTx4mY8NDtZESHrMW3NKNP1OK7k9ziDXhewosVa8Ry3G0f7zGK+U9ti17eZ 10ESoDbkMVLZkQRqfvkvbzKrlOvavH9LegmcUFeM/1rfNOCXImTf0DAJ2B784xxQ6Zjz c/k8nGBm+pO/VBFzWSd7c+wIVXIQnoY2FkHh6GuxoLvoK89y4LB3FekIqEgqaimIgr8z ZsxiSeeLEH6BCAoX471CufBfBtItdMKwT1HRQPdWKcIyM0d3BxDpEI8eVYnSl5qQxsCv LPctX0wehgWh5M4Y3GaAG8wiMTMM7RmwIk4FQNaNhQ71AeySP59s9YSGGNS30M7+YcXJ VEWg== X-Forwarded-Encrypted: i=1; AJvYcCUI5IoB2hca2tptLXE3sPYJ6TuKBS1Ak0oVnKNNgsN+dpfZupiS8Vtwn2KlMxKfcYdM4lvXfMzSStKTylg=@vger.kernel.org X-Gm-Message-State: AOJu0YwipltkWx4CKzFuOssNa3a/RWOAoKmiGWabaVywZUbsiImvS74G 9DXQ8MrdrRrpt1za4HpbgHaHPlHZYLRmr2xlbhBGlVV++zI6L0hTdCXzpkYFgTxmfm5dI8ufd8N zy9VdccUr8/DgaRQcZ/uDfj1vQ+LndNxShhJz3r2LClmELp8NKh9z0u9LH+QuUJhgSQ== X-Gm-Gg: ASbGncuTB4sxVZvDnjLjyFA0nvQfN6z6CDjVVpn4rPZc0fMFV0DB/x4UipJm1cXBye1 QoG9RwUkUvIpEb5KcOzVIm+9UQXkI4HSBlfBdfvztvh6mKWkuSqDcwYe9xGTLNyn1hW7UUeR12s l2T8jiZFSd75dDumzKdzFLQQt2CDbg1P6YElWlyJfLoitI/5zk36rQ0CdPOpUUURwPMNOxMHdHI IXMC+1Jg1Ew3F6B+FcS6ya9MCyFfTCsh1iD5is40iuY4wh8qelhg4wY2RBezPMnHQw0uQo1uzXb Fgcspw/TeghEGpbyTf6qqWVzfe1WRafcVgwLQaxAPw0= X-Received: by 2002:a05:6214:21c2:b0:6d9:ac3:e730 with SMTP id 6a1803df08f44-6fa9359ba0amr9187986d6.5.1747941287824; Thu, 22 May 2025 12:14:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXDudy5Pg6bUCPRtP0KahbCyP3R5ipmAB0kn6jEZFdIdpWn2q6/ZPEaqhoAbgeWBZfIF4h6Q== X-Received: by 2002:a05:6214:21c2:b0:6d9:ac3:e730 with SMTP id 6a1803df08f44-6fa9359ba0amr9187686d6.5.1747941287499; Thu, 22 May 2025 12:14:47 -0700 (PDT) Received: from jkangas-thinkpadp1gen3.rmtuswa.csb ([2601:1c2:4301:5e20:98fe:4ecb:4f14:576b]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6f8b08ab862sm102862916d6.38.2025.05.22.12.14.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:14:47 -0700 (PDT) From: Jared Kangas To: sumit.semwal@linaro.org, benjamin.gaignard@collabora.com, Brian.Starkey@arm.com, jstultz@google.com, tjmercier@google.com, christian.koenig@amd.com Cc: mripard@kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, Jared Kangas Subject: [PATCH v3 1/3] Documentation: dma-buf: heaps: Fix code markup Date: Thu, 22 May 2025 12:14:16 -0700 Message-ID: <20250522191418.442390-2-jkangas@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250522191418.442390-1-jkangas@redhat.com> References: <20250522191418.442390-1-jkangas@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Code snippets should be wrapped in double backticks to follow reStructuredText semantics; the use of single backticks uses the :title-reference: role by default, which isn't quite what we want. Add double backticks to code snippets to fix this. Signed-off-by: Jared Kangas Reviewed-by: Maxime Ripard --- Documentation/userspace-api/dma-buf-heaps.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/userspace-api/dma-buf-heaps.rst b/Documentation/= userspace-api/dma-buf-heaps.rst index 535f49047ce64..23bd0bd7b0654 100644 --- a/Documentation/userspace-api/dma-buf-heaps.rst +++ b/Documentation/userspace-api/dma-buf-heaps.rst @@ -19,7 +19,7 @@ following heaps: - The ``cma`` heap allocates physically contiguous, cacheable, buffers. Only present if a CMA region is present. Such a region is usually created either through the kernel commandline through the - `cma` parameter, a memory region Device-Tree node with the - `linux,cma-default` property set, or through the `CMA_SIZE_MBYTES` or - `CMA_SIZE_PERCENTAGE` Kconfig options. Depending on the platform, it + ``cma`` parameter, a memory region Device-Tree node with the + ``linux,cma-default`` property set, or through the ``CMA_SIZE_MBYTES`` = or + ``CMA_SIZE_PERCENTAGE`` Kconfig options. Depending on the platform, it might be called ``reserved``, ``linux,cma``, or ``default-pool``. --=20 2.49.0 From nobody Mon Feb 9 00:59:58 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 9CFDE29ACC0 for ; Thu, 22 May 2025 19:14:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747941297; cv=none; b=kSpOgOPDXgcbyexgVuWbGoNv9JpG7EFYBQdBBE08H0zC6kMSYaH/Hu+hW0k2Q1VbTaVMFw/jPuBJsoE3HPPdnaTsey/PdFQ1q07FpYGxjaLxXx2pXFXi86HZA65aHkq4ZSvF/4598ibUdNtLERu/RIe2n/FY/6Od21AeJPBZl0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747941297; c=relaxed/simple; bh=sfBmd1OBbJI2abcZpauJWCnwwx49LFyiSAV6mfejFhE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bwBn223ZjPepOgMWejStYNfTqlO8C17Jc51+wj5stwYggEgzsKDPE+MgpCorIfQxF37YytHsyzgryT7xnxBoXGWi1FSQr47MQaUIoYQkDQEsjL2c5TP8E7ObSaeTkTil5oauwBbmM0/b8b7VDl/TeTAj4JeX5MzL8qWF5pXPPsg= 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=BJARz9EB; arc=none smtp.client-ip=170.10.129.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="BJARz9EB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747941291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DslNlnyYeBMO8E0a4QEwSeg6EwzYfoV0u5u9NaRMXyQ=; b=BJARz9EBv9wdayT4HHRjAoPCnyox5xzJGuuummINN/Lac68j6vtM8EJZm3c1kjYmS81RiF MyTTs08w1D8aydsQrjMAq8NzBLZYyct8pe6bWOU025TlgX3VMsAKJjn0j9DrUhQGUkCd6Z IkjYN7HMAmm7mWQi4rII6aOjTvxEYkA= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-427-t2vtzQAJPuiy1yAauxiiiQ-1; Thu, 22 May 2025 15:14:50 -0400 X-MC-Unique: t2vtzQAJPuiy1yAauxiiiQ-1 X-Mimecast-MFC-AGG-ID: t2vtzQAJPuiy1yAauxiiiQ_1747941290 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-6fa8eca6910so9571536d6.2 for ; Thu, 22 May 2025 12:14:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747941290; x=1748546090; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DslNlnyYeBMO8E0a4QEwSeg6EwzYfoV0u5u9NaRMXyQ=; b=rya6CXwD7ka07uBOPG+CXrfMLR4d7UTXCdnX76hg8OaFbxDHLuyCjUlZ93DgC8xcEF 5yjWNLAdT7H5/mKKvgXEGH3LdAD5V0pf3FUaa/Jqko2zX5ZSWlPNBkQ89DSrg5FJnAS8 GICyaFG38uoIBJmH55Uj6ZMa3AkRcgVhesUDaZniObFzYe30hOEwAy8x2EdRkHoFVo5f b1ulhKpzkEKDiMwLTurVmq/gckODwld0MD3uuJuyeW245YIXmdvEMblbjYRa11peLPR8 z44eD8xeLTQLRD5qaaLQgWaoj52oT/I1lt/hTII7jiYmH59jr92HCY8POQt3QzfrKbQK yw/Q== X-Forwarded-Encrypted: i=1; AJvYcCULFGZDRPipIi98RZ077oUHcNLhnxUCJi8Kx8cHYbyPIBVfkr8pMVO7KclnzyTFRQLTZS5sPJtI3hCk1O8=@vger.kernel.org X-Gm-Message-State: AOJu0YzUNFsTAeiWfK9Wk585+D4C7z/ctjjRW2tqWxnlUUzv1xP75HO/ z0WV2nT7tIHgK6bIFHPjigYUTqnIJ1bDmt4zWDINy68HiL4pquJJonsmHJtlgZuQpWfFDz9FMCe EjNWxvfA2PFoTjrdqU6OQrxFrD+wX+5vAcyUus5zl4IRzIno4s8oj5n8YlSwGKqgwTQ== X-Gm-Gg: ASbGnctqMfpqS2T3Z4fbiZGNnPS8li+z7VqKjsUxzqLaB3RJCfwBQknrm4bUCJOpFkC ADWtD0rjFil1GNp2Aw2zWIskFJuykTJ3iTZGE10IAeKVNLJCrFUK2z/gq9Z1DOe5SoILzNwyvTr EpJpitjVUojrWbmI72pbkTAvgxfjRQkp7G8LcRQ3LpDCOYa5MzmgZIhhOvMz+y8omzxxTGpPN1b /oziU3LUZvqQU7jLP2W0ChteVEcTKvlSVWZ/AZyn+Yq5vtC2/dzUhhgk3G8pzRoz4yyrRr0R59W DiIo47NEiXVh2M593t9KsoFRRtmhy9MRYhs7UdZ28aw= X-Received: by 2002:a05:6214:d03:b0:6ed:12b0:f181 with SMTP id 6a1803df08f44-6fa93a3329fmr5223866d6.14.1747941289866; Thu, 22 May 2025 12:14:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUDT8yQqi4n4RTYXy8azlp/sJFJlAyhLHZ60JNEKpweDC9ye+5j/Kk6h96Y/dCMxu9PAXk8w== X-Received: by 2002:a05:6214:d03:b0:6ed:12b0:f181 with SMTP id 6a1803df08f44-6fa93a3329fmr5223506d6.14.1747941289482; Thu, 22 May 2025 12:14:49 -0700 (PDT) Received: from jkangas-thinkpadp1gen3.rmtuswa.csb ([2601:1c2:4301:5e20:98fe:4ecb:4f14:576b]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6f8b08ab862sm102862916d6.38.2025.05.22.12.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:14:49 -0700 (PDT) From: Jared Kangas To: sumit.semwal@linaro.org, benjamin.gaignard@collabora.com, Brian.Starkey@arm.com, jstultz@google.com, tjmercier@google.com, christian.koenig@amd.com Cc: mripard@kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, Jared Kangas Subject: [PATCH v3 2/3] dma-buf: heaps: Parameterize heap name in __add_cma_heap() Date: Thu, 22 May 2025 12:14:17 -0700 Message-ID: <20250522191418.442390-3-jkangas@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250522191418.442390-1-jkangas@redhat.com> References: <20250522191418.442390-1-jkangas@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Prepare for the introduction of a fixed-name CMA heap by replacing the unused void pointer parameter in __add_cma_heap() with the heap name. Signed-off-by: Jared Kangas Reviewed-by: Maxime Ripard --- drivers/dma-buf/heaps/cma_heap.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_h= eap.c index 9512d050563a9..e998d8ccd1dc6 100644 --- a/drivers/dma-buf/heaps/cma_heap.c +++ b/drivers/dma-buf/heaps/cma_heap.c @@ -366,17 +366,17 @@ static const struct dma_heap_ops cma_heap_ops =3D { .allocate =3D cma_heap_allocate, }; =20 -static int __init __add_cma_heap(struct cma *cma, void *data) +static int __init __add_cma_heap(struct cma *cma, const char *name) { - struct cma_heap *cma_heap; struct dma_heap_export_info exp_info; + struct cma_heap *cma_heap; =20 cma_heap =3D kzalloc(sizeof(*cma_heap), GFP_KERNEL); if (!cma_heap) return -ENOMEM; cma_heap->cma =3D cma; =20 - exp_info.name =3D cma_get_name(cma); + exp_info.name =3D name; exp_info.ops =3D &cma_heap_ops; exp_info.priv =3D cma_heap; =20 @@ -394,12 +394,16 @@ static int __init __add_cma_heap(struct cma *cma, voi= d *data) static int __init add_default_cma_heap(void) { struct cma *default_cma =3D dev_get_cma_area(NULL); - int ret =3D 0; + int ret; =20 - if (default_cma) - ret =3D __add_cma_heap(default_cma, NULL); + if (!default_cma) + return 0; =20 - return ret; + ret =3D __add_cma_heap(default_cma, cma_get_name(default_cma)); + if (ret) + return ret; + + return 0; } module_init(add_default_cma_heap); MODULE_DESCRIPTION("DMA-BUF CMA Heap"); --=20 2.49.0 From nobody Mon Feb 9 00:59:58 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 994332BDC2A for ; Thu, 22 May 2025 19:15:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747941309; cv=none; b=tpDtEvVGTMSBtkIBUAIiYAWgsnDumEj6SkoR8laMHFRP775u+zGIV92aySNv1px9AOmUDQYNYeBhfg07Ivt0VYaKJvnkQisz/SAX7l79S4namB7DDgZ3/6AcxP4uAFo9s8JrcDr9x5GPwWEzNPmdTD5w6h5uLlOUH+V+hmzu+kw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747941309; c=relaxed/simple; bh=fwAp6zae0IltZYma+nR+3onsEyeevpiXP5hiVsfvTKQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Yf3xsvmcHT+kxtatL1hZcGXEqj4/FgZ4IMTJsv6y4eGO+0iPNik1/cp5WyW8EzlO/4TPQd+zEVqLMQ8UEznLywSqsAiFEOkhPXLk08jNM/nP+1k0XFH9AqDyVEaMAV2TFQZ/vYKD5kC4u4YM6Klfg7PF+wGaNyGNO8MwybQUN8o= 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=fYEBNEeM; arc=none smtp.client-ip=170.10.129.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="fYEBNEeM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747941306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z6N8riCiMdEu0kVFdl/5VBbDqLppN8ZtAWlw8HDr1aA=; b=fYEBNEeMy0ZgEoAb0fIZzx9AdwPwWo/1Czub51c/ss7I5tOrXgP5+4M0Qjv6zJmhG+TWKJ 5yoHNV4JYct23IY/Y2sdLhaDZY6g9Pg2i7fTI7Ur+wX7fiDbnhNdgoylZPJnnzze9ZqG1V 3aQkWsac6tm9QkNUJdqFiZeLugNhtAo= Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-183-4txDaLzSOvmgist3ORjD_w-1; Thu, 22 May 2025 15:15:05 -0400 X-MC-Unique: 4txDaLzSOvmgist3ORjD_w-1 X-Mimecast-MFC-AGG-ID: 4txDaLzSOvmgist3ORjD_w_1747941305 Received: by mail-ua1-f72.google.com with SMTP id a1e0cc1a2514c-875a2033753so5269810241.2 for ; Thu, 22 May 2025 12:15:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747941303; x=1748546103; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z6N8riCiMdEu0kVFdl/5VBbDqLppN8ZtAWlw8HDr1aA=; b=V1IiMY6h/58sbwUdjFOe8FxF3XxnBPQugd4e4VwfsBVlPIhCFV2/oXbMXIRhwFhXlX OoEll/hMsqMA7fLaAVFa0uuXEV4GOCZuzpj8SjS/4gOJm0tJcFrxDv0yK9SYQ6qvnYwg AFFRrMg3H/WXvDmjtlXJdmiqWC+yY5VPq2w7Y73VwyFTLqPQidAOL0LTx+9UYouDX+wS tKKyuCYMX4l5YH1RU3jXcNJeaoOxk7/B0PgFnzipq4rnQWGqt2/aiOODPKfBSSCYz5U3 2h/1Jv+duhywSypLaLWlMiTFDKEV586CoKP+mL5ze/oPAeyxZ5t30QEwxVV4sGF0q4it Z4eA== X-Forwarded-Encrypted: i=1; AJvYcCVFj+Z7zUPYZOZc57toY6E8jy4ZoNz4k26f4BfYtE++slm9CY1aG6TP0q3qxbhwYGOqYMOsJwJRmPtXL4k=@vger.kernel.org X-Gm-Message-State: AOJu0Yxj2nfnb6x30CEK7o2EYdbWxkhjxsYDpa1K2t9qY+Zz+cyaZA59 kSFdPN3AJJcszcSqbBujTDQDsoSe8KOEDTVg6jnN+gBbR2/EgGkhLxCvq3QfjFsZNP1aDAJSsoe AbifYVwW9VpsAqWC522LaTmYPEqmkCZKoqfnKAQlTyuEuNBQ20Vco2ZIfgIR3O/LFojf3DZU2mA == X-Gm-Gg: ASbGncsbFoKLhsgnd5l3NaNHtVGpr8QHGRB94KZPgXp6nqttpMdxRZg9lgjhBwJFzPi T3nqJ4pOyrS+FHr4HJLO4KBKufpMViPsGQYBNfsnH8hbeAXCcHIYrU7TeEbyOHdEgD8mIZAh53F PfumXnLF9XUFN4ISCJSR3NHNNooPXeLY+1u92JogwdzC6Z8YQKNWoCw8j1z1YEujITgXy6ClzZK 5Ty38miw21A77KtTMWzW4JIdIFx86aL0zPTJKtJVxlbzvWQrQQr62mtx/ZJ5HEcWw49hVdiplbL C2VojUuKmRDDjxnXbMwoUvUCvDqYdGA0lhANqw/lhNQ= X-Received: by 2002:a05:6102:5714:b0:4c1:94df:9aea with SMTP id ada2fe7eead31-4dfa6bebe78mr23733283137.15.1747941303099; Thu, 22 May 2025 12:15:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRddDlFxPUUR5F2gsJMHMOPx29VyzJ81B7uxRO7njSdbC+pQOzmu4VMwEnxIQSDZLDU8b5hA== X-Received: by 2002:a05:6214:1c09:b0:6e8:97d2:9999 with SMTP id 6a1803df08f44-6f8b08ab1f9mr447262536d6.28.1747941291701; Thu, 22 May 2025 12:14:51 -0700 (PDT) Received: from jkangas-thinkpadp1gen3.rmtuswa.csb ([2601:1c2:4301:5e20:98fe:4ecb:4f14:576b]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6f8b08ab862sm102862916d6.38.2025.05.22.12.14.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 12:14:51 -0700 (PDT) From: Jared Kangas To: sumit.semwal@linaro.org, benjamin.gaignard@collabora.com, Brian.Starkey@arm.com, jstultz@google.com, tjmercier@google.com, christian.koenig@amd.com Cc: mripard@kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, Jared Kangas Subject: [PATCH v3 3/3] dma-buf: heaps: Give default CMA heap a fixed name Date: Thu, 22 May 2025 12:14:18 -0700 Message-ID: <20250522191418.442390-4-jkangas@redhat.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250522191418.442390-1-jkangas@redhat.com> References: <20250522191418.442390-1-jkangas@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The CMA heap's name in devtmpfs can vary depending on how the heap is defined. Its name defaults to "reserved", but if a CMA area is defined in the devicetree, the heap takes on the devicetree node's name, such as "default-pool" or "linux,cma". To simplify naming, unconditionally name it "default_cma_region", but keep a legacy node in place backed by the same underlying allocator for backwards compatibility. Signed-off-by: Jared Kangas Reviewed-by: Maxime Ripard --- Documentation/userspace-api/dma-buf-heaps.rst | 7 +++++-- drivers/dma-buf/heaps/Kconfig | 10 ++++++++++ drivers/dma-buf/heaps/cma_heap.c | 20 ++++++++++++++++++- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/Documentation/userspace-api/dma-buf-heaps.rst b/Documentation/= userspace-api/dma-buf-heaps.rst index 23bd0bd7b0654..1dfe5e7acd5a3 100644 --- a/Documentation/userspace-api/dma-buf-heaps.rst +++ b/Documentation/userspace-api/dma-buf-heaps.rst @@ -21,5 +21,8 @@ following heaps: usually created either through the kernel commandline through the ``cma`` parameter, a memory region Device-Tree node with the ``linux,cma-default`` property set, or through the ``CMA_SIZE_MBYTES`` = or - ``CMA_SIZE_PERCENTAGE`` Kconfig options. Depending on the platform, it - might be called ``reserved``, ``linux,cma``, or ``default-pool``. + ``CMA_SIZE_PERCENTAGE`` Kconfig options. The heap's name in devtmpfs is + ``default_cma_region``. For backwards compatibility, when the + ``DMABUF_HEAPS_CMA_LEGACY`` Kconfig option is set, a duplicate node is + created following legacy naming conventions; the legacy name might be + ``reserved``, ``linux,cma``, or ``default-pool``. diff --git a/drivers/dma-buf/heaps/Kconfig b/drivers/dma-buf/heaps/Kconfig index a5eef06c42264..bb369b38b001a 100644 --- a/drivers/dma-buf/heaps/Kconfig +++ b/drivers/dma-buf/heaps/Kconfig @@ -12,3 +12,13 @@ config DMABUF_HEAPS_CMA Choose this option to enable dma-buf CMA heap. This heap is backed by the Contiguous Memory Allocator (CMA). If your system has these regions, you should say Y here. + +config DMABUF_HEAPS_CMA_LEGACY + bool "Legacy DMA-BUF CMA Heap" + default y + depends on DMABUF_HEAPS_CMA + help + Add a duplicate CMA-backed dma-buf heap with legacy naming derived + from the CMA area's devicetree node, or "reserved" if the area is not + defined in the devicetree. This uses the same underlying allocator as + CONFIG_DMABUF_HEAPS_CMA. diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_h= eap.c index e998d8ccd1dc6..dfeccafc6ae3c 100644 --- a/drivers/dma-buf/heaps/cma_heap.c +++ b/drivers/dma-buf/heaps/cma_heap.c @@ -9,6 +9,9 @@ * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/ * Andrew F. Davis */ + +#define pr_fmt(fmt) "cma_heap: " fmt + #include #include #include @@ -22,6 +25,7 @@ #include #include =20 +#define DEFAULT_CMA_NAME "default_cma_region" =20 struct cma_heap { struct dma_heap *heap; @@ -394,15 +398,29 @@ static int __init __add_cma_heap(struct cma *cma, con= st char *name) static int __init add_default_cma_heap(void) { struct cma *default_cma =3D dev_get_cma_area(NULL); + const char *legacy_cma_name; int ret; =20 if (!default_cma) return 0; =20 - ret =3D __add_cma_heap(default_cma, cma_get_name(default_cma)); + ret =3D __add_cma_heap(default_cma, DEFAULT_CMA_NAME); if (ret) return ret; =20 + if (IS_ENABLED(CONFIG_DMABUF_HEAPS_CMA_LEGACY)) { + legacy_cma_name =3D cma_get_name(default_cma); + if (!strcmp(legacy_cma_name, DEFAULT_CMA_NAME)) { + pr_warn("legacy name and default name are the same, skipping legacy hea= p\n"); + return 0; + } + + ret =3D __add_cma_heap(default_cma, legacy_cma_name); + if (ret) + pr_warn("failed to add legacy heap: %pe\n", + ERR_PTR(-ret)); + } + return 0; } module_init(add_default_cma_heap); --=20 2.49.0