Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1086687lqt; Fri, 19 Apr 2024 23:36:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXhmuKE3x7yNBICRlKs2l+smjJXFg5nNO2TNeCkaFAQ8dthvR1GOHYaMYwFxU+AkQ1U87t55TLwMXL0ULNR2hGOwLWB4ZTiZ5tLjtaXmA== X-Google-Smtp-Source: AGHT+IHabN2puTUT8K4ybRcRfVt7tZdhdDcaud1dbkYkcq0jdeIIi+EKAlg7JpconUibnTGAfveU X-Received: by 2002:a17:906:a90:b0:a51:9737:f23d with SMTP id y16-20020a1709060a9000b00a519737f23dmr3015656ejf.70.1713595012918; Fri, 19 Apr 2024 23:36:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713595012; cv=pass; d=google.com; s=arc-20160816; b=bJ1+HlYxa6KurGVs0jah1yELQvyMys2ucQJDDlaCfpDLNWsPRd9kP3wPjU09w84NEK 08WJRxrLd9zMfRdD1FyLfb+7DxEzLoLRAmya70y7pl5ghVyUYt9yvVyPcaIrKUaoADLB YlbSKUEPbxQ4fa+8ftJTkbWRMpTowWulGPkGEZmVHwq93uPun+2xMYBbHDzanMgnhrTJ z3SG5ch4ax39/IwdaY+sE/5dyL4oiCb3LCFzaJEpMe8C1GzrCDhx7pdZahnRemdkJEh9 Ywaph3O6WFmmsb7Jx330taTLnrPCvjNZ8oRj7cOO5rIcDHFTdMbJ0gleJNiTaI2wqQ0Q E2yw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Yt9MbsQYZIQ72kyOVZ8WmaeoiMXftcPAq26Qn3QiT60=; fh=NvTZr+F3/TXYA9eIxZlsTwSjKefcNOJ4YBWQ1rhvzKE=; b=tkUfCH0YVREEz1T1k7ggjrdNXujixNc3JywFNGsDCTeDjOwVaEHY8/q+mwes6DL7Kz rYEloZ06hGkjTx0W+gpz+4w3hPi2Zko+NonRIMOXQdmY/dyYZ2uFPnhya542T2nR06dd Hjk6g02o82by5NlI7t6EcaChJBuwnJ3lrOqSA2x44MS4V6wvdTnbS+FJE+z4312Jh9pk Ucn3C61nBv1YUQTDhK+azUA8yYRlqfBDGrwH3fCVvXebs4Afrg7fk2tESeWKYMIDpYJY owTOLxuyZ4Y1DXw8Dx6OJW9P8nIBivqfao1mlCWvHLsZQZ7F3BSKCF8kd+KNVdE2Evk0 9fcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0FsGL3L3; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-152160-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152160-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id he17-20020a1709073d9100b00a4a347e0896si3326494ejc.1024.2024.04.19.23.36.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 23:36:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152160-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0FsGL3L3; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-152160-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152160-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 81EB61F21502 for ; Sat, 20 Apr 2024 06:36:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EAC0911CB4; Sat, 20 Apr 2024 06:36:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="0FsGL3L3" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0AD8320EB; Sat, 20 Apr 2024 06:36:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713595002; cv=none; b=S+6m17LnGqeXkGnc4QcrJ1Csj09kz7nSSqrJujgPQEzGf0FXcxt1M3UhDzbUOULipH39JnyVxto40AmCU5VSHGgh2PoSbAfk16hv8CPHp35cW9kMD9hYep/5YMmZQOIlPRaLfz6DRwn+XZPx7gZQBztRdd4nuvnd/Kc3CrCBls0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713595002; c=relaxed/simple; bh=4ZTtTXI4g9M/agNAvTBYKN6n6HilBTuHVmnqwooqBfE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lJxXGn6x4sNhoqQYSqtLMi8LzLmcYg0CG2PKJHy4grP6FsrnLPAXdcQ61kYyVIQYvBq5A6Z7632rGLc9M1xAK4OioWSF7AzmmrZbWLaOrfea7v/ZEqupJuQBDIhqNqkWWR8cjgt+eLwW7dKgtG2E9EbtZhZ+FVjiUlno8rHFDUg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0FsGL3L3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCFCAC072AA; Sat, 20 Apr 2024 06:36:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713595001; bh=4ZTtTXI4g9M/agNAvTBYKN6n6HilBTuHVmnqwooqBfE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=0FsGL3L3LeROXc734pyxXG2RCzM8GIMTdZqalBjsuAwWZi6SJsD3JhFih9MygA9bE D67SPQ3KyoYcSoyKTfpl+yYe+OZe30YTkQTOP91tBSxltbxZq+xB6qjQGkTp4IOQwk Y7xQ2ue8J76g2LIpRiDBWca/BWuJfFcunV0dCSwo= Date: Sat, 20 Apr 2024 08:36:34 +0200 From: Greg Kroah-Hartman To: Christian Gmeiner Cc: Pascal FONTAIN , linux-kernel@vger.kernel.org, Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Sumit Semwal , Christian =?iso-8859-1?Q?K=F6nig?= , afd@ti.com, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Subject: Re: [PATCH v3 2/2] misc: sram: Add DMA-BUF Heap exporting of SRAM areas Message-ID: <2024042043-joyride-parish-3d3b@gregkh> References: <20240409120605.4138472-1-Pascal.FONTAIN@bachmann.info> <20240409120605.4138472-3-Pascal.FONTAIN@bachmann.info> <2024040944-flashcard-tribune-6a8e@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Apr 19, 2024 at 06:57:47PM +0200, Christian Gmeiner wrote: > Am Di., 9. Apr. 2024 um 14:14 Uhr schrieb Greg Kroah-Hartman > : > > > > On Tue, Apr 09, 2024 at 02:06:05PM +0200, Pascal FONTAIN wrote: > > > From: Andrew Davis > > > > > > This new export type exposes to userspace the SRAM area as a DMA-BUF > > > Heap, > > > this allows for allocations of DMA-BUFs that can be consumed by various > > > DMA-BUF supporting devices. > > > > > > Signed-off-by: Andrew Davis > > > Tested-by: Pascal Fontain > > > > When sending on a patch from someone else, you too must sign off on it > > as per our documenation. Please read it and understand what you are > > agreeing to when you do that for a new version please. > > > > > --- > > > drivers/misc/Kconfig | 7 + > > > drivers/misc/Makefile | 1 + > > > drivers/misc/sram-dma-heap.c | 246 +++++++++++++++++++++++++++++++++++ > > > drivers/misc/sram.c | 6 + > > > drivers/misc/sram.h | 16 +++ > > > 5 files changed, 276 insertions(+) > > > create mode 100644 drivers/misc/sram-dma-heap.c > > > > > > diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig > > > index 9e4ad4d61f06..e6674e913168 100644 > > > --- a/drivers/misc/Kconfig > > > +++ b/drivers/misc/Kconfig > > > @@ -448,6 +448,13 @@ config SRAM > > > config SRAM_EXEC > > > bool > > > > > > +config SRAM_DMA_HEAP > > > + bool "Export on-chip SRAM pools using DMA-Heaps" > > > + depends on DMABUF_HEAPS && SRAM > > > + help > > > + This driver allows the export of on-chip SRAM marked as both pool > > > + and exportable to userspace using the DMA-Heaps interface. > > > > What will use this in userspace? > > > > I could imagine a way it might be used. This implies it is not needed because no one actually has actually used it for anything, so why make this change? > Imagine a SoC like TI's AM64x series, where some cores (A53) run Linux > and others (R5F) are managed by remoteproc to > execute a RTOS. When it comes to efficiently exchanging large data > sets, the conventional method involves using rpmsg, > which has limitations due to message size and could potentially slow > down data transfer. However, an alternative > approach could be to allocate a sizable chunk of SRAM memory in > userspace. By utilizing memcpy() to copy data into > this memory, followed by a single rpmsg signal to notify the RTOS that > the data is ready, we can leverage the faster access > speed of SRAM compared to DDR from the remoteproc. Why is virtio not used instead? thanks, greg k-h