Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3434347ybz; Mon, 27 Apr 2020 16:01:08 -0700 (PDT) X-Google-Smtp-Source: APiQypKCYl3Sto9B0wdWpyLm2WDRL+ODavHj7y/K8ZQ1vk6TOP8jz8qo1dG3Yyd/tsSFn/O4sig5 X-Received: by 2002:a17:906:bfc9:: with SMTP id us9mr20616408ejb.84.1588028468240; Mon, 27 Apr 2020 16:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588028468; cv=none; d=google.com; s=arc-20160816; b=cxbpR1S0cll8JQEE9/8luf1GB2O7fxZy38pq72xE8m+jRv4Ju+pgs0gRnNpiTqujfA 2hO8NHtBFCN7LwaNfb/XPgif8lai+zoqCAlLVi4iK6kyfCUmKGzemGudqBWMuk2S4tr2 ktjfGqxBl7ctxX1V3DrBXDEYUnhRqQyuXoTjMBo0WezaISs/TCi3ZEmS9+mcz24vWePF kyEag5y4Yaaue2wPZ2Hl7nHgWDMvBJjOc5NWAE/sMJ7TQmKgsOe6+b0AbJzgvE7psfwn Xf0RZ53iMsdq+RVbEq0N4VZG88QoccVo6aR8EHxL0Q4FETtwvbJR4Ygj/Y9XDYkjDF0K dFew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:organization:references:in-reply-to:date:cc:to:from :message-id; bh=dDCHyzi4TrImQ36/HsNqILJkUqPzST6x3zbF1tVuGLc=; b=0hQsecVV9hN7iyQYEScP3SvgRax+AfEWLvICa/4RsqrcL9lNsufrnqOR551//5ZovT dPzITmkpKoaflIJmbYfWh8TIUpT6tATHz8QB1HEUNxf1KIZC9H7svCTsCpNoQd5Htjai v7GnzToMLf8e8Dv/fQTKHzeJyOAnk3oxeb6BflM79J7sqvykFT0kCrdNcddAZjQfnkhc FbADAxjwXrv/wHxF5n1qgIpliEtygQ7s+Kg5iVXPecBaLpyFQwmtQh7oYQ7H4A4pDZHZ 9Ua7b/kTk+IVKVJz9g3SvWbbsdxiC8eEz8p3EBUOx9PA7esC+QkyOtHGA+bwgUh9t9eJ 6ofw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a20si599392ejj.269.2020.04.27.16.00.44; Mon, 27 Apr 2020 16:01:08 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726284AbgD0W5N (ORCPT + 99 others); Mon, 27 Apr 2020 18:57:13 -0400 Received: from baldur.buserror.net ([165.227.176.147]:37686 "EHLO baldur.buserror.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726204AbgD0W5N (ORCPT ); Mon, 27 Apr 2020 18:57:13 -0400 Received: from [2601:449:8480:af0:12bf:48ff:fe84:c9a0] by baldur.buserror.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jTCeO-00063X-4Q; Mon, 27 Apr 2020 17:54:56 -0500 Message-ID: <4da39cdb0bb2b6a840c15560c4144e788f57fee4.camel@buserror.net> From: Scott Wood To: Rob Herring , Wang Wenhu Cc: Greg Kroah-Hartman , Arnd Bergmann , "linux-kernel@vger.kernel.org" , linuxppc-dev , kernel@vivo.com, Christophe Leroy , Michael Ellerman , Randy Dunlap Date: Mon, 27 Apr 2020 17:54:53 -0500 In-Reply-To: References: <20200420030538.101696-1-wenhu.wang@vivo.com> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2601:449:8480:af0:12bf:48ff:fe84:c9a0 X-SA-Exim-Rcpt-To: robh@kernel.org, wenhu.wang@vivo.com, gregkh@linuxfoundation.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kernel@vivo.com, christophe.leroy@c-s.fr, mpe@ellerman.id.au, rdunlap@infradead.org X-SA-Exim-Mail-From: oss@buserror.net X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on baldur.localdomain X-Spam-Level: X-Spam-Status: No, score=-17.5 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -15 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -1.5 GREYLIST_ISWHITE The incoming server has been whitelisted for * this recipient and sender Subject: Re: [PATCH v2,RESEND] misc: new driver sram_uapi for user level SRAM access X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on baldur.buserror.net) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2020-04-27 at 09:13 -0500, Rob Herring wrote: > On Sun, Apr 19, 2020 at 10:06 PM Wang Wenhu wrote: > > > > A generic User-Kernel interface that allows a misc device created > > by it to support file-operations of ioctl and mmap to access SRAM > > memory from user level. Different kinds of SRAM alloction and free > > APIs could be registered by specific SRAM hardware level driver to > > the available list and then be chosen by users to allocate and map > > SRAM memory from user level. > > > > It is extremely helpful for the user space applications that require > > high performance memory accesses, such as embedded networking devices > > that would process data in user space, and PowerPC e500 is a case. > > > > Signed-off-by: Wang Wenhu > > Cc: Greg Kroah-Hartman > > Cc: Arnd Bergmann > > Cc: Christophe Leroy > > Cc: Scott Wood > > Cc: Michael Ellerman > > Cc: Randy Dunlap > > Cc: linuxppc-dev@lists.ozlabs.org > > --- > > Changes since v1: addressed comments from Arnd > > * Changed the ioctl cmd definitions using _IO micros > > * Export interfaces for HW-SRAM drivers to register apis to available > > list > > * Modified allocation alignment to PAGE_SIZE > > * Use phys_addr_t as type of SRAM resource size and offset > > * Support compat_ioctl > > * Misc device name:sram > > > > Note: From this on, the SRAM_UAPI driver is independent to any hardware > > drivers, so I would only commit the patch itself as v2, while the v1 of > > it was wrapped together with patches for Freescale L2-Cache-SRAM device. > > Then after, I'd create patches for Freescale L2-Cache-SRAM device as > > another series. > > There's work to add SRAM support to dma-buf heaps[1]. Take a look and > see if that works for you. > > Rob > > [1] https://lore.kernel.org/lkml/20200424222740.16259-1-afd@ti.com/ > The dma heap API itself (what makes it specific to DMA, rather than any special-purpose allocator?) seems like it could be what we're looking for. The issue with drivers/misc/sram.c is that it seems like its main purpose is to get sram description from the device tree, but this sram isn't static (it's a reconfiguration of L2 cache into SRAM mode) and thus can't be described by mmio-sram. -Scott