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 X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD7D3C433E0 for ; Thu, 14 Jan 2021 19:50:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A37202399C for ; Thu, 14 Jan 2021 19:50:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730386AbhANTuS (ORCPT ); Thu, 14 Jan 2021 14:50:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727391AbhANTuR (ORCPT ); Thu, 14 Jan 2021 14:50:17 -0500 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65236C061575 for ; Thu, 14 Jan 2021 11:49:37 -0800 (PST) Received: by mail-qv1-xf2d.google.com with SMTP id az16so2895249qvb.5 for ; Thu, 14 Jan 2021 11:49:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1zizu37IibkwemqdpaRibOtXAnbLUYIiJx9hqRg2s88=; b=lZuSvDEQF58ZhFUbCoGE7Z1jJ0Pgx9eBL7AutBdLexq9l7vgjFbNBQ/t/RJjUKnjHD 7MsVYJMUFtuEZoGw1eSN4SXhmY5cjknh2f22PaDk8I/h5UtJUjzK1g/mh6q0eqnh7eyA s1ORXdVuLbiCUmtQ+vHj5qLyNfb+c0pPYuwRzWmrARQHJLuHYDqaJmYe6q3/SgrvD63l h9of/4WDTqdjE+op+7GXn+hQUqqnLfdxfpb8YSm0bqDkq1y4BVUdVdcOtDW0EE9VSAUa yw9Ji7vhJ5BNKZOEkYlz5NXRCmde9qsOCdo3PAREsrbZOMLm4pI2YDxbEecqQETmwYic nmYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1zizu37IibkwemqdpaRibOtXAnbLUYIiJx9hqRg2s88=; b=ojKbwDW9dJJ2CW1uaX50lbBMe7pnqYDirhBrsx9O5Sx7TuGSgoZDo3QdAhpV9B5tW0 8LyLnEtsGhrULDEN+eH886XMmTUOZWZJXVwLbJ+TivVqMwXYewaUiHCmicrbQKN2HP3t zeiZaE6xEJm0481Gpdk1l1fNOmydsRj3xAI76JQi6hDc4deDiC8o1xm1+iRQbQp5PUrf Y8IpQMldqZf+8/6jW/bWQiv0q9HCs9aqWT+lqPDNiW4+4Qx7tMKn9HNyul5/PXjkbhE7 iLArXBGmU6H+NfbuYJ/HuQOn+R1yjK+Ljlx0hLaFYcj6cj636H1Dy3rDEPFURJ0jeSZd VLJQ== X-Gm-Message-State: AOAM531lsGjMi8G4osFD2ucteaPhksAyEbMJIQucmUIfzkxUHrXKOfD5 JLm0n5i0Px2MSN+ZaFuYcF+wGuk9ILlf8f7HmsZruw== X-Google-Smtp-Source: ABdhPJxg5NPhOqA+7s9RwIlJJn5Yoqck0Iif3Unmra/z5l6l8oWvomlz3q0ZHTEDjMgJZhagYk2KBczrOl9d1bCcXus= X-Received: by 2002:a0c:8203:: with SMTP id h3mr8726142qva.0.1610653776416; Thu, 14 Jan 2021 11:49:36 -0800 (PST) MIME-Version: 1.0 References: <20210113012143.1201105-1-minchan@kernel.org> <20210113012143.1201105-4-minchan@kernel.org> <20210114140138.GA2796092@robh.at.kernel.org> In-Reply-To: <20210114140138.GA2796092@robh.at.kernel.org> From: Hridya Valsaraju Date: Thu, 14 Jan 2021 11:49:00 -0800 Message-ID: Subject: Re: [PATCH v3 3/4] dt-bindings: reserved-memory: Make DMA-BUF CMA heap DT-configurable To: Rob Herring Cc: Minchan Kim , Andrew Morton , linux-mm , LKML , Hyesoo Yu , david@redhat.com, mhocko@suse.com, Suren Baghdasaryan , "pullip.cho" , John Dias , John Stultz , Sumit Semwal , linux-media@vger.kernel.org, devicetree@vger.kernel.org, Christoph Hellwig , linaro-mm-sig@lists.linaro.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 14, 2021 at 6:01 AM Rob Herring wrote: > > On Tue, Jan 12, 2021 at 05:21:42PM -0800, Minchan Kim wrote: > > From: Hyesoo Yu > > > > Document devicetree binding for chunk cma heap on dma heap framework. > > > > The DMA chunk heap supports the bulk allocation of higher order pages. > > Why do we need this? What does this do that CMA doesn't? > > With a CMA area I can believe a carve out is a common, OS independent > thing. This looks too closely tied to some Linux thing to go into DT. Hello Rob, Thank you for the review! The chunk heap's allocator also allocates from the CMA area. It is, however, optimized to perform bulk allocation of higher order pages in an efficient manner. For this purpose, the heap needs an exclusive CMA area that will only be used for allocation by the heap. This is the reason why we need to use the DT to create and configure a reserved memory region for use by the chunk CMA heap driver. Since all allocation from DMA-BUF heaps happen from the user-space, there is no other appropriate device-driver that we can use to register the chunk CMA heap and configure the reserved memory region for its use. We have been following your guidance in [1] to bind the chunk CMA heap driver directly to the reserved_memory region it will allocate from. Is there an alternative that we are missing Rob? [1]: https://lore.kernel.org/lkml/20191025225009.50305-2-john.stultz@linaro.org/T/#m3dc63acd33fea269a584f43bb799a876f0b2b45d The use-case that we have for the heap currently will allocate memory from it from userspace and use the allocated memory to optimize 4K/8K HDR video playback with a secure DRM HW pipeline. Thank you for all the help and review :) Regards, Hridya > > > > > Signed-off-by: Hyesoo Yu > > Signed-off-by: Minchan Kim > > Signed-off-by: Hridya Valsaraju > > Change-Id: I8fb231e5a8360e2d8f65947e155b12aa664dde01 > > Drop this. > > > --- > > .../reserved-memory/dma_heap_chunk.yaml | 58 +++++++++++++++++++ > > 1 file changed, 58 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/reserved-memory/dma_heap_chunk.yaml > > > > diff --git a/Documentation/devicetree/bindings/reserved-memory/dma_heap_chunk.yaml b/Documentation/devicetree/bindings/reserved-memory/dma_heap_chunk.yaml > > new file mode 100644 > > index 000000000000..3e7fed5fb006 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/reserved-memory/dma_heap_chunk.yaml > > @@ -0,0 +1,58 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/reserved-memory/dma_heap_chunk.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Device tree binding for chunk heap on DMA HEAP FRAMEWORK > > + > > +description: | > > + The DMA chunk heap is backed by the Contiguous Memory Allocator (CMA) and > > + supports bulk allocation of fixed size pages. > > + > > +maintainers: > > + - Hyesoo Yu > > + - John Stultz > > + - Minchan Kim > > + - Hridya Valsaraju > > space ^ > > > + > > + > > +properties: > > + compatible: > > + enum: > > + - dma_heap,chunk > > The format is , and 'dma_heap' is not a vendor. > > > + > > + chunk-order: > > + description: | > > + order of pages that will get allocated from the chunk DMA heap. > > + maxItems: 1 > > + > > + size: > > + maxItems: 1 > > + > > + alignment: > > + maxItems: 1 > > + > > +required: > > + - compatible > > + - size > > + - alignment > > + - chunk-order > > + > > +additionalProperties: false > > + > > +examples: > > + - | > > + reserved-memory { > > + #address-cells = <2>; > > + #size-cells = <1>; > > + > > + chunk_memory: chunk_memory { > > + compatible = "dma_heap,chunk"; > > + size = <0x3000000>; > > + alignment = <0x0 0x00010000>; > > + chunk-order = <4>; > > + }; > > + }; > > + > > + > > -- > > 2.30.0.284.gd98b1dd5eaa7-goog > >