Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp21709pxb; Tue, 17 Nov 2020 19:03:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBVBCBZ26/go1mIUKkX7lorWug6DJ1l/rp68hyDzuV3i8dLE1mHuE5bBLAxyOzpjKmh+gi X-Received: by 2002:a50:950e:: with SMTP id u14mr23516267eda.260.1605668604756; Tue, 17 Nov 2020 19:03:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605668604; cv=none; d=google.com; s=arc-20160816; b=yUQ7xoVmRhSGlVY6xx/Biv3AuNSy+ob9/Vg47Cg2RRxJmrLIg7sJk2JIXknJbWUoYC zIGUYfJS0dyXgZE/hcaflhAsdRmlRNAs+ZAPviMKdaUD9VWrluwoTSGWHcZzRxZ2LMKr CzYswZEj8Z0xEDnEMuLOniYSmmE9RgcW9Kr9JOxKokiwdCewlsQgEunp24YEX/AYoWgP vzTnY2mUzYFi0TNUfuNGnZhgvgxU1yyPyNtqlsWB6+0fubPvCPMm8rJ2TRTxCIeUpUcW d12XYIbZnMX/YoL9RNs+xT+C/HOKHAx3uwWjp4CCzbYMxsO6ORP1qXFRditMotG3mUNT 62ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3uJCOUcCa+QNGhT/ES7N0Gs1weA2TXULzhkEQY1X4Jo=; b=wQNc6tK1y/8L43gI/Kli6FFFs3777RFjWMSDNLDibGbSMqJnFW7QaHSWNI+MP3EgD5 79x0HNcaEvJO3Wn21DVnB04PnlJf7An5AkLXopBPzsCs/3trel3UQutSJfkWoBeqXoVc uoTs/Npo4qvYjpS/HvCZzARfnI+YiOxTplxqU37ei55AWH/mS/Ybg5yGHBh0701/ZPgP f9XKquOVpxUPwuPPjx3cqDpkaYC1HtaaX/TAOQVTaRAygYkqCkHDyH+ozncnGEwcggG0 bVpUFaHZ158oqrNwxkVVlLIlBVLHFHxJAWjGSLmy6VIdJNKZoU98Jlk5J+1fleKTi94M jQIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iudQYKUw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o16si15211646edi.462.2020.11.17.19.02.41; Tue, 17 Nov 2020 19:03:24 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=iudQYKUw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726205AbgKRDBH (ORCPT + 99 others); Tue, 17 Nov 2020 22:01:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726287AbgKRDBH (ORCPT ); Tue, 17 Nov 2020 22:01:07 -0500 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03119C061A4D for ; Tue, 17 Nov 2020 19:01:06 -0800 (PST) Received: by mail-ot1-x342.google.com with SMTP id f16so353698otl.11 for ; Tue, 17 Nov 2020 19:01:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3uJCOUcCa+QNGhT/ES7N0Gs1weA2TXULzhkEQY1X4Jo=; b=iudQYKUwAOK9crkiWJ66u2A1YGZCBlCwtJ7NMi11klrVKGT/dFCsGxSljVJDr7DJ0g lDpDgEUNZJYa9nmxUH6uwUeRo3AfV1WCViXiGu7wlPweAMbLV9FB7Fo5b+oHQQi1aigL MthZtLw/DcFUhqRbHbBYjcPvo9uIa7i3ztccA2IcPNjXwSZ/67Qwhs8pEX8j/HXeHvxw 93df3wEp8sT1v3KNz39iAtv/5GK29Rvl2QwMK0WBKbuAsvVBBUxdzbuCEnY7WYezsKge 0Eh0ekjpKLpbRF4mkuu4/ZplAcqUYubSLUEgxK6sY+vaYIVUs1y2KWD1SMzaLPnFOOzH t57A== 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=3uJCOUcCa+QNGhT/ES7N0Gs1weA2TXULzhkEQY1X4Jo=; b=Gi1vE27ft2uudG9GNYfYVSfxs6e3VP5TxXT2wzdG7fOj7RPn4AdGazgwOHmTjtIHqG mZHz7NqBabjYRWlSTa/A76DVhoL+2OiIt1xVi0QWcGfVu5YbuAa8VysvVYYBYLriKVbI Af7vFSvP/tvU/uD1Q9bQ3zyrCbBy2oaqVajzIqAsC8jRhAO8kmCmmKOoYlucsPYdANlY daKhRkk/W+UwgcluVfDJ+WejElnnx+d5rtHq3YVty6FlJKX0jNTKInfkFz1v8RMFeFtw fk4c+kEBsSHPauBVF3XCuHHoSXWQeXa9DYJUAAomT3ERhS5IqW99nIwnH9DSccgcYvp8 R6jQ== X-Gm-Message-State: AOAM532h+YYqYhQ4uaxaTD0BSNXMeWgCWWsPb/zdMhtjuWYqX99bVpI/ 5JxQPZWgmYxgBfT+IGY07jo5wwx8Oi1FzJjygCDVMA== X-Received: by 2002:a05:6830:2415:: with SMTP id j21mr4976789ots.221.1605668466163; Tue, 17 Nov 2020 19:01:06 -0800 (PST) MIME-Version: 1.0 References: <20201117181935.3613581-1-minchan@kernel.org> <20201117181935.3613581-5-minchan@kernel.org> In-Reply-To: <20201117181935.3613581-5-minchan@kernel.org> From: John Stultz Date: Tue, 17 Nov 2020 19:00:54 -0800 Message-ID: Subject: Re: [PATCH 4/4] dma-heap: Devicetree binding for chunk heap To: Minchan Kim Cc: Andrew Morton , LKML , linux-mm , Hyesoo Yu , Matthew Wilcox , david@redhat.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, Suren Baghdasaryan , KyongHo Cho , John Dias , Hridya Valsaraju , Sumit Semwal , Brian Starkey , linux-media , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Rob Herring , Christian Koenig , "moderated list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 17, 2020 at 10:19 AM Minchan Kim wrote: > > From: Hyesoo Yu > > Document devicetree binding for chunk heap on dma heap framework > > Signed-off-by: Hyesoo Yu > Signed-off-by: Minchan Kim > --- > .../bindings/dma-buf/chunk_heap.yaml | 52 +++++++++++++++++++ > 1 file changed, 52 insertions(+) > create mode 100644 Documentation/devicetree/bindings/dma-buf/chunk_heap.yaml > > diff --git a/Documentation/devicetree/bindings/dma-buf/chunk_heap.yaml b/Documentation/devicetree/bindings/dma-buf/chunk_heap.yaml > new file mode 100644 > index 000000000000..f382bee02778 > --- /dev/null > +++ b/Documentation/devicetree/bindings/dma-buf/chunk_heap.yaml > @@ -0,0 +1,52 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/dma-buf/chunk_heap.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Device tree binding for chunk heap on DMA HEAP FRAMEWORK > + > +maintainers: > + - Sumit Semwal > + > +description: | > + The chunk heap is backed by the Contiguous Memory Allocator (CMA) and > + allocates the buffers that are made up to a list of fixed size chunks > + taken from CMA. Chunk sizes are configurated when the heaps are created. > + > +properties: > + compatible: > + enum: > + - dma_heap,chunk > + > + memory-region: > + maxItems: 1 > + > + alignment: > + maxItems: 1 > + > +required: > + - compatible > + - memory-region > + - alignment > + > +additionalProperties: false > + > +examples: > + - | > + reserved-memory { > + #address-cells = <2>; > + #size-cells = <1>; > + > + chunk_memory: chunk_memory { > + compatible = "shared-dma-pool"; > + reusable; > + size = <0x10000000>; > + }; > + }; > + > + chunk_default_heap: chunk_default_heap { > + compatible = "dma_heap,chunk"; > + memory-region = <&chunk_memory>; > + alignment = <0x10000>; > + }; So I suspect Rob will push back on this as he has for other dt bindings related to ion/dmabuf heaps (I tried to push a similar solution to exporting multiple CMA areas via dmabuf heaps). The proposal he seemed to like best was having an in-kernel function that a driver would call to initialize the heap (associated with the CMA region the driver is interested in). Similar to Kunihiko Hayashi's patch here: - https://lore.kernel.org/lkml/1594948208-4739-1-git-send-email-hayashi.kunihiko@socionext.com/ The one sticking point for that patch (which I think is a good one), is that we don't have any in-tree users, so it couldn't be merged yet. A similar approach might be good here, but again we probably need to have at least one in-tree user which could call such a registration function. thanks -john