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=-15.7 required=3.0 tests=BAYES_00,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 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 D907CC5519F for ; Wed, 18 Nov 2020 03:01:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 463CA2222B for ; Wed, 18 Nov 2020 03:01:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iudQYKUw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 463CA2222B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 575906B0036; Tue, 17 Nov 2020 22:01:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4FF666B0068; Tue, 17 Nov 2020 22:01:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 37A366B006C; Tue, 17 Nov 2020 22:01:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 07BA36B0036 for ; Tue, 17 Nov 2020 22:01:07 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7CD4B1EE6 for ; Wed, 18 Nov 2020 03:01:07 +0000 (UTC) X-FDA: 77496037374.27.cast10_6117d2927336 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 5F2643D669 for ; Wed, 18 Nov 2020 03:01:07 +0000 (UTC) X-HE-Tag: cast10_6117d2927336 X-Filterd-Recvd-Size: 6336 Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Wed, 18 Nov 2020 03:01:06 +0000 (UTC) Received: by mail-ot1-f66.google.com with SMTP id z16so373161otq.6 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=D5ebddM2mM3VK4fFLVMuK0Zg1HsjlWDlwh9thpspb/IC+w7jKP/UhqpttErDYzCDV5 7cZiMwKvoT4dmepHIEt40q94TzuekGAsZkDVf8kLr9E2cICzZ/ZjWt+uv82hnCNpXw2N e1m47SNnWEdeEYi/vZnN2/6ab1dt7L12sAnqvKBaJnPtdT3Qu1JzAq+fDRubutx6gwOi gpr2kb1EE8gaLCcWiC/f4DvxYaayQW+LNf53in1gaP7quxmKmmFlLFuOXJzJTHeO/sEx SiL58yLInksbJ8BaA6vaonUAr/tROBZFbjCJsene0EePosoO6RDceF4xxnL+vnGbtlPt rhvA== X-Gm-Message-State: AOAM532wgYDJe11bvdEqPBggqSlCTnUlKJx9k9f7ib9IRg6xt6iRYZOi LHykaE3cJ4k0R+Nh9Glf3JwMXJt2+9cEm/Q5Wkf6Wg== X-Google-Smtp-Source: ABdhPJzGGlEp/RY02FjhdSrOME5ixmXEwMqcM3Kp5XSh8B606VPzwVjQm4NMFjXTadyAYc+lrXxzVUAwYI5nu6c9VOY= 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" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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