Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2937416ybz; Mon, 27 Apr 2020 07:15:48 -0700 (PDT) X-Google-Smtp-Source: APiQypI/v74BKxbffSloS/gKl0rcyLuB6pAOGwXmFVTslznK9Hg86WMq+zsKL3bHM8fe7/FMZK1h X-Received: by 2002:a17:906:7383:: with SMTP id f3mr19127595ejl.197.1587996947863; Mon, 27 Apr 2020 07:15:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587996947; cv=none; d=google.com; s=arc-20160816; b=KJXE9k9VII8t/jsWZSPuePc9mHhpp+DWadnmpNBZZKTvghAbManzXBm3NnrhusLvID rqZ5t8o5N1BhSnZEFie3jDQTPDsjjmLqZnGDTq3r5XlMBge8EJ+tea+eAWaYBDkYbN7M O+FGpXKmjJOAsiUaXs24cUds63X7nabjaR5VK6xxrAlgfaRhPxgJs8f5fbpzK8Z2fmlC R46WzmcCTFbk9sITf8yIluyFct6FMiso8abiXCKbBf+FKIm8vF5p/bRz0Gd0/zkbQf/c Fuw1p7Si2UU98JB299kUu0KoRVON52x7oHYLLZT79Ezb6Jebuv/uqgYkyyOlDsDA5eJY ChDw== 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=burAA+Cs5KeRQP2XLKt8rOIcO2gbNQ+0xzHRSdAD2ms=; b=U6L9/tL7wP71y45UqF4EHw3FHjSlAwjZrlG3R/gnwl1AQwM9dT9exj13gBX+kLf3HC Jo6rdxkFQ7UWsUj0jBstUpZjVf8cH+ks9HG+ZtMTZ124PEYrmiNPMzxAgQoqy9wdTgOz jWj3tU5DMlL+pgxlt60YYdmOCbue7NA3goVE/z0/cNZ+7QWMyP8Swnjw2CzEztLX4wWX dmJLYcxhvYIwDMMcHA2ozdlI2ib4YUvNNNX/Y0eOtx6TYjZ0GMRXqWg1O7spORbjkwKG wk7Xo2M7PrxDtrhef+jQd5+tNe5cwWDTGZg98mVVU4nd0gLg1WWFuQdFx9Y/Cf71p/BG NXkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=osEHPWYd; 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 di22si7897079edb.427.2020.04.27.07.15.15; Mon, 27 Apr 2020 07:15:47 -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=osEHPWYd; 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 S1728052AbgD0ONV (ORCPT + 99 others); Mon, 27 Apr 2020 10:13:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:42236 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727059AbgD0ONV (ORCPT ); Mon, 27 Apr 2020 10:13:21 -0400 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (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 5CAD32063A for ; Mon, 27 Apr 2020 14:13:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587996800; bh=Xg8u6B1gRKJJyhc2ghpbZWMsF25bOlRNgkDeAPMsyhQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=osEHPWYdXxkYQ78QupC0ZbxmDHM4nKIFYj+hceaPPcun89vocxPgKHy9Qq40zoUbk QrSGQhV62SZsNwG4VYijAjgIkna3Zq5CZv8uSHXvJpUm0nEf2beyNZ5DWzkUmgTNml Q4e1Vc2b+Xxgtf65Jn47m5wnj59udKDIW1tjL3uk= Received: by mail-qt1-f176.google.com with SMTP id x12so13785235qts.9 for ; Mon, 27 Apr 2020 07:13:20 -0700 (PDT) X-Gm-Message-State: AGi0PubIF6YXTfdX4GnVJSw1Pd26mPUtiDnstmb8CcUf6rarSzqnP6so wRCw2HSPTfPmP2buFcsolyAQgIVLiNWAQ/kS+w== X-Received: by 2002:ac8:7cba:: with SMTP id z26mr23458821qtv.143.1587996798916; Mon, 27 Apr 2020 07:13:18 -0700 (PDT) MIME-Version: 1.0 References: <20200420030538.101696-1-wenhu.wang@vivo.com> In-Reply-To: <20200420030538.101696-1-wenhu.wang@vivo.com> From: Rob Herring Date: Mon, 27 Apr 2020 09:13:06 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2,RESEND] misc: new driver sram_uapi for user level SRAM access To: Wang Wenhu Cc: Greg Kroah-Hartman , Arnd Bergmann , "linux-kernel@vger.kernel.org" , linuxppc-dev , kernel@vivo.com, Christophe Leroy , Scott Wood , Michael Ellerman , Randy Dunlap 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 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/