Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp413087pxb; Thu, 21 Jan 2021 10:00:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7jS6Q2M3KjhG9bB8QmG/XxRqcQjtSIPEsjGBFBCLt+/5THzSo4vlJ4q39G51Wrrvlm3K5 X-Received: by 2002:a17:906:1291:: with SMTP id k17mr477606ejb.288.1611252007449; Thu, 21 Jan 2021 10:00:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611252007; cv=none; d=google.com; s=arc-20160816; b=XYXrYzyMWtiVNsxEe9L+caGpH70z+GprHPb2XBKtE2LTIraev1wQrvduYHDqvgmlQ0 0Y5PI289+s7XU6YIU2qkCxEvjcRrFgU7079T/XOTlDAAfJe5n3q4irf8oHHyGCSEZ6ji 5i/JyHYryiQsnpJlLVAQh/jvS6ehWEsQj+FVdbIUh1Ndf/qrbzl0PIeTCp2JO/20JrGN 8Ka/SEptjwIRTa1Mc7UgLGE7cxKdiK4hFWSv1xsXQZgi55UdqziFyJdl/kAps0wd6YpD 3+x3R7Tq+JEAuskD5l4rtEVXEmU+rSMt391+xFAGHwNn8U+wcCToi5KvyT62kARdEULb 2DTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=K8nQ7vZePLiBr4AwY3n+MiyEOXEnc2UqVALdrd2awxo=; b=OqiTEygzesKNSCPvGcZTJ455JgEKPtc0GxRYwhCO8IG4oUO5Rx8C7EBdnxS9OBoJia AC4+i6I/5/3pgDoowvuSXnvo4lNeGtETX8vdi1KaQb7N11soY3kqQRlBImhXblP55Vel rVaulQ5BVSrD9zIp+QHGF31ZWHqQcm1VEtQwHQ0Nj6bCnixT/oALTHKM4SvrvbMR+MmC zeUIFufdAPo2JA1dRJjQY1qpS80xVxfETkTA2JD+LhANQ+N5LTtDSSHc+glCGlvb3abR CSDoBeZCl5OBKozdcOaWlsssYqiop/v24N4m37zdkYv35bEqq3hvWfWaTUvlL7y42zrb DCNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PVpV8V+s; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n5si2547076eda.301.2021.01.21.09.59.43; Thu, 21 Jan 2021 10:00:07 -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=@gmail.com header.s=20161025 header.b=PVpV8V+s; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388100AbhAUR4K (ORCPT + 99 others); Thu, 21 Jan 2021 12:56:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389311AbhAURzz (ORCPT ); Thu, 21 Jan 2021 12:55:55 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80484C0613ED; Thu, 21 Jan 2021 09:55:15 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id j12so2116039pjy.5; Thu, 21 Jan 2021 09:55:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K8nQ7vZePLiBr4AwY3n+MiyEOXEnc2UqVALdrd2awxo=; b=PVpV8V+s0wyvXhKyAIPSie0XgUgDIJQGqojYz53hp4jmRi5GJwvTzVJiYzHzAwaxP+ tL3Hf4oxKufPJomneZrTCnhcasC4lil6Di9IvP1gQCbW/ReneiTOrtnen2GYgi78QPWc 2u0VLyN+agWRvFgsJ5WB4tYzDpmsIJayReSKTcHMWJQcPHPp26WBTd4P1BYW0qdHQoFa Uks8tfAiQ1qZS0ebe4lh2D1ZZp/1pgkbWiJr506XrVWNgSa0bFETsPheHdcNn+xvw0dg Gn4iNfhnMyCv0kU4oX8y6/jPKoygMjwET/5AzqQuB/IG3svfpXUEXSjyF1v2CiG96qR5 rA0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=K8nQ7vZePLiBr4AwY3n+MiyEOXEnc2UqVALdrd2awxo=; b=NtM7Vs8jqaSnCEnYqoo4xiZNcs0w0Wb1wUrX1nL4oINsOCS4e9ZudT8aMIKDrrH4bg kn4heMKX8H3d+lBU5lsV3yvQ264i3W68ip/hLQ4LjnPhYZdx9jbHAkoP90X2XqJLNK1y KtnQd5FGktLGZ+RNVWyM27Nmy8uS4c6S/7PMCJKufEwDKRlSFFFSAW33DNuYsEzYBYk1 soeqGGNfI0iWW/jcL1CZRXr0PDXYDBqXiclqVNtY2caF7Vvvxfr0ZdnVlIV/RnJKWLgi EsRa5Wp2PAPMbnvUaCLDAuTPn/9iQzizQQ4DfHgb425Ie2JmT0fnheKGtc2bpYrMFq9F pZjQ== X-Gm-Message-State: AOAM532RDL0JiCJFldC9IDIeDZQCVTU7CHjxm7EFlrKkAv0DUL8s4/QU kkCF+J2Glm5zt+bKu7dKELU= X-Received: by 2002:a17:902:b496:b029:da:d356:be8c with SMTP id y22-20020a170902b496b02900dad356be8cmr854145plr.56.1611251715067; Thu, 21 Jan 2021 09:55:15 -0800 (PST) Received: from bbox-1.mtv.corp.google.com ([2620:15c:211:201:74d0:bb24:e25e:dc4d]) by smtp.gmail.com with ESMTPSA id t2sm6897317pju.19.2021.01.21.09.55.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 09:55:14 -0800 (PST) Sender: Minchan Kim From: Minchan Kim To: Andrew Morton Cc: linux-mm , LKML , hyesoo.yu@samsung.com, david@redhat.com, mhocko@suse.com, surenb@google.com, pullip.cho@samsung.com, joaodias@google.com, hridya@google.com, john.stultz@linaro.org, sumit.semwal@linaro.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, hch@infradead.org, robh+dt@kernel.org, linaro-mm-sig@lists.linaro.org, Minchan Kim Subject: [PATCH v4 3/4] dt-bindings: reserved-memory: Make DMA-BUF CMA heap DT-configurable Date: Thu, 21 Jan 2021 09:55:01 -0800 Message-Id: <20210121175502.274391-4-minchan@kernel.org> X-Mailer: git-send-email 2.30.0.296.g2bfb1c46d8-goog In-Reply-To: <20210121175502.274391-1-minchan@kernel.org> References: <20210121175502.274391-1-minchan@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. The chunk heap's allocator allocates from the CMA area. It is 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. Signed-off-by: Hyesoo Yu Signed-off-by: Minchan Kim Signed-off-by: Hridya Valsaraju --- .../reserved-memory/dma_heap_chunk.yaml | 56 +++++++++++++++++++ 1 file changed, 56 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..00db0ae6af61 --- /dev/null +++ b/Documentation/devicetree/bindings/reserved-memory/dma_heap_chunk.yaml @@ -0,0 +1,56 @@ +# 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 + + +properties: + compatible: + enum: + - dma_heap,chunk + + 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.296.g2bfb1c46d8-goog