Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3006294ybz; Mon, 27 Apr 2020 08:22:08 -0700 (PDT) X-Google-Smtp-Source: APiQypIS0K8yP4D1XFI2Wrh1Mdnho+5zfHoqUXICU87OeY3Waq3yL1fyXITqtaS5ea83YiHWKgFg X-Received: by 2002:a17:906:9706:: with SMTP id k6mr20772945ejx.103.1588000927794; Mon, 27 Apr 2020 08:22:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588000927; cv=none; d=google.com; s=arc-20160816; b=mNO0XGNPBxTa0EY1OF9vz5JOTG/ZMKaaBMmulj2bsjhThFMPz/Mthcpvk5hblh/1yJ Mysa/s+XMQY5bVbAIhp/HkwuUp9kkWHYMPkNJK7bkOHx94iDm9a9Rvd7kd/7ZCbLHiS9 79ghjhJCikjMI0VEHaUMvBKcU6EeZdvw0FOsF7fPzDMAR/KuP4zx70T0OYVbqdhjho/S APX/kwh1iRitMAwxH0EbqXFSsCVcW+QHhLTTOGV8CL1zaP3WXg21K5Vilj7qYXaMIP9k d2AAlw+JEHB28rxPScN1Sq1Y6TARHWxOAo3vEvvRjsDI8QTwIxdsiv/DBKzOt5VRAH81 OlDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=QsRCfLG2ZnAKf9Xc+P2GozIV/e3XI3SWeqBV7GRurEE=; b=zCazHzc9ueQTgBsa40dIjWBiLrO+fliRg6cImV9gaj2P8ljGAXaqZLptAhyRrsIBWK 1ShDa+bvPs09HbsfZqYki7HeQtENes07FiD19wnz3NYwrAMm/T5EIbU0oHl3wmJeCuCQ 8leDaajonEyxRkNZ8pKe8n6AGpuDGz+frlE52lVPWnb5cxJFfsQGMwQsuA15cQm38YFq JjsDSSVMRu3fWyDhvtJ+fy5Z6N6O4gEpIZ+L/f/C3uG8eZJefZBo6NzSmxDKYQrvWFRA Vg0f5G3h/C7V9e3x3dDOsM0l9v2Bd5K+ZohypRe4MNg+D+J4s+croX5tpntcWCY1lPDP oMOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=d9vkwjdT; 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 p22si2578919edx.177.2020.04.27.08.21.44; Mon, 27 Apr 2020 08:22:07 -0700 (PDT) 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=@kernel.org header.s=default header.b=d9vkwjdT; 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 S1727840AbgD0PRw (ORCPT + 99 others); Mon, 27 Apr 2020 11:17:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:41056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726539AbgD0PRv (ORCPT ); Mon, 27 Apr 2020 11:17:51 -0400 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4147D206E9 for ; Mon, 27 Apr 2020 15:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588000671; bh=GAViimdK4fDnDt6xwfFThdx7LtwYD225IliGLg41saw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=d9vkwjdTTR1LayfIUQrZuuh0K8KI99nJUoUy105Kssj/DAN830gEcpyL3PBNgNSqd LzDFnZXBB+KXfYurOZEnrJo9s3Li/U6qtBlzToQnjeH0pqXNOA+fdrFTHa2tD7TP4R BlYkUFvg+kwbDXojJlh2j4Ft7aQn2rxhe+asm4y0= Received: by mail-qk1-f178.google.com with SMTP id q7so6214121qkf.3 for ; Mon, 27 Apr 2020 08:17:51 -0700 (PDT) X-Gm-Message-State: AGi0PubQHOhdV86cncq9JnrDi8c08i00W5yKKqn23PH56PUMPik2Mut8 VyHY2xyEyxL+QJMmCevKXt2JhYRn37jBoUmzFQ== X-Received: by 2002:a37:61cd:: with SMTP id v196mr22311959qkb.393.1588000670247; Mon, 27 Apr 2020 08:17:50 -0700 (PDT) MIME-Version: 1.0 References: <20200424222740.16259-1-afd@ti.com> In-Reply-To: <20200424222740.16259-1-afd@ti.com> From: Rob Herring Date: Mon, 27 Apr 2020 10:17:37 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] misc: sram: Add dma-heap-export reserved SRAM area type To: "Andrew F. Davis" Cc: Sumit Semwal , John Stultz , Arnd Bergmann , Greg Kroah-Hartman , Philipp Zabel , dri-devel , linaro-mm-sig@lists.linaro.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 24, 2020 at 5:27 PM Andrew F. Davis wrote: > > This new export type exposes to userspace the SRAM area as a DMA-Heap, > this allows for allocations as DMA-BUFs that can be consumed by various > DMA-BUF supporting devices. > > Signed-off-by: Andrew F. Davis > --- > .../devicetree/bindings/sram/sram.yaml | 8 + Separate patch and needs to go to DT list... > drivers/misc/Kconfig | 7 + > drivers/misc/Makefile | 1 + > drivers/misc/sram-dma-heap.c | 243 ++++++++++++++++++ > drivers/misc/sram.c | 20 +- > drivers/misc/sram.h | 17 ++ > 6 files changed, 292 insertions(+), 4 deletions(-) > create mode 100644 drivers/misc/sram-dma-heap.c > > diff --git a/Documentation/devicetree/bindings/sram/sram.yaml b/Documentation/devicetree/bindings/sram/sram.yaml > index 7b83cc6c9bfa..b8e33c8d205d 100644 > --- a/Documentation/devicetree/bindings/sram/sram.yaml > +++ b/Documentation/devicetree/bindings/sram/sram.yaml > @@ -105,6 +105,14 @@ patternProperties: > manipulation of the page attributes. > type: boolean > > + dma-heap-export: > + description: > + Similar to 'pool' and 'export' this region will be exported for use > + by drivers, devices, and userspace using the DMA-Heaps framework. > + NOTE: This region must be page aligned on start and end in order to > + properly allow manipulation of the page attributes. > + type: boolean Though I'm not sure this should be in DT. You have to change your firmware to enable a new kernel feature? We also already have 'export' which sounds like the same function. Or 'pool' though reading the description, I don't really understand it's use. What combination of all 3 of these options would be valid? Rob